# System map — pact-foundation/pact-js

> Canonical page: https://codevetter.com/unpack/pact-js/system-map

# System map — pact-foundation/pact-js

Scanned commit 18f30a1aa44a948b3249a72879da3cff26c42d12 (2026-10-02). Generated by codevetter codevetter 1.15.0 on 2026-10-02.

Source inspection; upstream code and tests were not executed.

The repository delivers an npm SDK whose public entrypoint exposes several generations of contract-testing APIs. JavaScript owns builder state, callbacks, and verification middleware, while pact-core owns native contract and mock-server operations. Generated pact files connect consumer and provider testing; release and documentation workflows distribute the package and synchronize documentation.
- src/index.ts exports PactV2, Verifier, legacy message APIs, V3 exports, and V4 exports; PactV4 is aliased as Pact and MatchersV3 as Matchers. — [src/index.ts#L60-L98](https://github.com/pact-foundation/pact-js/blob/18f30a1aa44a948b3249a72879da3cff26c42d12/src/index.ts#L60-L98) [src/v4/index.ts#L95-L98](https://github.com/pact-foundation/pact-js/blob/18f30a1aa44a948b3249a72879da3cff26c42d12/src/v4/index.ts#L95-L98)
- PactV3 and PactV4 create ConsumerPact handles through makeConsumerPact and attach pact-js version metadata; their default specification versions are V3 and V4 respectively. — [src/v3/pact.ts#L328-L339](https://github.com/pact-foundation/pact-js/blob/18f30a1aa44a948b3249a72879da3cff26c42d12/src/v3/pact.ts#L328-L339) [src/v4/index.ts#L26-L34](https://github.com/pact-foundation/pact-js/blob/18f30a1aa44a948b3249a72879da3cff26c42d12/src/v4/index.ts#L26-L34)
- The API generations use different orchestration structures: V2 exposes setup/addInteraction/verify, V3 owns a mutable current interaction, and V4 returns staged HTTP, synchronous, asynchronous, and GraphQL builders. — [src/httpPact/index.ts#L119-L185](https://github.com/pact-foundation/pact-js/blob/18f30a1aa44a948b3249a72879da3cff26c42d12/src/httpPact/index.ts#L119-L185) [src/v3/pact.ts#L43-L70](https://github.com/pact-foundation/pact-js/blob/18f30a1aa44a948b3249a72879da3cff26c42d12/src/v3/pact.ts#L43-L70) [src/v4/index.ts#L36-L91](https://github.com/pact-foundation/pact-js/blob/18f30a1aa44a948b3249a72879da3cff26c42d12/src/v4/index.ts#L36-L91)
- Provider verification creates a temporary Express/http-proxy server with state and message endpoints, then passes its address and a message transport to serviceFactory.verifyPacts. — [src/dsl/verifier/verifier.ts#L92-L112](https://github.com/pact-foundation/pact-js/blob/18f30a1aa44a948b3249a72879da3cff26c42d12/src/dsl/verifier/verifier.ts#L92-L112) [src/dsl/verifier/verifier.ts#L132-L149](https://github.com/pact-foundation/pact-js/blob/18f30a1aa44a948b3249a72879da3cff26c42d12/src/dsl/verifier/verifier.ts#L132-L149) [src/dsl/verifier/proxy/proxy.ts#L73-L90](https://github.com/pact-foundation/pact-js/blob/18f30a1aa44a948b3249a72879da3cff26c42d12/src/dsl/verifier/proxy/proxy.ts#L73-L90)
- Contract persistence is delegated to pact-core writePactFile calls using caller-selected directories or ./pacts; V2 additionally passes merge-versus-overwrite behavior. — [src/v4/http/index.ts#L25-L37](https://github.com/pact-foundation/pact-js/blob/18f30a1aa44a948b3249a72879da3cff26c42d12/src/v4/http/index.ts#L25-L37) [src/httpPact/index.ts#L254-L268](https://github.com/pact-foundation/pact-js/blob/18f30a1aa44a948b3249a72879da3cff26c42d12/src/httpPact/index.ts#L254-L268) [src/messageConsumerPact.ts#L184-L197](https://github.com/pact-foundation/pact-js/blob/18f30a1aa44a948b3249a72879da3cff26c42d12/src/messageConsumerPact.ts#L184-L197)
- VerifierOptions combines pact-core options with local ProxyOptions; documented broker integration includes pactBrokerUrl, consumerVersionSelectors, broker authentication, and publishVerificationResult. — [src/dsl/verifier/types.ts#L1-L16](https://github.com/pact-foundation/pact-js/blob/18f30a1aa44a948b3249a72879da3cff26c42d12/src/dsl/verifier/types.ts#L1-L16) [docs/provider.md#L61-L85](https://github.com/pact-foundation/pact-js/blob/18f30a1aa44a948b3249a72879da3cff26c42d12/docs/provider.md#L61-L85) [src/dsl/verifier/verifier.ts#L136-L149](https://github.com/pact-foundation/pact-js/blob/18f30a1aa44a948b3249a72879da3cff26c42d12/src/dsl/verifier/verifier.ts#L136-L149)
- package.json requires Node >=22 and defines npm scripts for tsc compilation/distribution, Biome formatting/linting, tsc --noEmit, Vitest, and regression testing; tsconfig emits declarations and source maps into dist. — [package.json#L5-L25](https://github.com/pact-foundation/pact-js/blob/18f30a1aa44a948b3249a72879da3cff26c42d12/package.json#L5-L25) [package.json#L35-L37](https://github.com/pact-foundation/pact-js/blob/18f30a1aa44a948b3249a72879da3cff26c42d12/package.json#L35-L37) [tsconfig.json#L3-L21](https://github.com/pact-foundation/pact-js/blob/18f30a1aa44a948b3249a72879da3cff26c42d12/tsconfig.json#L3-L21)
- Publishing is dispatch-driven: latest checks out master and runs release.sh with SKIP_EXAMPLES=true, while the 9.x workflow checks out 9.x.x; Markdown pushes on master dispatch a docs.pact.io update. — [.github/workflows/publish.yml#L3-L40](https://github.com/pact-foundation/pact-js/blob/18f30a1aa44a948b3249a72879da3cff26c42d12/.github/workflows/publish.yml#L3-L40) [.github/workflows/publish-9x.yml#L3-L23](https://github.com/pact-foundation/pact-js/blob/18f30a1aa44a948b3249a72879da3cff26c42d12/.github/workflows/publish-9x.yml#L3-L23) [.github/workflows/trigger_pact_docs_update.yml#L3-L19](https://github.com/pact-foundation/pact-js/blob/18f30a1aa44a948b3249a72879da3cff26c42d12/.github/workflows/trigger_pact_docs_update.yml#L3-L19)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
