vesant-sdk 1.6.6 → 1.7.0-dev.7d59b3e

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.
Files changed (86) hide show
  1. package/README.md +14 -4
  2. package/dist/{client-ePzhQKp9.d.mts → client-BolQlL5e.d.mts} +1 -1
  3. package/dist/{client-ePzhQKp9.d.ts → client-BolQlL5e.d.ts} +1 -1
  4. package/dist/client-C3DCmGe9.d.ts +436 -0
  5. package/dist/{client-C_A7QLcB.d.ts → client-DMIRx7Tu.d.mts} +5 -3
  6. package/dist/{client-BlCxjbY2.d.mts → client-DoMSYMMR.d.ts} +5 -3
  7. package/dist/client-ZNdnpWe7.d.mts +436 -0
  8. package/dist/compliance/index.d.mts +25 -429
  9. package/dist/compliance/index.d.ts +25 -429
  10. package/dist/compliance/index.js +187 -103
  11. package/dist/compliance/index.js.map +1 -1
  12. package/dist/compliance/index.mjs +187 -104
  13. package/dist/compliance/index.mjs.map +1 -1
  14. package/dist/decisions/index.d.mts +2 -2
  15. package/dist/decisions/index.d.ts +2 -2
  16. package/dist/decisions/index.js +1 -1
  17. package/dist/decisions/index.js.map +1 -1
  18. package/dist/decisions/index.mjs +1 -1
  19. package/dist/decisions/index.mjs.map +1 -1
  20. package/dist/geolocation/index.d.mts +4 -4
  21. package/dist/geolocation/index.d.ts +4 -4
  22. package/dist/geolocation/index.js +7 -24
  23. package/dist/geolocation/index.js.map +1 -1
  24. package/dist/geolocation/index.mjs +7 -24
  25. package/dist/geolocation/index.mjs.map +1 -1
  26. package/dist/index.d.mts +12 -70
  27. package/dist/index.d.ts +12 -70
  28. package/dist/index.js +302 -296
  29. package/dist/index.js.map +1 -1
  30. package/dist/index.mjs +301 -295
  31. package/dist/index.mjs.map +1 -1
  32. package/dist/kyc/core.d.mts +4 -4
  33. package/dist/kyc/core.d.ts +4 -4
  34. package/dist/kyc/core.js +86 -27
  35. package/dist/kyc/core.js.map +1 -1
  36. package/dist/kyc/core.mjs +86 -28
  37. package/dist/kyc/core.mjs.map +1 -1
  38. package/dist/kyc/index.d.mts +280 -50
  39. package/dist/kyc/index.d.ts +280 -50
  40. package/dist/kyc/index.js +86 -27
  41. package/dist/kyc/index.js.map +1 -1
  42. package/dist/kyc/index.mjs +86 -28
  43. package/dist/kyc/index.mjs.map +1 -1
  44. package/dist/react.d.mts +46 -9
  45. package/dist/react.d.ts +46 -9
  46. package/dist/react.js +891 -276
  47. package/dist/react.js.map +1 -1
  48. package/dist/react.mjs +890 -275
  49. package/dist/react.mjs.map +1 -1
  50. package/dist/risk-profile/index.d.mts +4 -4
  51. package/dist/risk-profile/index.d.ts +4 -4
  52. package/dist/risk-profile/index.js +1 -1
  53. package/dist/risk-profile/index.js.map +1 -1
  54. package/dist/risk-profile/index.mjs +1 -1
  55. package/dist/risk-profile/index.mjs.map +1 -1
  56. package/dist/scores/index.d.mts +2 -2
  57. package/dist/scores/index.d.ts +2 -2
  58. package/dist/scores/index.js +1 -1
  59. package/dist/scores/index.js.map +1 -1
  60. package/dist/scores/index.mjs +1 -1
  61. package/dist/scores/index.mjs.map +1 -1
  62. package/dist/tax/index.d.mts +6 -41
  63. package/dist/tax/index.d.ts +6 -41
  64. package/dist/tax/index.js +1 -36
  65. package/dist/tax/index.js.map +1 -1
  66. package/dist/tax/index.mjs +1 -36
  67. package/dist/tax/index.mjs.map +1 -1
  68. package/dist/{types-1RzYeSal.d.mts → types-BOFaMQxI.d.mts} +2 -2
  69. package/dist/{types-B4Ezqo7V.d.mts → types-CBQRNL-l.d.mts} +14 -1
  70. package/dist/{types-B4Ezqo7V.d.ts → types-CBQRNL-l.d.ts} +14 -1
  71. package/dist/{types-X5Md_dD_.d.ts → types-UGyDl1fd.d.ts} +2 -2
  72. package/dist/webhooks/index.d.mts +189 -2
  73. package/dist/webhooks/index.d.ts +189 -2
  74. package/dist/webhooks/index.js +49 -7
  75. package/dist/webhooks/index.js.map +1 -1
  76. package/dist/webhooks/index.mjs +49 -7
  77. package/dist/webhooks/index.mjs.map +1 -1
  78. package/package.json +16 -13
  79. package/dist/fraud/index.d.mts +0 -80
  80. package/dist/fraud/index.d.ts +0 -80
  81. package/dist/fraud/index.js +0 -606
  82. package/dist/fraud/index.js.map +0 -1
  83. package/dist/fraud/index.mjs +0 -604
  84. package/dist/fraud/index.mjs.map +0 -1
  85. package/dist/index-B04H4xfJ.d.mts +0 -320
  86. package/dist/index-CItMPmLL.d.ts +0 -320
@@ -1,6 +1,6 @@
1
- import { R as RiskLevel, P as PaginationParams } from '../types-B4Ezqo7V.mjs';
2
- import { e as ProfileFilters, f as ProfileListResponse, C as CustomerProfile, d as CreateProfileRequest } from '../types-1RzYeSal.mjs';
3
- import { B as BaseClient } from '../client-ePzhQKp9.mjs';
1
+ import { P as ProfileFilters, b as ProfileListResponse, C as CustomerProfile, a as CreateProfileRequest } from '../types-BOFaMQxI.mjs';
2
+ import { c as Reason, R as RiskLevel, P as PaginationParams } from '../types-CBQRNL-l.mjs';
3
+ import { B as BaseClient } from '../client-BolQlL5e.mjs';
4
4
 
5
5
  /**
6
6
  * TypeScript type definitions for Vesant KYC Service API
@@ -12,12 +12,13 @@ import { B as BaseClient } from '../client-ePzhQKp9.mjs';
12
12
  */
13
13
 
14
14
  type KycStatus = 'pending' | 'accepted' | 'declined' | 'review.pending' | 'unknown';
15
+ type KycDeclinedCode = 'KYC_DOCUMENT_EXPIRED' | 'KYC_DOCUMENT_INVALID' | 'KYC_FACE_MISMATCH' | 'KYC_AGE_REQUIREMENT' | 'KYC_DUPLICATE_IDENTITY' | 'KYC_ADDRESS_MISMATCH' | 'KYC_NAME_MISMATCH' | 'KYC_PROVIDER_REJECTED' | 'KYC_DECLINED';
16
+ declare const KYC_DECLINED_DESCRIPTIONS: Record<KycDeclinedCode, string>;
15
17
  type KycAlertStatus = 'pending' | 'in_progress' | 'resolved' | 'closed' | 'escalated';
16
18
  type KycAlertType = 'kyc' | 'fraud';
17
19
  type DocumentType = 'id_card' | 'driving_license' | 'passport';
18
20
  type ProofType = 'document' | 'document_two' | 'face' | 'address' | 'additional_document';
19
21
  type SupportedDocumentType = 'id_card' | 'passport' | 'driving_license';
20
- type KycTriggerEvent = 'onboarding' | 'first_withdrawal' | 'first_purchase' | 'manual' | 'withdrawal' | 'purchase';
21
22
  interface KycRequest {
22
23
  id: string;
23
24
  reference: string;
@@ -44,9 +45,17 @@ interface KycRequest {
44
45
  is_age_verification_required: boolean;
45
46
  callback_url: string;
46
47
  redirect_url?: string;
48
+ /** Structured decline reasons. Present when status is `declined`. */
49
+ declined_reasons?: Reason[];
50
+ /** Structured, non-blocking warnings. */
51
+ warning_reasons?: Reason[];
52
+ /** @deprecated Use {@link declined_reasons}. Comma-joined message text. */
47
53
  declined_reason?: string;
54
+ /** @deprecated Use the `code` on {@link declined_reasons}. */
55
+ declined_code?: KycDeclinedCode;
48
56
  accepted_reason?: string;
49
57
  other_reason?: string;
58
+ /** @deprecated Use {@link warning_reasons}. */
50
59
  warnings?: Record<string, Record<string, string>>;
51
60
  proofs?: Proof[];
52
61
  alerts?: KycAlert[];
@@ -117,6 +126,65 @@ interface UpdateKycAlertRequest {
117
126
  alert_type?: KycAlertType;
118
127
  status?: KycAlertStatus;
119
128
  }
129
+ /**
130
+ * Threshold-gated trigger for transaction events. Each rule is
131
+ * self-contained — there is no umbrella flag.
132
+ *
133
+ * - `enabled=false` → event blocked.
134
+ * - `enabled=true`, `threshold=0` (or null/omitted) → every event of this
135
+ * type triggers Event-Based Face Verification, regardless of amount.
136
+ * - `enabled=true`, `threshold>0` → only amounts `>= threshold` trigger.
137
+ */
138
+ interface EventBasedFaceVerificationThresholdTrigger {
139
+ enabled: boolean;
140
+ /** USD threshold; 0 / null / omitted means "any amount". */
141
+ threshold: number;
142
+ }
143
+ /**
144
+ * Rate-of-occurrence trigger (used by `high_frequency_betting`). The
145
+ * tenant tells the server how many events have happened over how many
146
+ * minutes via the request body (`event_count`, `event_window_minutes`);
147
+ * the server triggers when `event_count >= count` AND
148
+ * `event_window_minutes <= window_minutes`. Either bound of 0 means
149
+ * "don't enforce that bound".
150
+ */
151
+ interface EventBasedFaceVerificationFrequencyTrigger {
152
+ enabled: boolean;
153
+ /** Minimum number of events; 0 / null / omitted means "any count". */
154
+ count: number;
155
+ /** Maximum lookback window in minutes; 0 / null / omitted means "any window". */
156
+ window_minutes: number;
157
+ }
158
+ /** Events that can trigger Event-Based Face Verification for a tenant. */
159
+ interface EventBasedFaceVerificationTriggers {
160
+ login: boolean;
161
+ password_change: boolean;
162
+ name_change: boolean;
163
+ phone_number_change: boolean;
164
+ two_factor_auth_change: boolean;
165
+ new_device_or_location: boolean;
166
+ device_fingerprint_change: boolean;
167
+ payment_method_change: boolean;
168
+ deposit: EventBasedFaceVerificationThresholdTrigger;
169
+ withdrawal: EventBasedFaceVerificationThresholdTrigger;
170
+ large_bet_placement: EventBasedFaceVerificationThresholdTrigger;
171
+ high_frequency_betting: EventBasedFaceVerificationFrequencyTrigger;
172
+ account_balance_transfer: boolean;
173
+ }
174
+ /**
175
+ * Reactions taken when a customer exhausts the Event-Based Face Verification retry limit.
176
+ * `trigger_alert` is enforced by the server (creates a KYC alert);
177
+ * `enforce_logout` and `freeze_account` are forwarded to the tenant app
178
+ * via the callback `data` field for it to enforce.
179
+ */
180
+ interface EventBasedFaceVerificationReactions {
181
+ /** Retries after the first attempt; total submissions = this + 1. */
182
+ max_retry_attempts: number;
183
+ trigger_alert: boolean;
184
+ enforce_logout: boolean;
185
+ freeze_account: boolean;
186
+ freeze_duration_minutes: number;
187
+ }
120
188
  interface KycPreferences {
121
189
  id: string;
122
190
  tenant_id: string;
@@ -125,6 +193,8 @@ interface KycPreferences {
125
193
  is_face_verification_required: boolean;
126
194
  is_address_verification_required: boolean;
127
195
  is_age_verification_required: boolean;
196
+ /** Master switch for the Event-Based Face Verification feature. */
197
+ is_reuse_kyc_enabled?: boolean;
128
198
  min_age: number;
129
199
  max_age: number;
130
200
  required_document_count: number;
@@ -132,6 +202,10 @@ interface KycPreferences {
132
202
  high_risk_score: number;
133
203
  medium_risk_score: number;
134
204
  supported_document_types: SupportedDocumentType[];
205
+ /** Per-event triggers for Event-Based Face Verification. */
206
+ reuse_kyc_triggers?: EventBasedFaceVerificationTriggers;
207
+ /** Retry / reaction policy for Event-Based Face Verification. */
208
+ reuse_kyc_reactions?: EventBasedFaceVerificationReactions;
135
209
  created_at: string;
136
210
  updated_at: string;
137
211
  }
@@ -141,6 +215,7 @@ interface UpdateKycPreferencesRequest {
141
215
  is_face_verification_required?: boolean;
142
216
  is_address_verification_required?: boolean;
143
217
  is_age_verification_required?: boolean;
218
+ is_reuse_kyc_enabled?: boolean;
144
219
  min_age?: number;
145
220
  max_age?: number;
146
221
  required_document_count?: number;
@@ -148,6 +223,10 @@ interface UpdateKycPreferencesRequest {
148
223
  high_risk_score?: number;
149
224
  medium_risk_score?: number;
150
225
  supported_document_types?: SupportedDocumentType[];
226
+ /** Partial update — only the events present here are changed. */
227
+ reuse_kyc_triggers?: Partial<EventBasedFaceVerificationTriggers>;
228
+ /** Partial update — only the keys present here are changed. */
229
+ reuse_kyc_reactions?: Partial<EventBasedFaceVerificationReactions>;
151
230
  }
152
231
  interface Name {
153
232
  first_name?: string;
@@ -223,27 +302,61 @@ interface UpdateKycStatusRequest {
223
302
  interface RequestKycSubmitLinkRequest {
224
303
  /** User ID to generate KYC submission link for */
225
304
  user_id: string;
226
- /** URL to redirect user after KYC submission */
227
- redirect_url: string;
228
- /** URL to receive callback notifications via POST request when KYC status changes */
229
- callback_url: string;
230
- /** Event that triggered the KYC request */
231
- trigger_event: KycTriggerEvent;
305
+ /** URL to redirect user after KYC submission (optional) */
306
+ redirect_url?: string;
307
+ /** URL to receive callback notifications via POST request when KYC status changes (optional) */
308
+ callback_url?: string;
309
+ /** Event that triggered the KYC request (e.g. "onboarding", "login", "transaction") */
310
+ trigger_event?: string;
232
311
  }
233
- interface CreateReuseKycSessionRequest {
312
+ /**
313
+ * Trigger events that can request Event-Based Face Verification.
314
+ *
315
+ * Account-sensitive: any sensitive change to the account profile.
316
+ * Transaction events: covered by the per-event rules in
317
+ * `EventBasedFaceVerificationTriggers` (`deposit`, `withdrawal`, `large_bet_placement`,
318
+ * `high_frequency_betting`, `account_balance_transfer`).
319
+ */
320
+ type EventBasedFaceVerificationEvent = 'login' | 'password_change' | 'name_change' | 'phone_number_change' | 'two_factor_auth_change' | 'new_device_or_location' | 'device_fingerprint_change' | 'payment_method_change' | 'deposit' | 'withdrawal' | 'large_bet_placement' | 'high_frequency_betting' | 'account_balance_transfer';
321
+ interface CreateEventBasedFaceVerificationSessionRequest {
234
322
  /** Unique reference for the KYC session (e.g., customer ID or transaction ID) */
235
323
  reference: string;
236
- /** customer ID to associate with the KYC session */
324
+ /** Customer ID to associate with the KYC session */
237
325
  customer_id: string;
238
- /** where the re-use-kyc using 'login' | 'transactions' */
239
- path?: string;
326
+ /**
327
+ * The triggering event. One of the `EventBasedFaceVerificationEvent` union members.
328
+ * Required — when empty, the server falls through to the unknown-event
329
+ * passthrough and allows the request silently.
330
+ */
331
+ event: EventBasedFaceVerificationEvent;
332
+ /**
333
+ * USD amount associated with the event. Required for threshold-gated
334
+ * events (`deposit`, `withdrawal`, `large_bet_placement`); ignored for
335
+ * everything else. Missing/zero with a non-zero threshold blocks the
336
+ * session.
337
+ */
338
+ amount?: number;
339
+ /**
340
+ * Number of qualifying events the customer has performed in the
341
+ * window described by `event_window_minutes`. Required for
342
+ * frequency-gated events (`high_frequency_betting`); ignored for
343
+ * everything else.
344
+ */
345
+ event_count?: number;
346
+ /**
347
+ * Lookback window (in minutes) the tenant counted `event_count` over.
348
+ * Required for frequency-gated events alongside `event_count`. A
349
+ * window larger than the tenant's configured `window_minutes`
350
+ * implies a slower rate than "high frequency" and blocks the session.
351
+ */
352
+ event_window_minutes?: number;
240
353
  /** URL to redirect user after validate the facial submission (optional) */
241
354
  redirect_url?: string;
242
- /** URL to receive callback notifications via POST request when reuse KYC status changes (optional) */
355
+ /** URL to receive callback notifications via POST request when Event-Based Face Verification status changes (optional) */
243
356
  callback_url?: string;
244
357
  }
245
- interface SubmitReuseKycSessionRequest {
246
- /** Reuse KYC session token generated from createReUseKycSession endpoint */
358
+ interface SubmitEventBasedFaceVerificationSessionRequest {
359
+ /** Event-Based Face Verification session token generated from createEventBasedFaceVerificationSession */
247
360
  token: string;
248
361
  /** Base64 encoded face image or selfie for verification */
249
362
  proof: string;
@@ -251,22 +364,96 @@ interface SubmitReuseKycSessionRequest {
251
364
  reference?: string;
252
365
  }
253
366
  interface RequestKycSubmitLinkResponse {
254
- /** Whether KYC is required for this user */
255
- kyc_required: boolean;
256
- /** Whether the user can skip KYC */
257
- can_skip: boolean;
258
367
  /** Generated KYC submission redirect URL */
259
- link?: string;
368
+ link: string;
260
369
  /** KYC request ID */
261
- kyc_id?: string;
370
+ kyc_id: string;
262
371
  }
263
- interface CreateReuseKycSessionResponse {
264
- /** Generated reuse KYC session token, valid X minutes */
265
- token: string;
266
- /** reuse KYC session reference */
372
+ /** Device class detected by the SDK (purely client-side — server doesn't care). */
373
+ type EventBasedFaceVerificationDeviceType = 'mobile' | 'desktop';
374
+ interface CreateEventBasedFaceVerificationSessionResponse {
375
+ /** Event-Based Face Verification session reference (echo of the request reference) */
267
376
  reference: string;
268
- /** re-use-kyc required for the action or not */
377
+ /** Generated Event-Based Face Verification session token, valid 10 minutes */
378
+ token: string;
379
+ /**
380
+ * Empty string when Event-Based Face Verification is required. When `is_required` is
381
+ * false, this contains the human-readable reason (e.g. feature
382
+ * disabled, threshold not met, customer has no prior KYC).
383
+ */
384
+ reason: string;
385
+ /** Whether the caller must complete the face capture before proceeding */
269
386
  is_required: boolean;
387
+ /**
388
+ * Public HTTPS handoff URL the SDK encodes into a QR code on desktop.
389
+ * The mobile device scans it, lands on the tenant frontend's
390
+ * /reuse-kyc-submit page, and completes the face capture there. Empty
391
+ * when the server has no `BASE_URL_FRONTEND` configured — the SDK
392
+ * falls back to building its own URL in that case.
393
+ */
394
+ link: string;
395
+ /** Failed face-capture attempts so far on this session. 0 on a fresh session. */
396
+ attempts: number;
397
+ /**
398
+ * Total submissions permitted before reactions fire
399
+ * (`reuse_kyc_reactions.max_retry_attempts + 1`).
400
+ */
401
+ max_attempts: number;
402
+ }
403
+ /**
404
+ * Reaction outcome returned on every face-submit callback. Tenant apps
405
+ * use this to decide whether to allow another retry, end the session,
406
+ * or freeze the account. Reaction flags are only populated when
407
+ * `retry_limit_exceeded` is true.
408
+ */
409
+ interface EventBasedFaceVerificationReactionResult {
410
+ /** Submissions the customer still has before the retry limit fires. */
411
+ retries_remaining: number;
412
+ /** True once the latest failed attempt exhausts the retry policy. */
413
+ retry_limit_exceeded: boolean;
414
+ trigger_alert: boolean;
415
+ enforce_logout: boolean;
416
+ freeze_account: boolean;
417
+ /** Tenant app should block the action/account when true. */
418
+ block: boolean;
419
+ freeze_duration_minutes: number;
420
+ /** Set when an alert was raised on the dashboard. */
421
+ alert_id?: string;
422
+ }
423
+ /**
424
+ * Shape of the webhook body POSTed to `callback_url` after a Event-Based Face Verification
425
+ * submission completes (also returned synchronously from
426
+ * `submitEventBasedFaceVerificationSession`).
427
+ */
428
+ interface EventBasedFaceVerificationCallback {
429
+ event: 'reuse_kyc';
430
+ reference: string;
431
+ resource_id: string;
432
+ status: KycStatus;
433
+ /** Structured decline reasons. */
434
+ declined_reasons?: Reason[];
435
+ /** @deprecated Use {@link declined_reasons}. */
436
+ declined_reason?: string;
437
+ /** @deprecated Use structured reasons. */
438
+ warnings?: Record<string, Record<string, string>>;
439
+ data: EventBasedFaceVerificationReactionResult;
440
+ }
441
+ /**
442
+ * Server-side handoff session backed by Redis (TTL: 15 minutes). Shared
443
+ * with the normal KYC mobile/desktop handoff. Desktop clients poll this
444
+ * to detect when a mobile device has attached to the same token via QR.
445
+ */
446
+ interface KycHandoffSession {
447
+ document: string;
448
+ document_backside: string;
449
+ document_two: string;
450
+ document_two_backside: string;
451
+ address: string;
452
+ face: string;
453
+ /** True after a mobile device hits PUT /api/v1/kyc/session/connect. */
454
+ mobile_connected: boolean;
455
+ /** True after the (normal-KYC) document submission completes; unused for Event-Based Face Verification. */
456
+ is_submitted: boolean;
270
457
  }
271
458
  interface CheckKycStatusRequest {
272
459
  /** User ID to check KYC status for */
@@ -289,9 +476,17 @@ interface CheckKycStatusResponse {
289
476
  address_verified: boolean;
290
477
  face_verified: boolean;
291
478
  age_verified: boolean;
479
+ /** Structured decline reasons. Present when status is `declined`. */
480
+ declined_reasons?: Reason[];
481
+ /** Structured, non-blocking warnings. */
482
+ warning_reasons?: Reason[];
483
+ /** @deprecated Use {@link declined_reasons}. */
292
484
  declined_reason?: string;
485
+ /** @deprecated Use the `code` on {@link declined_reasons}. */
486
+ declined_code?: KycDeclinedCode;
293
487
  other_reason?: string;
294
488
  accepted_reason?: string;
489
+ /** @deprecated Use {@link warning_reasons}. */
295
490
  warnings?: Record<string, Record<string, string>>;
296
491
  required_document_count: number;
297
492
  supported_document_types?: SupportedDocumentType[];
@@ -461,44 +656,79 @@ declare class KycClient extends BaseClient {
461
656
  *
462
657
  * Generates a link that the user can visit to submit their KYC documents.
463
658
  *
464
- * @param request - Request containing the user ID, redirect URL, callback URL, and trigger event
465
- * @returns Response containing kyc_required, can_skip, and optionally the redirect link and KYC ID
659
+ * @param request - Request containing the user ID, optional redirect URL, and optional callback URL (receives POST requests)
660
+ * @returns Response containing the redirect link and KYC ID
466
661
  *
467
662
  * @example
468
663
  * ```typescript
469
664
  * const result = await client.requestKycSubmitLink({
470
665
  * user_id: "user_123",
471
- * redirect_url: "https://merchant.com/kyc-complete",
472
- * callback_url: "https://merchant.com/api/kyc-webhook",
473
- * trigger_event: "onboarding"
666
+ * redirect_url: "https://merchant.com/kyc-complete", // optional
667
+ * callback_url: "https://merchant.com/api/kyc-webhook" // optional - receives POST requests on status change
474
668
  * });
475
669
  *
476
- * if (result.kyc_required && result.link) {
477
- * console.log(`Redirect user to: ${result.link}`);
478
- * } else if (result.can_skip) {
479
- * console.log("KYC not required, user can proceed");
480
- * }
670
+ * console.log(`Redirect user to: ${result.link}`);
671
+ * console.log(`KYC ID: ${result.kyc_id}`);
481
672
  * ```
482
673
  */
483
674
  requestKycSubmitLink(request: RequestKycSubmitLinkRequest): Promise<RequestKycSubmitLinkResponse>;
484
675
  /**
485
- * Create a reuse KYC session for validate a user with existing KYC verification
676
+ * Create a Event-Based Face Verification session.
486
677
  *
487
- * @param request - Request containing the reference, customer_id, optional redirect URL, and callback URL (receives POST requests)
678
+ * Inspect the response before showing UI:
679
+ * - `is_required === false` → skip face capture; `reason` explains why.
680
+ * - `device_type === 'desktop'` → render `qr_payload` as a QR; the
681
+ * mobile device picks up the session via the connect endpoint.
682
+ * - `device_type === 'mobile'` → open the face capture modal directly.
683
+ *
684
+ * @param request - Reference, customer_id, event, amount (for threshold events), optional URLs.
488
685
  */
489
- createReuseKycSession(request: CreateReuseKycSessionRequest): Promise<CreateReuseKycSessionResponse>;
686
+ createEventBasedFaceVerificationSession(request: CreateEventBasedFaceVerificationSessionRequest): Promise<CreateEventBasedFaceVerificationSessionResponse>;
490
687
  /**
491
- * Submit a reuse KYC session for validate a user with existing KYC verification
688
+ * Submit a real-time face capture for an active Event-Based Face Verification session.
689
+ *
690
+ * **Mobile-only.** The server rejects desktop User-Agents with HTTP
691
+ * 400 (`face capture must be completed on a mobile device`). Use the
692
+ * QR handoff from `createEventBasedFaceVerificationSession` for desktop callers.
492
693
  *
493
- * @param request - Request containing the reference, token and proof (receives POST requests)
694
+ * The `data` field on the response carries `retries_remaining`,
695
+ * `retry_limit_exceeded`, and the reaction flags (`enforce_logout`,
696
+ * `freeze_account`, etc.) so the tenant app can act on a final failure.
697
+ *
698
+ * @param request - Token from `createEventBasedFaceVerificationSession`, plus the base64 selfie.
494
699
  */
495
- submitReuseKycSession(request: SubmitReuseKycSessionRequest): Promise<CheckKycStatusResponse>;
700
+ submitEventBasedFaceVerificationSession(request: SubmitEventBasedFaceVerificationSessionRequest): Promise<EventBasedFaceVerificationCallback>;
496
701
  /**
497
- * Check reuse KYC session status for a reference
498
- * @param reference - The unique reference used for the reuse KYC session (e.g., customer ID or transaction ID)
499
- * @returns Response with kyc_status and message (reason)
500
- * **/
501
- getReuseKycSessionStatus(reference: string): Promise<CheckKycStatusResponse>;
702
+ * Look up the current state of a Event-Based Face Verification session by its
703
+ * session token. Useful for desktop pollers waiting on the mobile handoff.
704
+ *
705
+ * The lookup is scoped by the unguessable, server-issued session token (not
706
+ * the enumerable forward reference): the endpoint is public/unauthenticated,
707
+ * and scoping by the token is what prevents cross-tenant status reads.
708
+ *
709
+ * @param token - The session token returned by `createEventBasedFaceVerificationSession`.
710
+ */
711
+ getEventBasedFaceVerificationSessionStatus(token: string): Promise<EventBasedFaceVerificationCallback>;
712
+ /**
713
+ * Fetch the Redis-backed handoff session for a token. Same backing
714
+ * store as normal KYC (`kyc:session:<token>`, 15-minute TTL). Desktop
715
+ * callers poll `mobile_connected` to detect when a mobile device has
716
+ * scanned the QR and attached.
717
+ *
718
+ * @param token - The session token returned by `createEventBasedFaceVerificationSession`.
719
+ */
720
+ getHandoffSession(token: string): Promise<KycHandoffSession>;
721
+ /**
722
+ * Attach a mobile device to a desktop-initiated session. The mobile
723
+ * client calls this after scanning the QR code. The desktop poller
724
+ * sees `mobile_connected: true` on the next `getHandoffSession`.
725
+ *
726
+ * @param token - The session token transferred via the QR payload.
727
+ * @param isDisconnect - Pass true to release the session (default false).
728
+ */
729
+ connectMobileSession(token: string, isDisconnect?: boolean): Promise<{
730
+ mobile_connected: boolean;
731
+ }>;
502
732
  /**
503
733
  * Check KYC status for a user
504
734
  *
@@ -819,4 +1049,4 @@ declare class KycClient extends BaseClient {
819
1049
  createCustomerProfile(profile: CreateProfileRequest): Promise<CustomerProfile>;
820
1050
  }
821
1051
 
822
- export { type CheckKycStatusRequest, type CheckKycStatusResponse, CreateProfileRequest as CreateCustomerProfileRequest, type CreateReuseKycSessionRequest, type CreateReuseKycSessionResponse, CustomerProfile, ProfileFilters as CustomerProfileFilters, ProfileListResponse as CustomerProfileListResponse, type DocumentType, type DocumentVerificationRequest, type DocumentVerificationResponse, type FaceProof, type KycAlert, type KycAlertFilters, type KycAlertListResponse, type KycAlertStatus, type KycAlertType, KycClient, type KycClientConfig, type KycCustomerProfile, type KycOverview, type KycPagination, type KycPreferences, type KycRequest, type KycRequestFilters, type KycRequestListResponse, type KycStatus, type KycTriggerEvent, type Name, PaginationParams, type Proof, type ProofDownloadURL, type ProofType, type RequestAdditionalDocumentsRequest, type RequestKycSubmitLinkRequest, type RequestKycSubmitLinkResponse, RiskLevel, type SubmitReuseKycSessionRequest, type SubmittedDocument, type SupportedDocumentType, type UpdateKycAlertRequest, type UpdateKycPreferencesRequest, type UpdateKycStatusRequest, type UseKycAlertsOptions, type UseKycAlertsResult, type UseKycOverviewOptions, type UseKycOverviewResult, type UseKycPreferencesResult, type UseKycRequestsOptions, type UseKycRequestsResult, type UseKycSubmissionOptions, type UseKycSubmissionResult };
1052
+ export { type CheckKycStatusRequest, type CheckKycStatusResponse, CreateProfileRequest as CreateCustomerProfileRequest, type CreateEventBasedFaceVerificationSessionRequest, type CreateEventBasedFaceVerificationSessionResponse, CustomerProfile, ProfileFilters as CustomerProfileFilters, ProfileListResponse as CustomerProfileListResponse, type DocumentType, type DocumentVerificationRequest, type DocumentVerificationResponse, type EventBasedFaceVerificationCallback, type EventBasedFaceVerificationDeviceType, type EventBasedFaceVerificationEvent, type EventBasedFaceVerificationFrequencyTrigger, type EventBasedFaceVerificationReactionResult, type EventBasedFaceVerificationReactions, type EventBasedFaceVerificationThresholdTrigger, type EventBasedFaceVerificationTriggers, type FaceProof, KYC_DECLINED_DESCRIPTIONS, type KycAlert, type KycAlertFilters, type KycAlertListResponse, type KycAlertStatus, type KycAlertType, KycClient, type KycClientConfig, type KycCustomerProfile, type KycDeclinedCode, type KycHandoffSession, type KycOverview, type KycPagination, type KycPreferences, type KycRequest, type KycRequestFilters, type KycRequestListResponse, type KycStatus, type Name, PaginationParams, type Proof, type ProofDownloadURL, type ProofType, type RequestAdditionalDocumentsRequest, type RequestKycSubmitLinkRequest, type RequestKycSubmitLinkResponse, RiskLevel, type SubmitEventBasedFaceVerificationSessionRequest, type SubmittedDocument, type SupportedDocumentType, type UpdateKycAlertRequest, type UpdateKycPreferencesRequest, type UpdateKycStatusRequest, type UseKycAlertsOptions, type UseKycAlertsResult, type UseKycOverviewOptions, type UseKycOverviewResult, type UseKycPreferencesResult, type UseKycRequestsOptions, type UseKycRequestsResult, type UseKycSubmissionOptions, type UseKycSubmissionResult };