Prerequisites
- Para SDK configured with API credentials
- Node.js 18+ or modern browser environment
- Basic understanding of Viem accounts
- x402 facilitator URL (default:
https://x402.org/facilitator)
Installation
Install packages
Install the required packages:Setup
1
Initialize Para SDK
2
Get ViemAccount
Para provides a standard ViemAccount that works with any Viem-compatible library:
Usage
Client-Side Payments
React Hook Integration
Server-Side Setup
1
Configure middleware
Set up your Express server with x402 payment middleware:
2
Apply payment middleware
Configure the middleware with your wallet address and pricing:
3
Create protected endpoint
Add your protected endpoint and start the server: