Setup
Configure the Reclaim Browser Extension SDK in your web application
Prerequisites
- ✅ Installation guide completed
- ✅ API credentials obtained
- ✅ Extension ID of the Reclaim-compatible extension
- ✅ Web application (React, Vue, vanilla JS)
Installation
Environment Variables
Create .env.local in your project root:
Security: Never commit .env.local to version control. Add to .gitignore: bash .env.local .env.*.local
Quick Start Setup (Development Only)
For rapid prototyping and development, you can initialize verification directly with credentials.
Development Only: This approach exposes your application secret in client-side code. Only use for development and testing. Never deploy to production with this method.
Vanilla JavaScript
React Example
Production Setup (Recommended)
🔒 Production Security Best Practice
For production deployments, generate verification requests on your backend instead of exposing credentials in client-side code.
Why this approach:
- ✅ Keeps secrets secure -
APP_IDandAPP_SECRETstay on your server - ✅ Server-side validation - You control who can request verification
- ✅ No credential exposure - Users can't extract secrets from browser dev tools
- ✅ Better security - Add authentication, rate limiting, logging
What you'll use:
- Backend:
@reclaimprotocol/js-sdk(different package with server-side features) - Frontend:
@reclaimprotocol/browser-extension-sdk(just receives config from backend)
📖 Full Backend Setup Guide: Backend Usage Documentation
Install Backend SDK
First, install the backend SDK on your server:
Backend API Setup
Create an Express.js server with verification endpoints:
Node.js / Express
Create a .env file for your credentials:
Next.js API Routes
Frontend Integration with Server Config
Benefits Summary:
- 🔐 Credentials never leave your server
- ✅ You control authorization (who can verify)
- 🛡️ Server validates proofs before accepting
- 📊 Track usage, add rate limits, log events
- 🚀 Update verification logic without website updates
See Backend SDK Documentation for complete backend setup guide.
SDK API Reference
Initialization Methods
reclaimExtensionSDK.init()
Initialize a new verification request with credentials.
Parameters:
appId(string): Your application ID from Reclaim dashboardappSecret(string): Your application secret (keep secure!)providerId(string): ID of the provider to verify (e.g.,"google-login")options(object): Configuration optionsextensionID(string): Required - Browser extension ID
Returns: Promise that resolves to a ReclaimRequest object
reclaimExtensionSDK.fromConfig()
Initialize from a pre-generated configuration (recommended for production).
Parameters:
requestConfig(object): Configuration object from backendoptions(object): Configuration optionsextensionID(string): Required - Browser extension ID
Returns: ReclaimRequest object
Use Case: When using server-side request generation for better security
reclaimExtensionSDK.isExtensionInstalled()
Check if the Reclaim extension is installed in the user's browser.
Parameters:
options(object): Configuration optionsextensionID(string): Required - Browser extension ID
Returns: Promise that resolves to true if installed, false otherwise
Use Case: Check extension status before starting verification to show appropriate UI
reclaimExtensionSDK.getVersion()
Get the current version of the Reclaim Extension SDK.
Parameters: None
Returns: String containing the SDK version (e.g., "1.0.0")
Use Case:
- Display SDK version in your application
- Log version information for debugging
- Check SDK version for compatibility
Request Object Methods
After calling reclaimExtensionSDK.init(), you receive a request object with these methods:
request.setAppCallbackUrl()
Set a callback URL where proofs will be sent automatically.
Parameters:
url(string): Your backend endpoint to receive proofs
Use Case: Automatically send proofs to your server when verification completes
request.setParams()
Add custom parameters to the verification request.
Parameters:
params(object): Custom key-value pairs to include with the proof
Use Case: Pass additional context or metadata with the verification
request.addContext()
Add context information to the verification.
Parameters:
address(string): Context address or identifiermessage(string): Context message or description
Use Case: Add on-chain context or additional verification metadata
request.startVerification()
Start the verification process and return a promise that resolves with proofs.
Returns: Promise that resolves with proof data when verification completes
Use Case:
- Get proofs via promise instead of event listeners
- Use with async/await for cleaner code flow
- Combine with event listeners for both immediate and async handling
Note: You can use both the promise return value AND event listeners together. The completed event will fire, and the promise will resolve with the same proof data.
request.on()
Register event listeners for verification lifecycle events.
Parameters:
event(string): Event name ("started","completed", or"error")callback(function): Function to call when event fires
Available Events:
started: Fired when verification session begins (payload:{ sessionId })completed: Fired when verification succeeds (payload:proofsobject)error: Fired when verification fails or is cancelled (payload:errorobject/string)
Complete Usage Example
Checking Extension Installation
Before starting verification, check if the extension is installed:
React Component with Installation Check
Next Steps
With setup complete, learn how to implement verification flows: