Move locale, callback and metadata to preparing request page#107
Move locale, callback and metadata to preparing request page#107predatorx7 merged 1 commit intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughThis 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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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 | |||
There was a problem hiding this comment.
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.
| # 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.
| ## 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"); | ||
| ``` |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
# First, let's explore the repository structure
git ls-files | head -20Repository: 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 -20Repository: 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 3Repository: 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/nullRepository: 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 -50Repository: reclaimprotocol/docs
Length of output: 91
🏁 Script executed:
# Find all package.json files
find . -name "package.json" -type fRepository: 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 -100Repository: 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.mdxRepository: reclaimprotocol/docs
Length of output: 109
🏁 Script executed:
# Search for any references to setCallbackUrl (without "App" prefix)
rg "setCallbackUrl" -iRepository: reclaimprotocol/docs
Length of output: 129
🏁 Script executed:
# Search for error callback patterns in the codebase
rg "ErrorCallbackUrl|error.*callback" -i -A 2Repository: 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 1Repository: reclaimprotocol/docs
Length of output: 225
🏁 Script executed:
# Look for more JS SDK callback examples in documentation
rg "setCallback|setAppCallback" -B 2 -A 2Repository: 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.
| ```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' }, | ||
| }); |
There was a problem hiding this comment.
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.
| ```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.
Description
Testing (ignore for documentation update)
Type of change
Checklist:
Additional Notes:
Summary by CodeRabbit
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.