BBC Consumer Contracts
github.com
- Free plan
- API
- Self-hosted
What BBC Consumer Contracts is
BBC Consumer Contracts is a JavaScript tool for defining and running executable consumer-driven API contracts. Each contract specifies a consumer, a name, a request, and the response it expects. The project uses the request package to make HTTP calls and Joi to check responses, including status codes, headers, and JSON bodies validated against Joi schemas. Optional before and after functions can handle setup and cleanup, using callbacks or asynchronous functions. Retry settings can be numeric or custom; the documented default maximum is zero. The command-line runner can check every contract in a contracts directory recursively or run one file. In code, validateContracts accepts an array and runs every contract rather than stopping at the first failure. The README documents global CLI and local development dependency installation with pnpm. It requires Node.js 18 or later and pnpm 10 or later. The project is free, supports consumer verification, and is intended for self-hosted use. Its repository identifies the license as Apache License 2.0 and directs those seeking an alternative to contact the BBC.
Who it suits
It suits teams that want to define API expectations in JavaScript and validate them through a command line or programmatic workflow. It is aimed at self-hosted use and requires Node.js 18 or later and pnpm 10 or later.
Good to know, and what to watch
- Checks status codes, headers, and JSON bodies.
- Supports setup and cleanup hooks.
- Runs contracts recursively or by file.
- Programmatic validation runs every contract in an array.
- Requires Node.js 18 or later.
- Requires pnpm 10 or later.
- Default maximum retries is zero.
Plans
Every plan and priceConsumer Contracts
Free plan
The verdict
BBC Consumer Contracts provides a focused way to describe consumer expectations and check API responses. Teams should account for its runtime requirements and the zero-retry default when setting up their workflow.
What the maker publishes
- CLI
- The command line tool can run all contracts recursively from a contracts directory or run a single contract by filename. source
- Command line
- The consumer-contracts run command validates contracts recursively in a contracts directory or can run a specified contract file. source
- Contract fields
- Each contract requires consumer, name, request and response properties. source
- Contract fields
- Each contract requires a consumer name, contract name, request, and response. source
- Founded
- 2017 source
- Installation
- The README documents global CLI installation and local development dependency installation using pnpm. source
- Installation
- The README documents global CLI and local development dependency installation with pnpm. source
- Integrations
- The project uses the request HTTP client and Joi for response validation. source
- License
- The repository license identifies Apache License 2.0 and says to contact the BBC for an alternative licence. source
- Programmatic use
- The package exposes validateContracts to validate an array of contracts, and it runs every contract in the array rather than failing fast. source
- Programmatic use
- The package exposes validateContracts for validating an array of contracts in application code. source
- Purpose
- The project provides executable consumer-driven contracts in JavaScript to describe API requests and the responses consumers expect. source
- Purpose
- Consumer Contracts lets API consumers define executable JavaScript contracts describing the responses they expect from services. source
- Response checks
- Contracts can validate response status codes, headers and JSON bodies with Joi schemas. source
- Response checks
- Response validation can cover status codes, headers, and JSON bodies. source
- Retries
- Contracts can use numeric or custom retries, and the documented default maximum retries is zero. source
- Retries
- Contracts support fixed or custom retry logic, with the maximum retries defaulting to 0. source
- Runtime requirements
- The package metadata specifies Node.js version 18 or later and pnpm version 10 or later. source
- Security
- The README shows SSL request configuration options, including client certificates and a strictSSL setting, but states no security certification or compliance claim. source
- Security configuration
- Request options may include SSL configuration, and the README documents setting strictSSL to false when strict trust checking is not required. source
- Setup and cleanup
- Optional before and after functions support setup and cleanup, including callback-based or asynchronous functions. source
- Setup and cleanup
- Contracts can run asynchronous or callback based setup before execution and cleanup afterward. source
- Validation
- It uses request to make HTTP requests and Joi to validate API responses. source
- Validation
- It uses HTTP requests and Joi schemas to validate API responses. source
Checked against the maker's pages on 8 Oct 2026.