-
Notifications
You must be signed in to change notification settings - Fork 13
Move locale, callback and metadata to preparing request page #107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -56,6 +56,7 @@ export async function GET(request) { | |||||||||||
|
|
||||||||||||
|
|
||||||||||||
| # Advance Options | ||||||||||||
|
|
||||||||||||
| ## 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. | ||||||||||||
|
|
@@ -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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 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 The error callback method Additionally, the Update the success callback method name from 🤖 Prompt for AI Agents |
||||||||||||
|
|
||||||||||||
| ## 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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix typos in example domains. ✅ 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
Suggested change
🤖 Prompt for AI Agents |
||||||||||||
| ``` | ||||||||||||
|
|
||||||||||||
| 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', | ||||||||||||
| }); | ||||||||||||
| ``` | ||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix heading typo (“Advance” → “Advanced”).
User-facing copy looks off.
✅ Suggested edit
📝 Committable suggestion
🤖 Prompt for AI Agents