BBC Consumer Contracts
BBC Consumer Contracts is a free JavaScript project for describing executable API contracts from a consumer's perspective.
What BBC Consumer Contracts is
BBC Consumer Contracts is a free JavaScript project for describing executable API contracts from a consumer's perspective. Each contract specifies a consumer, a name, a request, and the expected response. The project uses the request package for HTTP calls and Joi to validate responses, including status codes, headers, and JSON bodies against Joi schemas. Optional before and after functions support setup and cleanup, with callback-based or asynchronous functions. Retry behavior can be numeric or custom; the documented default maximum is zero. From the command line, the consumer-contracts run command can validate files recursively in a contracts directory or run one chosen contract file. In code, validateContracts accepts an array and runs every contract in it rather than stopping at the first failure. The README documents global CLI installation and local development dependency installation with pnpm. The package metadata requires Node.js version 18 or later and pnpm version 10 or later. It is intended for API and self-hosted use. The repository identifies the license as Apache License 2.0 and directs requests for an alternative licence to the BBC. Request options may include SSL settings; the README also describes setting strictSSL to false when strict trust checking is not required.
Good
- Checks status codes, headers, and JSON bodies
- Supports setup and cleanup functions
- Runs contract files from the CLI or code
- Runs all contracts in a supplied array
Watch out
- Documented default maximum retries is zero
- Requires Node.js 18 or later
- Requires pnpm 10 or later
Who it suits
It suits developers who want executable JavaScript contracts to check API requests and expected responses. It is designed for API or self-hosted use and requires Node.js 18 or later and pnpm 10 or later.
Verdict
Consumer Contracts offers command-line and programmatic ways to validate consumer-defined API expectations. Its documented runtime requirements and zero-retry default are important considerations when integrating it.
Plans and prices
From BBC Consumer Contracts's own pricing page, checked 8 Oct 2026.
| Plan | Price | What it gives you |
|---|---|---|
| Consumer Contracts | Free | No paid plans or usage limits stated |
The facts
Each one read from BBC Consumer Contracts's own pages, with the date it was checked.
What it does
- CLI
- The command line tool can run all contracts recursively from a contracts directory or run a single contract by filename.checked 8 Oct 2026
- Command line
- The consumer-contracts run command validates contracts recursively in a contracts directory or can run a specified contract file.checked 7 Oct 2026
- Contract fields
- Each contract requires a consumer name, contract name, request, and response.checked 8 Oct 2026
- Installation
- The README documents global CLI and local development dependency installation with pnpm.checked 8 Oct 2026
- Integrations
- The project uses the request HTTP client and Joi for response validation.checked 8 Oct 2026
- License
- The repository license identifies Apache License 2.0 and says to contact the BBC for an alternative licence.checked 8 Oct 2026
- Programmatic use
- The package exposes validateContracts for validating an array of contracts in application code.checked 8 Oct 2026
- Purpose
- Consumer Contracts lets API consumers define executable JavaScript contracts describing the responses they expect from services.checked 8 Oct 2026
- Response checks
- Response validation can cover status codes, headers, and JSON bodies.checked 8 Oct 2026
- Retries
- Contracts support fixed or custom retry logic, with the maximum retries defaulting to 0.checked 8 Oct 2026
- Runtime requirements
- The package metadata specifies Node.js version 18 or later and pnpm version 10 or later.checked 8 Oct 2026
- Security
- The README shows SSL request configuration options, including client certificates and a strictSSL setting, but states no security certification or compliance claim.checked 8 Oct 2026
- Security configuration
- Request options may include SSL configuration, and the README documents setting strictSSL to false when strict trust checking is not required.checked 7 Oct 2026
- Setup and cleanup
- Contracts can run asynchronous or callback based setup before execution and cleanup afterward.checked 8 Oct 2026
- Validation
- It uses HTTP requests and Joi schemas to validate API responses.checked 8 Oct 2026
The company
- Founded
- 2017checked 28 Sep 2026
Alternatives to BBC Consumer Contracts
- 1

Karate
Free planOpen sourceAPIExtensionLinuxmacOS8.2From $100 a year - 2

PactFlow
Free planWebAPILinuxSelf-hosted7.6From $115.42 a month - 3

Pact
Free planAPILinuxmacOSSelf-hosted7.5From $115.42 a month - 4

Microcks
Free planWebAPIExtensionLinux7.2Free plan - 5
oasdiff
Free planWebAPILinuxmacOS7.2From $100 a month - 6

Confluent Cloud
Free planWebAPILinux7.1From $385 a month
