Skip to main content
Accept crypto payments in your Express v4 API with a single middleware function.

Installation

Quick Start


Express v4 vs v5

This package is specifically for Express v4. The API differs slightly from the v5 package: For full documentation on configuration options, accessing payment info, and error responses, see the Express middleware documentation.

Route-Aware Middleware

Configure different payment requirements for different routes:

Advanced Mix-and-Match Example

For fully custom combinations, define explicit requirements and route-specific facilitator URLs:
For v4, the cleanest way to mix facilitator+amount by token/network is to define separate requirements per route, each with its own facilitatorUrl.

Migration to Express v5

When upgrading to Express v5, switch to @armory-sh/middleware-express:
Then update your code to use the v5 API format (BigInt amounts, chainId/assetId instead of network/asset).