Express Integration
Installation
pnpm add @shade402/express @shade402/coreBasic Setup
Initialize Configuration
import { initX402 } from '@shade402/express';
initX402({
paymentAddress: process.env.PAYMENT_WALLET_ADDRESS!,
tokenMint: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v', // USDC
network: 'solana-devnet',
rpcUrl: process.env.SOLANA_RPC_URL,
defaultAmount: '0.01',
paymentTimeout: 300, // 5 minutes
autoVerify: true,
});Protect Routes
Configuration Options
Global Configuration
Per-Route Configuration
Accessing Payment Information
Error Handling
Resource Encryption
Multiple Payment Tiers
Manual Payment Verification
Building 402 Responses Manually
Complete Example
Best Practices
Next Steps
Last updated
