@reclaimprotocol/client 0.1.42 → 0.1.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -341,7 +341,8 @@ const verifierApp = await reclaim.sessions.create({
|
|
|
341
341
|
verificationClientUrl: VerificationClient.verifierApp,
|
|
342
342
|
})
|
|
343
343
|
|
|
344
|
-
// 4. In-app SDK or add-to-app host.
|
|
344
|
+
// 4. In-app SDK or add-to-app host. Required for these apps: pass
|
|
345
|
+
// inApp.verificationUrl to the app's startVerificationFromUrl.
|
|
345
346
|
const inApp = await reclaim.sessions.create({
|
|
346
347
|
providers: [{ providerId }],
|
|
347
348
|
context,
|
|
@@ -372,6 +373,22 @@ const custom = await reclaim.sessions.create({
|
|
|
372
373
|
})
|
|
373
374
|
```
|
|
374
375
|
|
|
376
|
+
A session works only in the client it was created for. Builder fixes the
|
|
377
|
+
session's client at creation, and every Verification Client request must carry
|
|
378
|
+
that client's `x-reclaim-vc-id`, or it gets
|
|
379
|
+
`403 x-reclaim-vc-id does not match this session`. Opening the link in another
|
|
380
|
+
client first doesn't change this. So a mobile app using the in-app SDK or the
|
|
381
|
+
add-to-app module needs sessions created with `VerificationClient.inAppSdk`
|
|
382
|
+
(`https://build.reclaimprotocol.org/share/inapp-sdk`). A session created
|
|
383
|
+
without `verificationClientUrl` is a Portal session, and those apps can't open
|
|
384
|
+
it.
|
|
385
|
+
|
|
386
|
+
Those apps start Builder mode from either value of the response:
|
|
387
|
+
- `startVerificationFromUrl(inApp.verificationUrl)`;
|
|
388
|
+
- `startVerificationFromJson({ api: '2', sessionId: inApp.id })`.
|
|
389
|
+
Add `diag: '1'` only when `verificationUrl` contains `diag=1`. Other keys
|
|
390
|
+
are ignored, and the Builder URL comes from the app's configuration.
|
|
391
|
+
|
|
375
392
|
The Consumer supplies a URL, not `verificationClientId` or
|
|
376
393
|
`x-reclaim-vc-id`. Builder resolves and stores the UUID. The selected
|
|
377
394
|
Verification Client reads its own configured UUID and sends it only on its
|
|
@@ -565,6 +582,10 @@ curl -X POST "$BUILDER_URL/verifications/sessions" \
|
|
|
565
582
|
# → 201 { "id": "…", "verificationUrl": "…&api=2", "status": "pending", "mode": "…", … }
|
|
566
583
|
```
|
|
567
584
|
|
|
585
|
+
For the in-app SDK or add-to-app module, send
|
|
586
|
+
`"verificationClientUrl": "https://build.reclaimprotocol.org/share/inapp-sdk"`.
|
|
587
|
+
Those apps can't open a session created for another client.
|
|
588
|
+
|
|
568
589
|
For a TEE-bound session, a raw HTTP client must derive the legacy hash nonce
|
|
569
590
|
with its organization verification private key, sign the exact
|
|
570
591
|
`RECLAIM_BUILDER_TEE_BINDING_V1:{organizationId}:{sessionId}:{applicationId}:{timestamp}:{attestationVersion}:{attestationNonce}`
|
|
@@ -668,7 +689,8 @@ reclaim.sessions.create({ providers, context, verificationClientUrl?, orgEthPriv
|
|
|
668
689
|
// providers: { providerId, version? }[] — proved in order, one combined result; all required.
|
|
669
690
|
// → VerificationSession (has `id`, `verificationUrl`, `status`, `mode`, …)
|
|
670
691
|
// verificationClientUrl selects a registered Verification Client by URL;
|
|
671
|
-
// omitted, it defaults to the Portal.
|
|
692
|
+
// omitted, it defaults to the Portal. The session then only opens in that
|
|
693
|
+
// client: use VerificationClient.inAppSdk for in-app SDK / add-to-app hosts.
|
|
672
694
|
// orgEthPrivateKey optionally creates the post-create TEE binding locally.
|
|
673
695
|
// The returned verificationUrl contains sessionId and api=2.
|
|
674
696
|
reclaim.sessions.bindTeeNonce(reclaimSessionId, { orgEthPrivateKey, timestamp? })
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reclaimprotocol/client",
|
|
3
3
|
"title": "Reclaim Client",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.43",
|
|
5
5
|
"description": "Typed SDK/HTTP client SDK for the Reclaim Protocol — the programmatic way to use Reclaim Protocol to verify **data points** about your users (a follower count, an account balance, an order). Can be directly integrated by apps to request verification for their users using Reclaim Protocol and verify the results.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"sideEffects": false,
|