Bidirekt is a declarative, static, bidirectional contract testing tool. Each side of an integration declares, in a small contract file, the resources it provides and the resources it consumes, each with the schemas of its bodies.
How it works#
Bidirekt has two parts: the bidirekt CLI, which every pipeline and developer machine runs, and the broker, one server with its Postgres database. The broker stores every published contract and records which version is deployed to which environment. Before a deployment, bidirekt can-i-deploy asks it one question: can this version go to this environment without breaking anything that is already there? The broker answers by comparing the declarations, so no service needs to be running.
Where to start#
To see it work, run the Demo: a break caught by can-i-deploy on the petstore example, then fixed. To set up your own project in one command, run Try on your project. Install installs the CLI and the agent skill that lets your coding agent write the contracts, and Run the broker runs the broker on your machine or in production. The TypeScript SDK, for TypeScript or JavaScript, the PHP SDK and the Go SDK write the contract from annotated code.