You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -214,7 +186,7 @@ export class ReclaimProofRequest {
214
186
this.timeStamp=Date.now().toString();
215
187
this.applicationId=applicationId;
216
188
this.sessionId="";
217
-
// keep template data as empty object
189
+
// keep template data as empty object
218
190
this.templateData=emptyTemplateData;
219
191
this.parameters={};
220
192
@@ -531,11 +503,11 @@ export class ReclaimProofRequest {
531
503
/**
532
504
* Sets a custom callback URL where proofs will be submitted via HTTP `POST`
533
505
*
534
-
* By default, proofs are sent as HTTP POST with `Content-Type` as `application/x-www-form-urlencoded`.
506
+
* By default, proofs are sent as HTTP POST with `Content-Type` as `application/x-www-form-urlencoded`.
535
507
* Pass function argument `jsonProofResponse` as `true` to send proofs with `Content-Type` as `application/json`.
536
-
*
508
+
*
537
509
* When a custom callback URL is set, proofs are sent to the custom URL *instead* of the Reclaim backend.
538
-
* Consequently, the startSession `onSuccess` callback will be invoked with an empty array (`[]`)
510
+
* Consequently, the startSession `onSuccess` callback will be invoked with an empty array (`[]`)
539
511
* instead of the proof data, as the proof is not available to the SDK in this flow.
540
512
*
541
513
* This verification session's id will be present in `X-Reclaim-Session-Id` header of the request.
@@ -570,7 +542,7 @@ export class ReclaimProofRequest {
570
542
* `When `method` is set to `POST`, `body` will be sent with 'application/x-www-form-urlencoded' content type.
571
543
* When `method` is set to `GET`, if `body` is set then `body` will be sent as query parameters.
572
544
* Sending `body` on redirection is only supported in In-Browser SDK.
573
-
*
545
+
*
574
546
* @throws {InvalidParamError} When URL is invalid
575
547
*
576
548
* @example
@@ -596,7 +568,7 @@ export class ReclaimProofRequest {
596
568
* coordinate with your backend to receive errors.
597
569
*
598
570
* This verification session's id will be present in `X-Reclaim-Session-Id` header of the request.
599
-
*
571
+
*
600
572
* Following is the data format which is sent as an HTTP POST request to the url with `Content-Type: application/json`:
601
573
602
574
* ```json
@@ -610,7 +582,7 @@ export class ReclaimProofRequest {
610
582
* // [key: any]: any
611
583
* }
612
584
* ```
613
-
*
585
+
*
614
586
* For more details about response format, check out [official documentation of Error Callback URL](https://docs.reclaimprotocol.org/js-sdk/preparing-request#cancel-callback).
615
587
*
616
588
* @param url - The URL where errors should be submitted via HTTP POST
@@ -620,9 +592,9 @@ export class ReclaimProofRequest {
timestamp: this.timeStamp,// New field with correct spelling
979
-
timeStamp: this.timeStamp,// @deprecated: Remove in future versions
951
+
timeStamp: this.timeStamp,// @deprecated: Remove in future versions
980
952
options: this.options,
981
953
sdkVersion: this.sdkVersion,
982
954
jsonProofResponse: this.jsonProofResponse,
@@ -995,7 +967,7 @@ export class ReclaimProofRequest {
995
967
996
968
/**
997
969
* Validates signature and returns template data
998
-
* @returns
970
+
* @returns
999
971
*/
1000
972
privategetTemplateData=(): TemplateData=>{
1001
973
if(!this.signature){
@@ -1356,10 +1328,10 @@ export class ReclaimProofRequest {
1356
1328
* In the custom-callback flow (where the SDK submits a proof to a provided callback URL),
1357
1329
* onSuccess may be invoked with an empty array (onSuccess([])) when no proof is available
1358
1330
* (this happens when a callback is set using setAppCallbackUrl where proof is sent to callback instead of reclaim backend).
1359
-
*
1331
+
*
1360
1332
* Please refer to the OnSuccess type signature ((proof?: Proof | Proof[]) => void)
1361
1333
* and the startSession function source for more details.
1362
-
*
1334
+
*
1363
1335
* > [!TIP]
1364
1336
* > **Best Practice:** When using `setAppCallbackUrl` and/or `setCancelCallbackUrl`, your backend receives the proof or cancellation details directly. We recommend your backend notifies the frontend (e.g. via WebSockets, SSE, or polling) to stop the verification process and handle the appropriate success/failure action. Do not rely completely on `startSession` callbacks on the frontend when using these backend callbacks.
1365
1337
*
@@ -1431,7 +1403,7 @@ export class ReclaimProofRequest {
1431
1403
thrownewProofNotVerifiedError();
1432
1404
}
1433
1405
}
1434
-
// check if the proofs array has only one proof then send the proofs in onSuccess
1406
+
// check if the proofs array has only one proof then send the proofs in onSuccess
1435
1407
if(proofs.length===1){
1436
1408
1437
1409
onSuccess(proofs[0]);
@@ -1504,4 +1476,3 @@ export class ReclaimProofRequest {
0 commit comments