Node.js / Express Setup
Production-ready Reclaim Protocol integration with Node.js/Express backend and React frontend
✅ Production-Ready Full-Stack Example
This guide shows a complete implementation with Express.js backend (secure SDK initialization) and React frontend (UI and verification flow).
Prerequisites
- Node.js 14.x or later
 - Express.js project set up
 - API credentials from Reclaim Developer Portal
 
Installation
Install the Reclaim JavaScript SDK in your backend:
Project Structure
Backend Implementation
Step 1: Environment Setup
Create .env file in your backend directory:
Step 2: Install Dependencies
Step 3: Complete Express Server
Create server.js:
Important Middleware Notes
- Do NOT use 
express.urlencoded()- It conflicts withexpress.text()and prevents proper proof parsing - Use 
express.text()- The proof from Reclaim is sent as URL-encoded text - Order matters - 
express.text()must come afterexpress.json()if you need both 
Step 4: Run the Backend
You should see:
Frontend Implementation (React)
Step 1: Create Verification Component
Create frontend/src/components/ReclaimVerify.jsx:
Step 2: Optional Styling
Create frontend/src/components/ReclaimVerify.css:
Step 3: Use in Your App
Local Development Setup
1. Start Backend with ngrok
Terminal 1 - Start Express server:
Terminal 2 - Start ngrok tunnel:
Copy the ngrok URL (e.g., https://abc123.ngrok.io) and update your .env:
Restart your Express server to pick up the new BASE_URL.
2. Start Frontend
Terminal 3:
Your app should open at http://localhost:3000 (or another port if 3000 is taken).
Testing the Integration
1. Test Backend Config Endpoint
Expected response:
2. Test Full Flow
- Open your React app in browser
 - Click "Start Verification"
 - On desktop: QR code modal should appear
 - Scan with mobile device and complete verification
 - Check backend logs for proof reception
 - Frontend should show success message
 
Production Deployment
Environment Variables
For production, set these environment variables on your hosting platform:
Frontend API URL
Update the BACKEND_URL in your React component:
Set in .env.production:
Common Issues
1. CORS Errors
Problem: Frontend can't reach backend due to CORS.
Solution: Ensure CORS is properly configured:
2. Callback Not Reached
Problem: Backend callback endpoint not receiving proofs.
Solutions:
- Verify 
BASE_URLis publicly accessible (use ngrok for local dev) - Check ngrok tunnel is running
 - Ensure callback URL doesn't have trailing slash
 - Check server logs for incoming requests
 
3. Proof Parsing Fails
Problem: JSON.parse() fails in callback endpoint.
Solution: Ensure you're using express.text() middleware and decoding properly:
Next Steps
- Backend Verification → - Deep dive into proof verification
 - Client Integration → - Advanced frontend patterns
 - API Reference → - Complete SDK documentation
 - Troubleshooting → - Common issues and solutions