Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions content/docs/advance-options/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"title": "Advanced Options",
"pages": ["attestor-auth", "verification", "overrides","verification-options","verification-status","web-sdk","js-injections"]
}

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions content/docs/android-kotlin/usage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,3 @@ If the verification is cancelled or failed, the handler's `ReclaimVerification.R

- See the [Reclaim Compose Example - Android](https://github.com/reclaimprotocol/reclaim-inapp-android-sdk/tree/main/example/README.md) for a complete example of how to use the SDK in an Android application.


## Advanced Usage
For more usage options see [Advance Options guide](/advance-options/advance-options)
2 changes: 1 addition & 1 deletion content/docs/expo/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ Replace `your-app-scheme`, `your-domain.com`, and package identifiers with your
Now that you've installed the SDK successfully, you can:

1. Follow the [Usage](./usage) guide to create your first proof request
2. Explore [Advance Options](../advance-options/advance-options) for customization
2. Explore [Advance Options](../advance-options/web-sdk) for customization

### Troubleshooting

Expand Down
2 changes: 1 addition & 1 deletion content/docs/expo/usage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,4 @@ function ReclaimDemo() {

## Advance Usage

You can check out available functions in the SDK in the [Advance Options](../advance-options/advance-options) guide
You can check out available functions in the SDK in the [Advance Options](../advance-options/web-sdk) guide
3 changes: 0 additions & 3 deletions content/docs/ionic/usage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,3 @@ error.innerError

- See the [Reclaim Example - Capacitor](https://github.com/reclaimprotocol/reclaim-inapp-capacitor-sdk/tree/main/example-app) for a complete example of how to use the SDK in a Capacitor application.


## Advanced Usage
For more usage options see [Advance Options guide](/advance-options/advance-options)
3 changes: 0 additions & 3 deletions content/docs/ios-swift/usage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,6 @@ do {

For a complete example, see the [Reclaim Example - SwiftUI](https://github.com/reclaimprotocol/reclaim-inapp-ios-sdk/blob/53a19f88c8d90df485a60dc20190f740cd9fd108/Examples/SwiftUIExample/SwiftUIExample/ContentView.swift).

## Advanced Usage
For more usage options see [Advance Options guide](/advance-options/advance-options)

## Example

- See the [Reclaim Example - SwiftUI](https://github.com/reclaimprotocol/reclaim-inapp-ios-sdk/blob/53a19f88c8d90df485a60dc20190f740cd9fd108/Examples/SwiftUIExample/README.md) for a complete example of how to use the SDK in a SwiftUI application.
Expand Down
2 changes: 0 additions & 2 deletions content/docs/react-native/usage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,3 @@ error.innerError
- Migration steps for [0.3.0](https://github.com/reclaimprotocol/reclaim-inapp-reactnative-sdk/blob/main/documentation/migration.md#030)
- Migration steps for [0.2.1](https://github.com/reclaimprotocol/reclaim-inapp-reactnative-sdk/blob/main/documentation/migration.md#021)

## Advanced Usage
You can check out available functions in the SDK in the [Advance Options guide](/advance-options/advance-options)
6 changes: 3 additions & 3 deletions content/docs/web/backend/index.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Reclaim Protocol Backend SDKs
title: Reclaim Protocol Backend Integration
description: This documentation helps you initiate a proof and verify the user-generated proof on the backend. This is the most secure way to request verifications.
---

Expand All @@ -14,7 +14,7 @@ Reclaim Protocol offers two backend SDKs:
2. Set meta data in the Proof Request.
a. Callback Url - where the proof, once generated, is sent
b. Context - any additional information you want to be sent back to you in the proof
3. Send the Proof Request to the frontend. See how to use ProofRequest to optimally build your UI [here](/js/fullstack-example).
3. Send the Proof Request to the frontend. See how to use ProofRequest to optimally build your UI [here](../web/frontend/fullstack).
4. Accept the actual proof on the callback url set above.
5. Verify the proof that has been submitted, and then continue with your business logic.

Expand All @@ -24,6 +24,6 @@ Reclaim Protocol offers two backend SDKs:
1. [Installation](./backend/installation)
Learn how to set up either the JavaScript or Python SDK in your project.

2. [Backend Example](./backend/backend-example)
2. [Backend Example](./backend/usage)
Understand the basic flow of using the SDKs in a backend environment.

11 changes: 5 additions & 6 deletions content/docs/web/backend/installation.mdx
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
---
title: Installation
description: Welcome to the guide on integrating Reclaim Protocol into your Node.js backend project! This guide will walk you through the installation process and help you get started quickly.
description: Welcome to the guide on integrating Reclaim Protocol into your backend project! This guide will walk you through the installation process and help you get started quickly.
---

import { Tab, Tabs } from 'fumadocs-ui/components/tabs';

# Installing the Reclaim Protocol SDK for Backend

Welcome to the guide on integrating Reclaim Protocol into your backend project! This guide will walk you through the installation process for both JavaScript and Python implementations.

## Prerequisites

Before you begin, make sure you have the appropriate environment set up:
Expand Down Expand Up @@ -50,7 +46,7 @@ yarn add @reclaimprotocol/js-sdk
Open your terminal and run:

```bash
pip install reclaim-python-sdk==1.0.0
pip install reclaim-python-sdk
```

#### Verify Installation
Expand All @@ -71,3 +67,6 @@ yarn add @reclaimprotocol/js-sdk
## Get an API Key
Setup your project using the [Get API Key guide](/api-key).

## Integrate into your project
You can integrate the SDK into your backend using the [Usage guide](./usage)

4 changes: 2 additions & 2 deletions content/docs/web/backend/usage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ This endpoint will be called once the user generates the proof. Here is where we
</Tab>
</Tabs>

For detailed information about the `proof` object received in the `/receive-proofs` endpoint, refer to the [Proof Structure](../advance-options/advance-options#understanding-the-proof-structure) section.
For detailed information about the `proof` object received in the `/receive-proofs` endpoint, refer to the [Proof Structure](../../advance-options/web-sdk#understanding-the-proof-structure) section.

### 3. Run the server

Expand All @@ -209,6 +209,6 @@ For detailed information about the `proof` object received in the `/receive-proo
</Tabs>

### 4. Display the Proof Request to the user
You can now display the Proof Request to the user, by following the [Fullstack Example here](/js/fullstack-example#2-frontend-implementation)
You can now display the Proof Request to the user, by following the [Fullstack Example here](../frontend/fullstack)


33 changes: 20 additions & 13 deletions content/docs/web/frontend/fullstack.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,35 @@ description: This guide demonstrates how to integrate the Reclaim Protocol JavaS
- Install the React libraries using the [Installation guide](./installation)
- Get the `APPLICATION_ID`, `APPLICATION_SECRET` and `PROVIDER_ID` using the [API Key guide](/api-key)

## Implementation Guide

### 1. Backend Implementation

For a detailed backend implementation using Node.js and Express, please refer to the [Backend guide](./backend).
For a detailed backend implementation using Node.js/Python , please refer to the [Backend guide](../backend).

If you are deploying on localhost, be sure to use [ngrok](https://ngrok.com) to make it visible on a public url.

This guide will assume the backend has been deployed.

### 2. Frontend Implementation

### Streamlined Implementation with triggerReclaimFlow (Recommended)
There are two ways to implement the Reclaim Protocol on your frontend.

- Using the `triggerReclaimFlow()` method (Recommended)
- Using the `getRequestUrl()` method

### Using the `triggerReclaimFlow()` method (Recommended)

The modern approach uses the `triggerReclaimFlow()` method which automatically handles platform detection and provides the optimal user experience. Here's how to integrate it with your backend:
This method automatically detects the user's environment and chooses the best verification method for the user.
- Browser extension for desktop users (if installed)
- QR code popup for desktop users (if extension is not installed)
- AppClip/InstantApp redirection for mobile users

```javascript
import { useState } from 'react';
import { ReclaimProofRequest } from '@reclaimprotocol/js-sdk';

const BASE_URL = "https://your-domain.com"; // if using ngrok, use the ngrok base url here

function ReclaimDemo() {
function StartReclaimVerification() {
const [proofs, setProofs] = useState(null);
const [isLoading, setIsLoading] = useState(false);

Expand Down Expand Up @@ -99,16 +105,12 @@ function ReclaimDemo() {
);
}

export default ReclaimDemo;
export default StartReclaimVerification;
```

### Customizing the Modal (Optional)

You can customize the modal appearance and behavior using the `setModalOptions()` method. Check out the [advanced configuration options](./quickstart#advanced-configuration-options) for more details.

### Traditional Implementation Guide
### Using the `getRequestUrl()` method

For more control over the verification flow, you can use the traditional approach:
This method generates a verification request URL that user needs to visit to start the session.

```javascript
const getVerificationReq = async () => {
Expand Down Expand Up @@ -177,3 +179,8 @@ Once `requestUrl` is set, display the QR or button for user to initiate verifica

```


To further customize the verification flow and UI, you can use the [Web SDK advanced options](../../advance-options/web-sdk)



8 changes: 5 additions & 3 deletions content/docs/web/frontend/index.mdx
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
---
title: Frontend
title: Reclaim Protocol Frontend Integration
description: This guide will help you implement the front end using React
---



## Two modes
### Quickstart
To quickly get something up and running, you can use the [quickstart guide](./quickstart).
To quickly get something up and running, you can use the [quickstart guide](./frontend/quickstart).
<Callout type="warning">
Though this is the easiest to get started, this is not secure - and not recommended for production deployments.
</Callout>

### Fullstack, production ready
To build a fullstack secure application, follow the [Fullstack guide](./fullstack)
To build a fullstack secure application, follow the [Fullstack guide](./frontend/fullstack)
57 changes: 16 additions & 41 deletions content/docs/web/frontend/quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,19 @@ description: This is the fastest way to get an prototype running and experience
- Install the React libraries using the [Installation guide](./installation)
- Get the `APPLICATION_ID`, `APPLICATION_SECRET` and `PROVIDER_ID` using the [API Key guide](/api-key)

## Streamlined Implementation with triggerReclaimFlow (Recommended)
## Quickstart

The Reclaim SDK now provides a simplified `triggerReclaimFlow()` method that automatically handles the verification process across different platforms and devices. This method intelligently chooses the best verification method based on the user's environment.
There are two ways to implement the Reclaim Protocol on your frontend.

1. Using the `triggerReclaimFlow()` method (Recommended)
2. Using the `getRequestUrl()` method

### 1. Using the `triggerReclaimFlow()` method (Recommended)

This method automatically detects the user's environment and chooses the best verification method for the user.
- Browser extension for desktop users (if installed)
- QR code popup for desktop users (if extension is not installed)
- AppClip/InstantApp redirection for mobile users

```javascript
import { useState } from 'react';
Expand All @@ -31,11 +41,7 @@ function ReclaimDemo() {
// Initialize the Reclaim SDK with your credentials
const reclaimProofRequest = await ReclaimProofRequest.init(APP_ID, APP_SECRET, PROVIDER_ID);

// Trigger the verification flow automatically
// This method detects the user's platform and provides the optimal experience:
// - Browser extension for desktop users (if installed)
// - QR code modal for desktop users (fallback)
// - Native app clips for mobile users
// Trigger the verification session
await reclaimProofRequest.triggerReclaimFlow();

// Start listening for proof submissions
Expand Down Expand Up @@ -75,39 +81,8 @@ function ReclaimDemo() {
export default ReclaimDemo;
```

### How triggerReclaimFlow() Works

The `triggerReclaimFlow()` method automatically detects the user's environment and chooses the optimal verification method:

#### On Desktop Browsers:
1. **Browser Extension First**: If the Reclaim browser extension is installed, it uses the extension for seamless in-browser verification.
2. **QR Code Modal Fallback**: If the extension is not available, it automatically displays a QR code modal for mobile scanning.

#### On Mobile Devices:
1. **iOS Devices**: Automatically redirects to the Reclaim App Clip for native iOS verification.
2. **Android Devices**: Automatically redirects to the Reclaim Instant App for native Android verification.

### Browser Extension Support

You can also manually check for browser extension availability and customize the QR code modal:

```javascript
// Check if browser extension is available
const isExtensionAvailable = await reclaimProofRequest.isBrowserExtensionAvailable();
console.log('Extension available:', isExtensionAvailable);

// Customize modal appearance (optional)
reclaimProofRequest.setModalOptions({
title: 'Verify Your Account',
description: 'Scan the QR code with your mobile device or install our browser extension',
darkTheme: false,
extensionUrl: 'https://chrome.google.com/webstore/detail/reclaim'
});
```

## Traditional Implementation Guide

For more control over the verification flow, you can use the traditional approach:
### 2. Using the `getRequestUrl()` method
This method generates a verification request URL that user needs to visit to start the session.

```javascript
import { useState } from 'react';
Expand Down Expand Up @@ -180,4 +155,4 @@ export default ReclaimDemo;
```

## Get production Ready
For production usecases, you might want to make sure that the proofs are sent directly to your backend - so that the user doesn't have an opportunity to tamper with the data. For that implement the [Backend](../backend) and follow the [Fullstack guide](./fullstack)
For production usecases, you might want to make sure that the proofs are sent directly to your backend - so that the user doesn't have an opportunity to tamper with the data. Refer to the [Backend](../backend) and [Fullstack guide](./fullstack) for more details.
17 changes: 9 additions & 8 deletions content/docs/web/index.mdx
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
---
title: Web SDK
description: Integrate Reclaim Protocol into your webapp using the NodeJS and React SDKs.
description: Integrate Reclaim Protocol into your webapp using our JS and Python SDKs.
---


## Understanding how the WebSDKs workflow
## Understanding the WebSDKs workflow

### Steps involved
1. A verification link is created on the frontend and displayed for the user to tap/scan QR code.
2. The user opens the above verification link and completes the verification using the Reclaim Protocol [AppClip](https://developer.apple.com/app-clips/)/[InstantApp](https://developer.android.com/topic/google-play-instant). The verification must be done using a mobile phone. No app install is required.
3. Once the user completes the verification on the AppClip/InstantApp, they will be prompted to redirect back to your webapp
4. The webapp polls the status of the verification and continues business logic, once the verification has been marked as complete.
1. A verification session is created on the frontend and displayed to the user to tap/scan QR code.
2. The user starts the session and completes the verification using the Reclaim Protocol [AppClip](https://developer.apple.com/app-clips/)/[InstantApp](https://developer.android.com/topic/google-play-instant). The verification must be done using a mobile phone. No app install is required.
3. Once the user completes the verification, they will be prompted to redirect back to your webapp.
4. The webapp polls the status of the verification session and continues business logic, once the verification has been marked as complete.
5. The backend will verify the proof and return the result to the frontend.

### What you need to implement
1. [Frontend](./frontend) application using React
2. [Backend](./backend) application to process the verification securely
1. [Frontend](./web/frontend) application using React
2. [Backend](./web/backend) application to process the verification securely using NodeJS/Python