
Pact Review
- MIT core, Apache 2.0 for some libraries
- Free to use forever
- Consumer-driven contract testing
- Open-source Pact Broker
- PactFlow is the commercial broker
- No licensing costs
- No paid tier for the framework
- Self-hosted Pact Broker
- Multi-language implementations
- Created around 2013 at realestate.com.au
- Originated by Beth Skurrie and contributors
- Commercial PactFlow now part of SmartBear
- The de-facto contract testing standard
Overview
Pact is the canonical open-source consumer-driven contract testing framework for HTTP APIs and asynchronous messaging. A consumer test runs against a Pact mock provider and generates a pact file, a JSON contract that records the exact requests and responses the consumer relies on. The provider is later verified by replaying those interactions against the real service, so the two sides are tested without standing up a shared integration environment. It originated around 2013 at realestate.com.au, with Beth Skurrie and contributors, and is maintained by the Pact Foundation community.
Pact is genuinely a contract testing tool, and it defines the category. Most of its libraries are MIT licensed, with the JVM and PHP libraries under Apache 2.0. It ships an open-source Pact Broker for sharing pacts and verification results, with can-i-deploy deployment checks, webhooks, versioning, and a dependency matrix. The commercial path is PactFlow, now part of SmartBear and branded the API Hub for Contract Testing, which adds bi-directional contract testing, AI test generation, and enterprise features.
Pact is for microservices teams that want to deploy and evolve services independently, with consumer-driven contracts and can-i-deploy gating in CI replacing brittle end-to-end environments. It has official implementations across many languages, consolidating on a shared Rust core. Buyers should note the consumer-driven model needs consumer buy-in, that async messaging is more complex than HTTP, that you either run the broker or pay for PactFlow, and that it does not fit public third-party APIs whose provider you cannot verify.
Key Featuresโ
Consumer-Driven Contractsโ
A consumer test against a Pact mock generates a pact file capturing the exact interactions the consumer uses. This is the heart of consumer-driven contract testing.
Provider Verificationโ
The provider replays the recorded interactions against the real service and passes when each response contains at least the expected data. Provider states set up preconditions.
Pact Brokerโ
The open-source Pact Broker stores and shares pacts and verification results, with a dependency diagram and a compatibility matrix. This coordinates contracts across teams.
can-i-deployโ
The can-i-deploy tool checks which application versions are safe to deploy together. This gates deployments in CI.
Versioning and Webhooksโ
Versioning, tags, branches, and environments track app versions, and webhooks trigger CI on contract changes. Pending and WIP pacts let new contracts land without breaking provider builds.
HTTP and Async Messagingโ
Pact covers HTTP request and response plus asynchronous message pacts for systems such as Kafka and RabbitMQ. This handles event-driven integrations.
Pact Specification v4โ
The Pact Specification v4 unifies HTTP and message files, and adds plugins for protocols such as gRPC. This extends contract testing beyond REST.
Bi-Directional Contract Testingโ
PactFlow adds bi-directional contract testing, which compares a provider's OpenAPI spec to the consumer contract instead of active replay. This is a commercial-only workflow.
Best Selling Pointsโ
- The de-facto consumer-driven contract testing standard.
- An open-source Pact Broker with can-i-deploy and a compatibility matrix.
- Official implementations across many languages on a shared Rust core.
- HTTP and asynchronous messaging contracts in one framework.
- Free and open source, with a commercial PactFlow path when needed.
- A mature deployment-safety workflow for independent microservice releases.
Supported Integrationsโ
Pact integrates with many languages, test frameworks, and CI/CD through the broker and can-i-deploy.
Connect Pact across languages, test frameworks, and CI/CD.
- JVM
- JavaScript
- .NET
- Pact Broker
- CI/CD
- Async messaging
Language Implementations
- JVM (Java, Kotlin, Scala)
- JavaScript / Node
- .NET / C#
- Go
- Python
- Ruby
- PHP
- Swift
Test Frameworks
- JUnit and JUnit 5
- pytest
- Jest and Mocha
- xUnit
- RSpec
- PHPUnit
CI/CD Platforms
- GitHub Actions
- GitLab CI/CD
- Jenkins
- CircleCI
Broker & Commercial
- Pact Broker (OSS)
- PactFlow (commercial)
- Webhooks
- Slack via webhooks
Adoptersโ
Pact is the most widely used contract testing tool, adopted across microservices organizations.
- Microservices teams
- Platform and SRE teams
- API-first organizations
- Fintech and e-commerce
- Event-driven systems
- CI/CD-driven teams
- Open-source projects
- Enterprise API programs
Adoption & Usage Statisticsโ
- 9,000+ combined GitHub stars across libraries
- ~2.2k stars on the original pact-ruby
- 11 official language implementations
- v4 current Pact Specification
- 2013 origin at realestate.com.au
- The de-facto consumer-driven contract testing tool
Note: Pact is adopted across the engineering community rather than rated on commercial review sites, and metrics are from the GitHub repositories.
Supported Platformsโ
Pact runs wherever its language implementations run, with the broker self-hosted or via PactFlow.
Pact runs across language runtimes, with a self-hosted or hosted broker.
- JVM
- Node.js
- .NET
- Go and Python
- Docker broker
- PactFlow SaaS
- Runtimes: JVM, Node.js, .NET, Go, Python, Ruby, PHP, and Swift.
- Shared core: modern implementations wrap a Rust reference core through FFI.
- Broker: self-hosted Pact Broker via Docker, or hosted PactFlow.
- Protocols: HTTP and async messaging, with plugins for gRPC and more.
Reportingโ
Pact reports verification results and version compatibility through the broker.
Pact surfaces contracts and results through the broker and can-i-deploy.
Result Outputs
Contracts, verification results, and compatibility through the broker.
- Pact FileJSON contract of interactions
- Broker UIDependency diagram and matrix
- can-i-deployDeployment safety matrix
- Verification ResultsPublished to the broker
- Pact files are the JSON contracts that document interactions.
- The broker UI shows a dependency diagram and a compatibility matrix.
- can-i-deploy reports which versions are safe to deploy together.
- Verification results are published to the broker for tracking.
Securityโ
Pact is open source, with enterprise security in the commercial PactFlow tier.
Open Source and Commercialโ
- The OSS framework and Pact Broker carry no formal compliance program, since you self-host.
- PactFlow and the SmartBear API Hub for Contract Testing add enterprise security.
- PactFlow adds SAML SSO, RBAC, and audit trails.
- SmartBear provides the enterprise compliance posture for PactFlow.
Notesโ
- Self-hosted security depends on how you operate the broker.
- The commercial tier is the path for SSO and access control.
- Contracts contain example data, so treat them like test data.
- Webhooks should be secured when wired into CI and chat.
Security Highlightsโ
- Open-source framework and broker
- PactFlow adds enterprise security
- SAML SSO and RBAC on PactFlow
- Audit trails on PactFlow
- Self-hosted broker control
- SmartBear-backed commercial posture
Pricingโ
The Pact framework and broker are free, with PactFlow as the commercial broker.
| Plan | Price | Scope | Notes |
|---|---|---|---|
| Pact framework | $0 | Open source | MIT and Apache 2.0 libraries |
| Pact Broker | $0 | Self-hosted | Open-source broker |
| PactFlow Starter | $0 | Free SaaS broker | 2 integrations, includes BDCT |
| PactFlow Team | ~$115/month annual | Hosted broker | Up to 50 integrations, AI test generation |
| PactFlow Enterprise | Custom pricing | Enterprise | SAML SSO, RBAC, on-premise option |
- The Pact framework and Pact Broker are free and open source.
- PactFlow offers a free Starter tier, a paid Team tier, and a custom Enterprise tier.
- PactFlow adds bi-directional contract testing and AI test generation.
- Self-hosting the broker is free but carries operational overhead.
Strengthsโ
- The de-facto consumer-driven contract testing standard.
- An open-source broker with can-i-deploy and a compatibility matrix.
- Official implementations across many languages on a shared Rust core.
- HTTP and asynchronous messaging contracts in one framework.
- A clear path from free OSS to a managed PactFlow broker.
- A mature workflow for independent, safe microservice deployment.
Limitationsโ
- The consumer-driven model requires consumer teams to write and maintain contracts.
- Async and messaging contract testing is more complex than HTTP.
- You must run the broker yourself or pay for PactFlow.
- It does not fit public third-party APIs whose provider you cannot verify.
- Feature parity varies by language, with v4 and plugins lagging in some.
- There is a learning curve around provider states and the broker workflow.
Best Fit Scenariosโ
- Microservices teams deploying and evolving services independently.
- Teams that control both consumer and provider and integrate through CI/CD.
- Organizations replacing brittle end-to-end environments with contracts.
- Event-driven systems needing message contract testing.
- Teams that want can-i-deploy gating before release.
- Groups that may graduate from a self-hosted broker to PactFlow.