Need help? Join the Discord for the assistant and get latest updates.
Estimated time: 20 minutes
Prerequisites
Before you start, make sure you have:1
Development environment
- Node.js v18+ for TypeScript/JavaScript
- Python 3.9+ for Python (coming Q1 2026)
- Your preferred backend framework
2
Testnet wallet
- Test X402 tokens on a supported network (e.g., Base Sepolia)
- Enough native gas token for transactions
3
Prism API credentials
Get your API key from the Prism Management Console
Step 1: Choose Your Framework & Install SDK
Select your framework and follow the detailed integration guide:Express.js
Next.js
Fastify
NestJS
FastAPI
Flask
Step 2: Protect Your First Endpoint
Add payment protection to your API endpoint. Here’s a minimal example:Step 3: Configure Spectrum for Revenue Distribution
Step 3: Configure Spectrum for Revenue Distribution
Automate payment splits to multiple recipients:1
Plan your revenue split
2
Register in Management Console
- Navigate to Prism Management Console
- Go to Spectrum Configuration
- Add recipients and percentages
- Deploy to testnet
- Copy the Configuration ID
3
Link to your payment endpoint
Step 4: Test End-to-End
1
Get testnet tokens
Visit the Prism Faucet to get test X402 tokens
2
Make a test request
3
Submit payment
4
Verify
- ✅ Payment settled on-chain
- ✅ API returns protected data (200 OK)
- ✅ Spectrum distribution executed
Production Checklist
1
Security
- Store API keys in environment variables
- Enable rate limiting
- Use HTTPS only
- Implement authentication
2
Configuration
- Verify Spectrum recipients
- Test with small amounts first
- Review access controls
3
Monitoring
- Log payment requests
- Set up failure alerts
- Track settlement rates
- Monitor Spectrum events
Framework-Specific Guides
TypeScript SDKs
Overview of all TypeScript/JavaScript SDKs
Python SDKs
Overview of Python integrations (Q1 2026)
API Reference
Direct API integration without SDK
Individual Framework Guides
Express.js
Middleware, error handling, advanced patterns
Next.js
App Router, API routes, middleware
Fastify
Plugin setup, hooks, performance tips
NestJS
Guards, decorators, dependency injection
FastAPI
Async middleware, dependencies (Q1 2026)
Flask
Decorators, blueprints (Q1 2026)