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
39 changes: 0 additions & 39 deletions content/docs/js-sdk/generating-proof.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -145,45 +145,6 @@ Set a custom URL to redirect users on an error which aborts the verification pro
reclaimProofRequest.setErrorRedirectUrl("https://example.com/error-redirect");
```

## Custom Error Callback URL

Set a custom error callback URL for your app which allows you to receive errors and status updates on your error callback URL:

```javascript
reclaimProofRequest.setErrorCallbackUrl("https://example.com/error-callback");
```

## Add additional metadata for verification client

Additional metadata to pass to the verification client. This can be used to customize the client experience, such as customizing themes or UI by passing context-specific information.
The keys and values must be strings. For most clients, this is not required and goes unused.

This has no effect on the verification process.

```js
// Initialize with options
const proofRequest = await ReclaimProofRequest.init(APP_ID, APP_SECRET, PROVIDER_ID, {
metadata: { theme: 'dark', verify_another_way_link: 'https://exampe.org/alternative-verification?id=1234' },
});
```

## Set preferred locale for verification client

An identifier used to select a user's language and formatting preferences.

This represents a Unicode Language Identifier (i.e. without Locale extensions), except variants are not supported.
Locales are expected to be canonicalized according to the "preferred value" entries in the [IANA Language Subtag Registry](https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry).
For example, `he`, and `iw` are equal and both have the languageCode `he`, because `iw` is a deprecated language subtag that was replaced by the subtag `he`.

Defaults to the browser's locale if available, otherwise English (en).

```js
// Initialize with options
const proofRequest = await ReclaimProofRequest.init(APP_ID, APP_SECRET, PROVIDER_ID, {
preferredLocale: 'en-US',
});
```

## Showing Progress

You can poll the progress of the proof generation process and update the UI accordingly, especially if you are not using the `startSession` method.
Expand Down
45 changes: 45 additions & 0 deletions content/docs/js-sdk/preparing-request.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export async function GET(request) {


# Advance Options
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix heading typo (“Advance” → “Advanced”).
User-facing copy looks off.

✅ Suggested edit
-# Advance Options
+# Advanced Options
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# Advance Options
# Advanced Options
🤖 Prompt for AI Agents
In `@content/docs/js-sdk/preparing-request.mdx` at line 58, The heading "Advance
Options" is a typo; update the heading text in the docs file where the heading
symbol "# Advance Options" appears to read "Advanced Options" so user-facing
copy is correct and consistent.


## Forcing Remote Browser use
<Callout type="warning">
Remote Browser use is available only for users on a premium enterprise plan. Please [contact support](https://t.me/protocolreclaim) for more details.
Expand Down Expand Up @@ -91,9 +92,53 @@ reclaimProofRequest.setParams({


## Set Callback

### Set Custom Success Callback URL

```
reclaimProofRequest.setAppCallbackUrl(url, useJson)
```
Set a backend callback URL where Reclaim Protocol will POST proofs directly after verification. This enables secure backend proof processing without relying on frontend to upload the proof.

If `useJson` is set to `true`, it will send the proof as a raw JSON. Else, the POST body will contain the Proof JSON urlencoded.

### Custom Error Callback URL

Set a custom error callback URL for your app which allows you to receive final errors on your error callback URL:

```javascript
reclaimProofRequest.setErrorCallbackUrl("https://example.com/error-callback");
```
Comment on lines 94 to +111
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

# First, let's explore the repository structure
git ls-files | head -20

Repository: reclaimprotocol/docs

Length of output: 560


🏁 Script executed:

# Look for JS SDK related files
fd -t f -e js -e ts -e jsx -e tsx | grep -i sdk | head -20

Repository: reclaimprotocol/docs

Length of output: 46


🏁 Script executed:

# Search for callback-related code in JS SDK
rg "setAppCallbackUrl|setErrorCallbackUrl|setCallbackUrl" -t js -t ts -A 3

Repository: reclaimprotocol/docs

Length of output: 46


🏁 Script executed:

# Let's look at the file being reviewed
cat -n content/docs/js-sdk/preparing-request.mdx | sed -n '94,111p'

Repository: reclaimprotocol/docs

Length of output: 871


🏁 Script executed:

# Search for package.json files to understand SDK dependencies
fd -t f -n "package.json" | xargs cat 2>/dev/null

Repository: reclaimprotocol/docs

Length of output: 294


🏁 Script executed:

# Search for SDK references in the documentation
rg "@reclaimprotocol|ReclaimProofRequest" -t mdx -t md -A 2 | head -50

Repository: reclaimprotocol/docs

Length of output: 91


🏁 Script executed:

# Find all package.json files
find . -name "package.json" -type f

Repository: reclaimprotocol/docs

Length of output: 78


🏁 Script executed:

# Search for Reclaim SDK references in markdown and documentation
rg "ReclaimProofRequest|@reclaimprotocol" --type markdown -A 2 | head -100

Repository: reclaimprotocol/docs

Length of output: 2724


🏁 Script executed:

# Look at the full preparing-request.mdx file to understand context
wc -l content/docs/js-sdk/preparing-request.mdx

Repository: reclaimprotocol/docs

Length of output: 109


🏁 Script executed:

# Search for any references to setCallbackUrl (without "App" prefix)
rg "setCallbackUrl" -i

Repository: reclaimprotocol/docs

Length of output: 129


🏁 Script executed:

# Search for error callback patterns in the codebase
rg "ErrorCallbackUrl|error.*callback" -i -A 2

Repository: reclaimprotocol/docs

Length of output: 2563


🏁 Script executed:

# Check the Python SDK usage pattern from CLAUDE.md to understand naming convention
rg "set_callback|setCallback" -A 1

Repository: reclaimprotocol/docs

Length of output: 225


🏁 Script executed:

# Look for more JS SDK callback examples in documentation
rg "setCallback|setAppCallback" -B 2 -A 2

Repository: reclaimprotocol/docs

Length of output: 9197


🏁 Script executed:

# Check package.json to see which SDK version is being documented
cat package.json | grep -A 5 -B 5 "@reclaimprotocol"

Repository: reclaimprotocol/docs

Length of output: 46


The documented callback method name is incorrect and will cause runtime errors.

The documentation shows setAppCallbackUrl(url, useJson) for setting success callbacks, but the actual JS SDK uses setCallbackUrl() (see CLAUDE.md for the authoritative reference). Developers following this documentation will encounter method-not-found errors at runtime.

The error callback method setErrorCallbackUrl() appears correct, though its parameters are not shown in the reference implementation.

Additionally, the useJson parameter shown in the documentation is not reflected in the actual SDK usage examples and should be verified against the current SDK implementation.

Update the success callback method name from setAppCallbackUrl to setCallbackUrl and verify the useJson parameter against the latest SDK release.

🤖 Prompt for AI Agents
In `@content/docs/js-sdk/preparing-request.mdx` around lines 94 - 111, The docs
currently reference a non-existent method setAppCallbackUrl and an unverified
useJson parameter; update examples to call
reclaimProofRequest.setCallbackUrl(...) (replacing setAppCallbackUrl) and
verify/remove the useJson argument to match the SDK implementation, and ensure
the error callback example still references
reclaimProofRequest.setErrorCallbackUrl(...) with correct parameters; adjust the
prose to state whether useJson is supported by the current SDK or omit it if
not.


## Add additional metadata for verification client

Additional metadata to pass to the verification client. This can be used to customize the client experience, such as customizing themes or UI by passing context-specific information.
The keys and values must be strings. For most clients, this is not required and goes unused.

```js
// Initialize with options
const proofRequest = await ReclaimProofRequest.init(APP_ID, APP_SECRET, PROVIDER_ID, {
metadata: { theme: 'dark', verify_another_way_link: 'https://exampe.org/alternative-verification?id=1234', verify_another_way_callback: 'https://api.exampe.org/alternative-verification/callback?id=1234' },
});
Comment on lines +118 to +122
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix typos in example domains.
There are two “exampe.org” typos in the metadata sample.

✅ Suggested edit
-  metadata: { theme: 'dark', verify_another_way_link: 'https://exampe.org/alternative-verification?id=1234', verify_another_way_callback: 'https://api.exampe.org/alternative-verification/callback?id=1234' },
+  metadata: { theme: 'dark', verify_another_way_link: 'https://example.org/alternative-verification?id=1234', verify_another_way_callback: 'https://api.example.org/alternative-verification/callback?id=1234' },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
```js
// Initialize with options
const proofRequest = await ReclaimProofRequest.init(APP_ID, APP_SECRET, PROVIDER_ID, {
metadata: { theme: 'dark', verify_another_way_link: 'https://exampe.org/alternative-verification?id=1234', verify_another_way_callback: 'https://api.exampe.org/alternative-verification/callback?id=1234' },
});
🤖 Prompt for AI Agents
In `@content/docs/js-sdk/preparing-request.mdx` around lines 118 - 122, Fix the
typos in the metadata example: update the two occurrences of "exampe.org" to the
correct "example.org" (and update the API host accordingly so
verify_another_way_callback uses "api.example.org"); this change appears in the
ReclaimProofRequest.init call's metadata object in the example that assigns
theme, verify_another_way_link, and verify_another_way_callback.

```

If your app has "Verify Another Way" enabled, refer documentation from [here](/troubleshooting#handle-verify-another-way).

## Set preferred locale for verification client

You can change the language for the UI seen by User during verification by setting the `preferredLocale` parameter in the initialization options.

This is used to select a user's language and formatting preferences in the verification journey.

The value of this field must be a Unicode Language Identifier (i.e. without Locale extensions), except variants are not supported.
Locale values are expected to be canonicalized according to the "preferred value" entries in the [IANA Language Subtag Registry](https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry).
For example, `he`, and `iw` are equal and both have the languageCode `he`, because `iw` is a deprecated language subtag that was replaced by the subtag `he`.

Defaults to the browser's locale if available, otherwise English (en).

```js
// Initialize with options
const proofRequest = await ReclaimProofRequest.init(APP_ID, APP_SECRET, PROVIDER_ID, {
preferredLocale: 'en-US',
});
```