Documentation Index
Fetch the complete documentation index at: https://docs.monkepay.xyz/llms.txt
Use this file to discover all available pages before exploring further.
Fastify
Fastify requires explicitbaseUrl config when deployed behind a proxy:
baseUrl is not set, the Fastify adapter falls back through this order:
baseUrlconfig — highest priorityX-Forwarded-Protorequest header — set by most reverse proxiesrequest.protocol— Fastify’s detected protocol'http'— last resort
X-Forwarded-Proto: https automatically, so baseUrl may not be strictly required. If you see payment failures with incorrect resource URLs in the 402 response, set baseUrl explicitly.
Express
Configure Express to trust your proxy so it readsX-Forwarded-* headers correctly:
trust proxy set, Express correctly reads X-Forwarded-Proto and X-Forwarded-For. The x402-express package uses this to construct the correct resource URL.
Hono
Hono handles proxy headers automatically in most runtimes. No additional configuration needed for standard deployments on Railway, Render, or Fly. If you’re seeing incorrect resource URLs, check that your proxy is settingX-Forwarded-Proto correctly.
Next.js
Next.js on Vercel handles this automatically. No configuration needed.Verifying your resource URLs
To check what resource URLs are being constructed, look at the402 response body:
accepts[0].resource field should match your public HTTPS URL exactly:
http:// or an internal hostname, set baseUrl (Fastify) or trust proxy (Express).