Skip to content

Move locale, callback and metadata to preparing request page#107

Merged
predatorx7 merged 1 commit intomainfrom
update-preparing-request
Jan 30, 2026
Merged

Move locale, callback and metadata to preparing request page#107
predatorx7 merged 1 commit intomainfrom
update-preparing-request

Conversation

@predatorx7
Copy link
Contributor

@predatorx7 predatorx7 commented Jan 30, 2026

Description

Testing (ignore for documentation update)

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Checklist:

Additional Notes:

Summary by CodeRabbit

Documentation

  • Updated SDK configuration documentation with expanded sections covering custom callback URLs, adding metadata for verification, and locale preferences for verification client setup.

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel
Copy link
Contributor

vercel bot commented Jan 30, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Jan 30, 2026 1:07pm

Request Review

@coderabbitai
Copy link

coderabbitai bot commented Jan 30, 2026

📝 Walkthrough

Walkthrough

This PR reorganizes documentation for the JS SDK by consolidating advanced options and callback configuration details. Content related to custom error callbacks, metadata, and locale settings is moved from generating-proof.mdx to preparing-request.mdx, shifting focus to earlier documentation stages.

Changes

Cohort / File(s) Summary
Documentation Reorganization (Removed)
content/docs/js-sdk/generating-proof.mdx
Removed 39 lines documenting Custom Error Callback URL, additional metadata for verification client, and preferred locale settings. Retained sections on Redirect after proof generation and Showing Progress.
Documentation Reorganization (Added)
content/docs/js-sdk/preparing-request.mdx
Added 45 lines with four new subsections under Advanced Options: Set Custom Success Callback URL, Custom Error Callback URL, Add additional metadata for verification client, and Set preferred locale for verification client, including explanations and usage examples.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Suggested labels

documentation, enhancement

Suggested reviewers

  • kryptocodes
  • Sajjad21990

Poem

🐰 Words scattered 'cross two files did roam,
So we gathered them to make one home,
Advanced options, callbacks aligned,
Better guidance for developers to find,
Documentation now flows smooth and right! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: relocating documentation sections on locale, callback URL, and metadata from one page to another.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch update-preparing-request

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Fix all issues with AI agents
In `@content/docs/js-sdk/preparing-request.mdx`:
- 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.
- Around line 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.
- Around line 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.

@@ -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.

Comment on lines 94 to +111
## 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");
```
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.

Comment on lines +118 to +122
```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' },
});
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.

@predatorx7 predatorx7 merged commit 69bfa99 into main Jan 30, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants