Skip to main content
Defined in: facilitator.ts:180 Creates a CDP-authenticated x402 facilitator client. The returned client is pre-configured with the CDP hosted facilitator URL and CDP JWT-based authentication. It implements the HTTPFacilitatorClient interface from @x402/core/server and can be passed directly to x402ResourceServer as a drop-in replacement for a self-hosted facilitator. Credentials are resolved in order: explicit args → CDP_API_KEY_ID / CDP_API_KEY_SECRET environment variables.

Parameters

args?

CdpFacilitatorClientArgs Optional credential overrides.

Returns

HTTPFacilitatorClient A configured HTTPFacilitatorClient ready for use with x402ResourceServer.

Throws

If neither explicit args nor environment variables provide credentials.

Examples

Drop-in replacement for a self-hosted facilitator:
Explicit credentials: