Production Configuration
Best practices for running an x402 endpoint in production.
Set Values via Environment Variables
Never hardcode network IDs or USDC mints. Load them from environment variables so you can redeploy without code changes:
const NETWORK = process.env.SOLANA_NETWORK ?? 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp';
const USDC_MINT = process.env.USDC_MINT ?? 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v';Production Checklist
-
payTowallet address is set from an environment variable, not hardcoded - Your server environment sets
SOLANA_NETWORKandUSDC_MINT -
/healthon your server returns200reliably - You have real USDC on Solana mainnet in your receiving wallet
- Your endpoint URL uses HTTPS
Verify the Facilitator Supports Your Network
curl https://x402.agentstrail.ai/supportedLook for solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp in the response before going live.