Reclaim Connect
Reclaim Connect enables applications to request data from users without writing any complex code themselves.
Integrate Reclaim Connect in Your Front End
Reclaim Connect exposes a set of React components that can be integrated into your front end application. It is available as an NPM package. To install it, run the following command in your project directory:
npm install @reclaimprotocol/reclaim-connect-react
GenerateProof Component
The GenerateProof component enables you to request data from users. It renders a button that, when clicked, opens a modal with a QR code. Users can scan the QR code with the Reclaim mobile app to submit the requested data. The component also provides a callback function that you can use to execute logic when the proof is successfully submitted.
To use the GenerateProof component, follow these steps:
Import
import { GenerateProof } from '@reclaimprotocol/reclaim-connect-react';
Render
-
Include the component in your application's JSX code, providing the necessary props.
-
Get the
applicationId
from Reclaim Developer Portal (opens in a new tab).
import React, { type ReactNode } from 'react';
import { GenerateProof } from '@reclaimprotocol/reclaim-connect-react';
function App (): ReactNode {
return (
<GenerateProof
appID='6d6c04eb-237b-4599-8797-94d48b0ac612'
userID='dasq2easdase-asdq2e3' //optional
onProofSubmission={(proofs, sessionId) => {}}
onProofSubmissionFailed={() => {}}
/>
);
}
export default App;
Output
Props
Prop | Type | Description |
---|---|---|
appID* | string | The unique application ID for creating a Reclaim session. |
userID | string | The unique user ID for the Reclaim session. |
onSessionCreation | function | A callback function to execute when the session is successfully created. |
onProofSubmission | function | A callback function to execute when the proof is successfully submitted. It receives generated proofs and session id in parameter. |
onProofSubmissionFailed | function | A callback function to execute when proof submission fails. |
customize | object | An object to customize the interface text and styles: Find a sample usage below:
|