Deployment
Prepare native gateway, Worker gateway, and this documentation site for production.
The gateway and documentation site are separate deployable surfaces. This site is configured for Cloudflare edge SSR at x402.pwp.sh.
Documentation site
Shellpnpm --filter @x402-paysdk/docs typecheckpnpm --filter @x402-paysdk/docs build:edgepnpm --filter @x402-paysdk/docs deploy
The deployment command uses docs/wrangler.jsonc and targets the x402.pwp.sh custom domain. Authenticate Wrangler locally before deploying. No resource IDs or secrets are committed.
Gateway selection
Use gateway-native when you need the complete self-hosted route surface or control over process, database, and networking. Use gateway-worker when you want edge execution and have configured the required D1/KV bindings and production gates.
Preflight checklist
- Set the canonical gateway origin and HTTPS termination.
- Configure facilitator and bounded RPC endpoints.
- Provision the signing key, secret pepper, merchant secret storage, and rate limits.
- Apply D1 migrations before enabling Worker-backed stores.
- Exercise negotiation, settlement, receipt verification, and recovery.
- Confirm logs contain no credentials or replayable payment payloads.
- Reconcile against chain history before enabling irreversible fulfillment.