Deploying to Production
Checklist and guides for deploying your paid API to production.
1. Environment Variables
Your production environment must have these variables set.
# .env.production
METER_PROJECT_ID=proj_abc123xyz
METER_HMAC_SECRET=your-production-secret2. Platform Specifics
Vercel / Netlify / Railway
Add the variables above in your platform's dashboard under Settings → Environment Variables.
Cloudflare Workers
Use the CLI to add secrets securely:
wrangler secret put METER_PROJECT_ID
wrangler secret put METER_HMAC_SECRET3. Mainnet Migration (Base/CDP)
When you are ready to move from testnet to mainnet, you need to update your Action Registry configuration. Atomic Rail is optimized for Base Mainnet via the Coinbase Developer Platform (CDP).
Migration Steps
- Registry Update: In your dashboard, change the Expected Network for all live actions from
base-sepoliatobase(CAIP-2eip155:8453). - Wallet Check: Ensure your
sellerWalletis a mainnet address that you control. - Client Update: Update your frontend to connect to Base Mainnet. If you are using Viem, switch
baseSepoliatobase.
Why Base?
Base offers the lowest fees and highest throughput for micro-payments, making it the ideal network for metered API actions. Using CDP infrastructure ensures enterprise-grade reliability for your payment verification.
4. Production Checklist
Before Deploying
- Registry Configured: Ensure your production
apiPathvalues are correctly set in the Action Registry. - Update Base URL: In Settings → General, change your Application Base URL from
localhostto your production domain (e.g.,https://api.acme.com). - Facilitator Verified: Ensure your Facilitator URL is set to the production facilitator if you are moving off testnet.
- Wallet Correct: Verify your
sellerWalletin yourAtomicGateinitialization is your real production wallet. - Debug Mode OFF: Ensure
debug: falseis set for production.
After Deploying
- Test 402: Run
curl -i https://your-api.com/api/premium. You should see a402 Payment Requiredstatus. - Run Simulation: Use the Interactive Playground on your live production URL to verify the end-to-end pipeline.
- Check Logs: Ensure the simulated event appears in your dashboard.
5. Scaling
Atomic Rail is built on a high-concurrency event ingestion engine. As your traffic grows, you don't need to change anything.
Note: If you hit the 10,000 request/month limit on the Free plan, you will need to upgrade to a Pro plan in the dashboard to avoid event dropping.