@reclaimprotocol/agent 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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@reclaimprotocol/agent",
3
3
  "title": "Reclaim Agent",
4
- "version": "0.1.42",
4
+ "version": "0.1.43",
5
5
  "description": "Reclaim Protocol tools for AI coding agents. Reclaim lets your app verify data points about its users, such as a follower count, an account balance, or an order history. This package is the Reclaim MCP server: it gives your agent the tools to find, build, test, and fix data verification providers by capturing and replaying browser requests, drafting provider recipes, running zkTLS proofs, and publishing provider versions.",
6
6
  "type": "module",
7
7
  "main": "./lib/index.js",
@@ -84,7 +84,7 @@
84
84
  "@noble/hashes": "^2.2.0",
85
85
  "@puppeteer/browsers": "3.2.4",
86
86
  "@reclaimprotocol/attestor-core": "^5.1.6",
87
- "@reclaimprotocol/client": "0.1.42",
87
+ "@reclaimprotocol/client": "0.1.43",
88
88
  "@reclaimprotocol/tls": "^0.1.3",
89
89
  "chrome-remote-interface": "^0.33.0",
90
90
  "domhandler": "^6.0.0",
@@ -444,7 +444,14 @@ one, or doesn't know what a site supports. Otherwise build a new provider.
444
444
  question; don't guess.
445
445
  5. To try them: `create_verification_session({ providers: [{ providerId }, …],
446
446
  context, verificationClientUrl })` with EVERY resolved provider id and the
447
- collected context. Topic `integration` ("Try a provider without an app")
447
+ collected context. A session opens only in the client it was created for:
448
+ for an in-app SDK or add-to-app host, pass
449
+ `https://build.reclaimprotocol.org/share/inapp-sdk`; omitted, it is a
450
+ Portal session. For a native app, read the README of the
451
+ [iOS SDK](https://github.com/reclaimprotocol/reclaim-inapp-ios-sdk#readme)
452
+ or the
453
+ [Android SDK](https://github.com/reclaimprotocol/reclaim-inapp-android-sdk#readme)
454
+ before writing app code. Topic `integration` ("Try a provider without an app")
448
455
  covers the callback and polling, and the integration steps.
449
456
 
450
457
  `merge.mergeable` only signals the set *could* collapse into one provider. Pass
@@ -98,6 +98,18 @@ legacy devtools mode), or migrate to the Builder HTTP API?"
98
98
  from `VerificationClient` in the SDK. Do not send an unregistered URL or
99
99
  call a legacy backend for an `api=2` session.
100
100
 
101
+ A session only works in the client it was created for: Builder fixes the
102
+ client at creation, and any other client gets
103
+ `403 x-reclaim-vc-id does not match this session`. For a mobile app using
104
+ the in-app SDK or the add-to-app module, create every session with
105
+ `verificationClientUrl` set to
106
+ `https://build.reclaimprotocol.org/share/inapp-sdk`
107
+ (`VerificationClient.inAppSdk`); the default Portal link won't open there.
108
+ For native iOS or Android apps, follow the
109
+ [iOS SDK README](https://github.com/reclaimprotocol/reclaim-inapp-ios-sdk#readme)
110
+ or the
111
+ [Android SDK README](https://github.com/reclaimprotocol/reclaim-inapp-android-sdk#readme).
112
+
101
113
  The hosted verification page streams the target site as an image, so text
102
114
  and DOM checks of that page come back empty. Check a session's progress
103
115
  with `list_verification_events` and `get_verification_session` instead.
@@ -164,6 +176,60 @@ curl -X POST https://build.reclaimprotocol.org/verifications/sessions \
164
176
  }'
165
177
  ```
166
178
 
179
+ For an in-app SDK or add-to-app host, add the in-app SDK's client URL and pass
180
+ the returned `verificationUrl` to the app's `startVerificationFromUrl`:
181
+
182
+ ```bash
183
+ curl -X POST https://build.reclaimprotocol.org/verifications/sessions \
184
+ -H "authorization: Bearer $RECLAIM_ORG_SECRET" \
185
+ -H "content-type: application/json" \
186
+ -d '{
187
+ "providers": [
188
+ {
189
+ "providerId": "<your-provider-id>"
190
+ }
191
+ ],
192
+ "context": {
193
+ "userId": "abc"
194
+ },
195
+ "verificationClientUrl": "https://build.reclaimprotocol.org/share/inapp-sdk"
196
+ }'
197
+ ```
198
+
199
+ With `@reclaimprotocol/client`:
200
+
201
+ ```js
202
+ import { ReclaimVerification, VerificationClient } from '@reclaimprotocol/client'
203
+
204
+ const reclaim = ReclaimVerification.create({
205
+ orgSecret: process.env.RECLAIM_ORG_SECRET,
206
+ })
207
+
208
+ const session = await reclaim.sessions.create({
209
+ providers: [{ providerId: '<your-provider-id>' }],
210
+ context: { userId: 'abc' },
211
+ // Required for the in-app SDK and add-to-app module. Omitted, Builder
212
+ // selects the Portal, and the app's requests get 403.
213
+ verificationClientUrl: VerificationClient.inAppSdk,
214
+ })
215
+ // Store session.id; hand session.verificationUrl to the app.
216
+ ```
217
+
218
+ The app opens it with `startVerificationFromUrl(verificationUrl)`. If the
219
+ backend returns fields instead of a link, it calls
220
+ `startVerificationFromJson({ "api": "2", "sessionId": session.id })` with the
221
+ same result. Add `"diag": "1"` only when `verificationUrl` contains `diag=1`;
222
+ other keys are ignored.
223
+
224
+ For a native app, read the SDK's README before writing app code. Each README
225
+ has a Builder mode section covering installation, starting from a URL or
226
+ JSON, and handling the result:
227
+
228
+ - iOS (Swift):
229
+ [reclaim-inapp-ios-sdk](https://github.com/reclaimprotocol/reclaim-inapp-ios-sdk#readme)
230
+ - Android (Kotlin/Java):
231
+ [reclaim-inapp-android-sdk](https://github.com/reclaimprotocol/reclaim-inapp-android-sdk#readme)
232
+
167
233
  Receive and verify the result on the callback route. This is the one place the
168
234
  client package is needed:
169
235