Skip to main content

Prerequisites

  • A XentFi account with a WAAS apiKey and orgId (dashboard.xentfi.com — see Authentication)
  • Node.js 20+
  • viem if you’ll be signing payments as a payer (installed automatically as a dependency)

Step 1: Install

Step 2: Set your environment variables

Step 3: Construct the client and check supported configurations

Example response
getSupported() requires no authentication and is the fastest way to confirm the SDK is wired up correctly and to discover valid blockchainId/assetId pairs and token domain parameters for signing.
The facilitator URL (https://api.xentfi.com/v1/x402) and relayer wallet are fixed on the backend — they are not configurable in the client. apiKey and orgId are the only two options X402FacilitatorClient takes.

Next: pick your role

I'm getting paid

Set up verify() + settle() on a resource server.

I'm making a payment

Sign an EIP-3009 authorization and attach it as X-PAYMENT.