Server middleware for adding payment walls to API endpoints using x402 protocol
npm install @faremeter/middlewareServer middleware for adding payment walls to API endpoints using the x402 protocol.
``bash`
pnpm install @faremeter/middleware
- Paywall any endpoint - Add middleware` to any route
- Framework agnostic - Express, Hono, or custom
- Multi-chain support - Solana, EVM, extensible
- Fast validation - Payment requirements caching
- Facilitator integration - Handles settlement verification
See working examples in the faremeter repository:
- Express + Solana
- Express + EVM
- Hono + Solana
- @faremeter/fetch - Client-side fetch wrapper
- @faremeter/info - Network/asset configuration helpers
- @faremeter/facilitator - Payment facilitator service
LGPL-3.0-only