JavaScript SDK
Official JavaScript SDK for integrating Reclaim Protocol proof generation and verification into web applications, Node.js backends, and React Native apps
Overview
The Reclaim JavaScript SDK enables you to integrate cryptographic proof generation and verification into your applications. Users can generate zero-knowledge proofs of their online data without exposing sensitive information, and your backend can verify these proofs securely.
Key Features
- π Multi-Platform Support: Works in browsers, Node.js, React Native, and mobile webviews
- π Zero-Knowledge Proofs: Verify user data without accessing sensitive information
- π― Smart Platform Detection: Automatically selects optimal verification flow (QR code, App Clip, Instant App, Browser Extension)
- β‘ Simple Integration: One-line
triggerReclaimFlow()handles the entire verification process - π‘οΈ Backend Verification: Cryptographically verify proofs on your server
- π¨ Customizable UI: Configure modal appearance, themes, and callbacks
- π± Mobile-First: Native support for iOS App Clips and Android Instant Apps
Get Your API Credentials
π Required: Get Your API Credentials First
Before you can use the SDK, you must obtain your API credentials from the Reclaim Protocol dashboard.
Get Your API Credentials Now β
You'll need:
APP_ID: Your unique application identifierAPP_SECRET: Your application secret key (keep secure!)PROVIDER_ID: The data provider you want to verify (e.g., "google-login")
These credentials are required for all code examples below.
Quick Start
Want to see it in action? Here's a practical React example to get started:
β οΈ Development Only
This example initializes the SDK client-side for quick testing and learning. Never use this approach in production as it exposes your APP_SECRET in the frontend code.
For production apps: See Recommended Setup β below.
Installation
First, install the SDK:
React Example
Try other frameworks? See Quickstart Guide β for vanilla JavaScript, Vue, and more examples.
Ready for production? Check out our Recommended Setup β with secure backend integration.
Two Integration Approaches
1. Client-Side Only (Development & Prototyping)
Quick setup for development - Initialize and handle everything in the browser (like the example above):
- Initialize SDK directly in frontend
- Start verification session
- Receive proofs in frontend
- Save/process proofs client-side
Use cases: Development, prototyping, learning, proof-of-concept demos
Security Note: This approach is for development purposes only.
- Store
APP_IDandAPP_SECRETin.envfile (never hardcode) - Never commit credentials to version control
- Do not deploy to production with this approach
Recommended: Always initialize from backend in production environments to keep APP_SECRET secure.
See More Client-Side Examples β
2. Backend Integration (Production-Ready) β
Secure full-stack approach - Initialize from backend, verify proofs server-side:
Flow:
- Backend: Initialize SDK with
APP_SECRET(secure in.env) - Backend: Generate verification config/URL
- Frontend: Start verification session with config from backend
- User: Complete verification on mobile/extension
- Backend: Receive proof via callback URL
- Backend: Verify proof cryptographically
- Backend: Process verified data and update your database
Benefits:
- β
APP_SECRETnever exposed to client - β Proofs verified server-side before use
- β Direct proof delivery to your backend via callback URL
- β Production-ready and secure
Best Practice: This is the recommended approach for all production applications. The callback URL allows Reclaim to send proofs directly to your backend for verification, ensuring data integrity.
See Backend Integration Guide β
How It Works
The Reclaim Protocol verification flow follows these steps:
Workflow Steps
- Backend Initialization: Your server initializes the SDK with
APP_IDandAPP_SECRET(kept secure) - Request Generation: Backend creates a verification request URL and returns config to frontend
- User Verification: Frontend displays QR code or triggers appropriate flow based on device
- Proof Generation: User completes verification via mobile (App Clip/Instant App) or browser extension
- Proof Submission: Frontend receives the cryptographic proof and sends to backend
- Backend Verification: Server verifies the proof's cryptographic signature and extracts verified data
Platform Detection & Verification Methods
The SDK automatically detects the user's platform and chooses the best verification method:
| Platform | Verification Method | User Experience |
|---|---|---|
| Desktop Browser | QR Code + Mobile verification | User scans QR with mobile device |
| iOS Safari | App Clip integration | Seamless in-app verification |
| Android Chrome | Instant App | Seamless in-app verification |
| Desktop (with extension) | Browser Extension | In-browser verification |
The triggerReclaimFlow() method handles all platform detection automatically.
Note on Android: Google is discontinuing Instant Apps support in December 2025. Reclaim Protocol has transitioned to deep linking for Android, providing a seamless verification experience without app installation. Learn more β
Advanced Configuration
The SDK provides extensive customization options for the verification flow and UI:
- Modal Customization: Configure QR code modal appearance, themes, and behavior
- Custom Parameters: Add metadata with
setParams()andaddContext() - Browser Extension: Configure extension detection and behavior
- Callback URLs: Set backend callback URLs for direct proof delivery
- Custom Redirects: Configure post-verification redirect URLs
- Session Callbacks: Handle
onSuccessandonFailureevents
For complete configuration options, methods, and code examples, see the API Reference β
Framework Support
The SDK works seamlessly with popular frameworks:
- β React - Hooks and components
- β Next.js - API routes + frontend integration
- β Vue.js - Composables and reactive integration
- β Vanilla JavaScript - Framework-agnostic
- β React Native - Mobile app integration
- β Node.js - Express, Fastify, NestJS
- β Python - FastAPI, Django, Flask
Security Best Practices
Critical Security Requirements
- Never expose APP_SECRET in frontend code - Always initialize from backend
- Use environment variables - Store credentials in
.envfiles - Verify proofs on backend - Never trust client-side verification alone
- Use HTTPS - Protect data in transit
- Validate proof structure - Check all required fields before processing
Next Steps
Choose your integration path:
- Installation - Install the SDK via npm or yarn
- Quickstart - More client-side examples (vanilla JS, Vue, etc.)
- Recommended Setup - Production-ready backend integration β
- API Reference - Complete SDK documentation & advanced config
- Troubleshooting - Common issues and solutions
Need Help?
- π Complete API Reference
- π Troubleshooting Guide
- π¬ Community Discord
- π GitHub Repository