Every approach below answers the same question: does the consumer still agree with the producer? They differ in who writes the agreement down, when it gets checked, what it takes to keep it true, and how much has to exist before the first check runs.
Carrick is the fifth: the contract derived from the code itself, checked on every pull request.
The consumer writes down what it expects, the provider verifies against it, and a broker records which versions agree.
Tools that take this approachPact, PactFlow, Spring Cloud Contract
A specification is the source of truth. Clients are generated from it and requests can be validated against it.
Tools that take this approachSpecmatic, Schemathesis, Dredd, Optic, Microcks
The producer publishes its types as a package and every consumer depends on it, so the compiler does the checking.
Tools that take this approachA published npm package, or a monorepo with tRPC or ts-rest where the types cross as imports
Run the services together and exercise the real calls between them.
Tools that take this approachTestcontainers, Docker Compose environments, and end-to-end suites
Carrick reads the TypeScript on both sides of every cross-repository call and fails the pull request when the two stop agreeing.
Tools that take this approachCarrick
The steps below are what has to exist before the first check runs. Every approach except one asks for a test suite, a spec, a package or an environment first, and asks for it again each time the API changes.
Every pull request after that is checked.
Carrick is the one approach here where the contract keeps itself. It is the TypeScript on both sides of every cross-repository call, read on each pull request, so it is true for exactly as long as the code is.
There is no test suite to write, no broker to host and no spec to keep in step. It fits TypeScript polyrepos of any size and installs as a single GitHub Action. In a system that also has services in other languages, or that gates deploys against what is live in production, Carrick runs beside a written contract and covers every TypeScript call.