✨Works out of the box guarantee. If you face any issue at all, hit us up on Telegram and we will write the integration for you.
logoReclaim Protocol Docs

Installation

Install the Reclaim JavaScript SDK and start integrating proof generation and verification

Prerequisites

  • Node.js: 14.x or later
  • Package Manager: npm 6.x+, yarn 1.22.x+, or pnpm
  • Project: Initialized with package.json

Installation

npm install @reclaimprotocol/js-sdk

Import

import { ReclaimProofRequest } from '@reclaimprotocol/js-sdk';

Get API Credentials

Before using the SDK, obtain your credentials from the Reclaim Developer Portal:

  • APP_ID - Your application identifier
  • APP_SECRET - Your application secret (keep secure!)
  • PROVIDER_ID - The provider you want to verify against

Environment Setup

Security: Never hardcode credentials in your code or commit them to version control. Always use environment variables.

Create a .env file in your project root:

# .env
RECLAIM_APP_ID=your_app_id_here
RECLAIM_APP_SECRET=your_app_secret_here
RECLAIM_PROVIDER_ID=your_provider_id_here

Add .env to your .gitignore:

# .gitignore
.env
.env.local
.env.*.local

Load Environment Variables

// Install dotenv
// npm install dotenv
 
// Load at the top of your file
require('dotenv').config();
 
// Access variables
const APP_ID = process.env.RECLAIM_APP_ID;

Critical: Never expose APP_SECRET to the client. Keep it server-side only. Frontend environment variables (like REACT_APP_*, NEXT_PUBLIC_*, VITE_*) are bundled into your JavaScript and visible to users.

Verify Installation

Create a test file to verify the SDK is installed correctly:

// test-install.js
import { ReclaimProofRequest } from '@reclaimprotocol/js-sdk';
 
console.log('✅ Reclaim SDK imported successfully!');
console.log('ReclaimProofRequest:', typeof ReclaimProofRequest);

Run the test:

node test-install.js

Expected output:

✅ Reclaim SDK imported successfully!
ReclaimProofRequest: function

Troubleshooting

Module Not Found

If you see Cannot find module '@reclaimprotocol/js-sdk':

# Verify installation
npm list @reclaimprotocol/js-sdk
 
# Reinstall if needed
npm install @reclaimprotocol/js-sdk

TypeScript Errors

Ensure TypeScript 4.0+ and check tsconfig.json:

{
  "compilerOptions": {
    "moduleResolution": "node",
    "esModuleInterop": true
  }
}

Environment Variables Not Loading

  • Ensure .env file is in project root
  • Restart your development server after changes
  • Check for typos in variable names
  • Verify no spaces around = in .env file

Next Steps

Choose your integration approach:

Get started with your first integration →

On this page