@faremeter/rides is the fastest way to start making x402 payments. It auto-detects your wallet type and handles payment negotiation transparently.
Prerequisites
- Node.js 18+
- A Solana devnet keypair file or an EVM private key
Configure your wallet
Create a You can provide one or both. Rides auto-detects the wallet type from the input.
.env file with your wallet credentials:.env
What happened
payer.fetchmade an HTTP request to the endpoint.- The server responded with
402 Payment Requiredand a set of payment requirements. - Rides found a compatible wallet, signed the payment locally, and retried the request with an
X-PAYMENTheader. - The server verified the payment through a facilitator and returned the resource.
fetch call. Faremeter handled everything else.
Next steps
- How x402 works — Understand the protocol behind the payment flow.
- Rides SDK — Full API reference for
@faremeter/rides. - Fetch Wrapper — Lower-level control with
@faremeter/fetch. - Middleware — Accept payments on your own server.