vesant-sdk 1.7.0-dev.e0ee6d5 → 1.7.0-dev.e1da577

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 (43) hide show
  1. package/dist/{client-ZNdnpWe7.d.mts → client-B0qhE2kr.d.mts} +1 -1
  2. package/dist/{client-DoMSYMMR.d.ts → client-DF7hlMEz.d.ts} +13 -0
  3. package/dist/{client-DMIRx7Tu.d.mts → client-DrjgZoH_.d.mts} +13 -0
  4. package/dist/{client-C3DCmGe9.d.ts → client-DtH2RLuy.d.ts} +1 -1
  5. package/dist/compliance/index.d.mts +2 -2
  6. package/dist/compliance/index.d.ts +2 -2
  7. package/dist/compliance/index.js +0 -3
  8. package/dist/compliance/index.js.map +1 -1
  9. package/dist/compliance/index.mjs +0 -3
  10. package/dist/compliance/index.mjs.map +1 -1
  11. package/dist/geolocation/index.d.mts +2 -2
  12. package/dist/geolocation/index.d.ts +2 -2
  13. package/dist/index.d.mts +4 -4
  14. package/dist/index.d.ts +4 -4
  15. package/dist/index.js +40 -22
  16. package/dist/index.js.map +1 -1
  17. package/dist/index.mjs +40 -22
  18. package/dist/index.mjs.map +1 -1
  19. package/dist/kyc/core.d.mts +1 -1
  20. package/dist/kyc/core.d.ts +1 -1
  21. package/dist/kyc/core.js +36 -18
  22. package/dist/kyc/core.js.map +1 -1
  23. package/dist/kyc/core.mjs +36 -18
  24. package/dist/kyc/core.mjs.map +1 -1
  25. package/dist/kyc/index.d.mts +161 -58
  26. package/dist/kyc/index.d.ts +161 -58
  27. package/dist/kyc/index.js +36 -18
  28. package/dist/kyc/index.js.map +1 -1
  29. package/dist/kyc/index.mjs +36 -18
  30. package/dist/kyc/index.mjs.map +1 -1
  31. package/dist/react.d.mts +18 -14
  32. package/dist/react.d.ts +18 -14
  33. package/dist/react.js +303 -35
  34. package/dist/react.js.map +1 -1
  35. package/dist/react.mjs +303 -35
  36. package/dist/react.mjs.map +1 -1
  37. package/dist/tax/index.d.mts +18 -1
  38. package/dist/tax/index.d.ts +18 -1
  39. package/dist/tax/index.js +4 -1
  40. package/dist/tax/index.js.map +1 -1
  41. package/dist/tax/index.mjs +4 -1
  42. package/dist/tax/index.mjs.map +1 -1
  43. package/package.json +1 -1
@@ -57,6 +57,18 @@ interface KycRequest {
57
57
  other_reason?: string;
58
58
  /** @deprecated Use {@link warning_reasons}. */
59
59
  warnings?: Record<string, Record<string, string>>;
60
+ /**
61
+ * Tenant app should block onboarding/the action when true. Set when a
62
+ * failed verification matches a per-event KYC alert rule with the `block`
63
+ * reaction; sticky once set (a later non-blocking update won't clear it).
64
+ */
65
+ block: boolean;
66
+ /**
67
+ * Names the configured verification that triggered the block (e.g.
68
+ * `document_verification`, `face_verification`, `address_verification`,
69
+ * `age_verification`). Empty when {@link block} is false.
70
+ */
71
+ block_reason?: string;
60
72
  proofs?: Proof[];
61
73
  alerts?: KycAlert[];
62
74
  risk_profile?: KycCustomerProfile;
@@ -132,10 +144,10 @@ interface UpdateKycAlertRequest {
132
144
  *
133
145
  * - `enabled=false` → event blocked.
134
146
  * - `enabled=true`, `threshold=0` (or null/omitted) → every event of this
135
- * type triggers Re-Use KYC, regardless of amount.
147
+ * type triggers Event-Based Face Verification, regardless of amount.
136
148
  * - `enabled=true`, `threshold>0` → only amounts `>= threshold` trigger.
137
149
  */
138
- interface ReuseKycThresholdTrigger {
150
+ interface EventBasedFaceVerificationThresholdTrigger {
139
151
  enabled: boolean;
140
152
  /** USD threshold; 0 / null / omitted means "any amount". */
141
153
  threshold: number;
@@ -148,15 +160,15 @@ interface ReuseKycThresholdTrigger {
148
160
  * `event_window_minutes <= window_minutes`. Either bound of 0 means
149
161
  * "don't enforce that bound".
150
162
  */
151
- interface ReuseKycFrequencyTrigger {
163
+ interface EventBasedFaceVerificationFrequencyTrigger {
152
164
  enabled: boolean;
153
165
  /** Minimum number of events; 0 / null / omitted means "any count". */
154
166
  count: number;
155
167
  /** Maximum lookback window in minutes; 0 / null / omitted means "any window". */
156
168
  window_minutes: number;
157
169
  }
158
- /** Events that can trigger Re-Use KYC for a tenant. */
159
- interface ReuseKycTriggers {
170
+ /** Events that can trigger Event-Based Face Verification for a tenant. */
171
+ interface EventBasedFaceVerificationTriggers {
160
172
  login: boolean;
161
173
  password_change: boolean;
162
174
  name_change: boolean;
@@ -165,19 +177,19 @@ interface ReuseKycTriggers {
165
177
  new_device_or_location: boolean;
166
178
  device_fingerprint_change: boolean;
167
179
  payment_method_change: boolean;
168
- deposit: ReuseKycThresholdTrigger;
169
- withdrawal: ReuseKycThresholdTrigger;
170
- large_bet_placement: ReuseKycThresholdTrigger;
171
- high_frequency_betting: ReuseKycFrequencyTrigger;
180
+ deposit: EventBasedFaceVerificationThresholdTrigger;
181
+ withdrawal: EventBasedFaceVerificationThresholdTrigger;
182
+ large_bet_placement: EventBasedFaceVerificationThresholdTrigger;
183
+ high_frequency_betting: EventBasedFaceVerificationFrequencyTrigger;
172
184
  account_balance_transfer: boolean;
173
185
  }
174
186
  /**
175
- * Reactions taken when a customer exhausts the Re-Use KYC retry limit.
187
+ * Reactions taken when a customer exhausts the Event-Based Face Verification retry limit.
176
188
  * `trigger_alert` is enforced by the server (creates a KYC alert);
177
189
  * `enforce_logout` and `freeze_account` are forwarded to the tenant app
178
190
  * via the callback `data` field for it to enforce.
179
191
  */
180
- interface ReuseKycReactions {
192
+ interface EventBasedFaceVerificationReactions {
181
193
  /** Retries after the first attempt; total submissions = this + 1. */
182
194
  max_retry_attempts: number;
183
195
  trigger_alert: boolean;
@@ -193,7 +205,7 @@ interface KycPreferences {
193
205
  is_face_verification_required: boolean;
194
206
  is_address_verification_required: boolean;
195
207
  is_age_verification_required: boolean;
196
- /** Master switch for the Re-Use KYC feature. */
208
+ /** Master switch for the Event-Based Face Verification feature. */
197
209
  is_reuse_kyc_enabled?: boolean;
198
210
  min_age: number;
199
211
  max_age: number;
@@ -202,10 +214,10 @@ interface KycPreferences {
202
214
  high_risk_score: number;
203
215
  medium_risk_score: number;
204
216
  supported_document_types: SupportedDocumentType[];
205
- /** Per-event triggers for Re-Use KYC. */
206
- reuse_kyc_triggers?: ReuseKycTriggers;
207
- /** Retry / reaction policy for Re-Use KYC. */
208
- reuse_kyc_reactions?: ReuseKycReactions;
217
+ /** Per-event triggers for Event-Based Face Verification. */
218
+ reuse_kyc_triggers?: EventBasedFaceVerificationTriggers;
219
+ /** Retry / reaction policy for Event-Based Face Verification. */
220
+ reuse_kyc_reactions?: EventBasedFaceVerificationReactions;
209
221
  created_at: string;
210
222
  updated_at: string;
211
223
  }
@@ -224,9 +236,9 @@ interface UpdateKycPreferencesRequest {
224
236
  medium_risk_score?: number;
225
237
  supported_document_types?: SupportedDocumentType[];
226
238
  /** Partial update — only the events present here are changed. */
227
- reuse_kyc_triggers?: Partial<ReuseKycTriggers>;
239
+ reuse_kyc_triggers?: Partial<EventBasedFaceVerificationTriggers>;
228
240
  /** Partial update — only the keys present here are changed. */
229
- reuse_kyc_reactions?: Partial<ReuseKycReactions>;
241
+ reuse_kyc_reactions?: Partial<EventBasedFaceVerificationReactions>;
230
242
  }
231
243
  interface Name {
232
244
  first_name?: string;
@@ -306,29 +318,70 @@ interface RequestKycSubmitLinkRequest {
306
318
  redirect_url?: string;
307
319
  /** URL to receive callback notifications via POST request when KYC status changes (optional) */
308
320
  callback_url?: string;
309
- /** Event that triggered the KYC request (e.g. "onboarding", "login", "transaction") */
321
+ /**
322
+ * Event that triggered the KYC request. Valid values: "onboarding",
323
+ * "first_withdrawal", "first_purchase", "manual". The tenant's KYC
324
+ * verification trigger preferences decide, per event, whether KYC is
325
+ * required (`kyc_required` in the response). "manual" always requires
326
+ * KYC and honors the tenant's allow-skip-on-manual option (`can_skip`).
327
+ * Omitted or unknown values default to KYC required with no skip.
328
+ */
310
329
  trigger_event?: string;
330
+ /**
331
+ * Registered customer identity data (optional). Seeds the customer's risk
332
+ * profile so document verification can cross-check the submitted document
333
+ * against trusted reference data (name/DOB match, address verification).
334
+ * Fields never overwrite data already on the profile.
335
+ */
336
+ customer_data?: KycCustomerData;
337
+ }
338
+ /**
339
+ * Customer identity data supplied by your platform on a submit-link request.
340
+ * Mirrors the geolocation `customer_data` contract. Every field is optional
341
+ * and never overwrites data already on the customer's risk profile.
342
+ */
343
+ interface KycCustomerData {
344
+ /**
345
+ * Customer's registered full name. Used to match the OCR-extracted name
346
+ * on the submitted document.
347
+ */
348
+ full_name?: string;
349
+ /**
350
+ * Customer's registered date of birth. ISO 8601 date ("1999-06-02") or an
351
+ * RFC 3339 timestamp ("1986-09-06T18:30:00.000+00:00", as produced by
352
+ * `Date.prototype.toISOString()`) — for timestamps the date portion is
353
+ * used. Used for DOB matching against the submitted document.
354
+ */
355
+ date_of_birth?: string;
356
+ /** Customer's email address */
357
+ email?: string;
358
+ /** Customer's phone number */
359
+ phone?: string;
360
+ /** Customer's residential address. Used for address verification. */
361
+ address?: string;
362
+ /** Customer's country of residence */
363
+ country?: string;
311
364
  }
312
365
  /**
313
- * Trigger events that can request Re-Use KYC.
366
+ * Trigger events that can request Event-Based Face Verification.
314
367
  *
315
368
  * Account-sensitive: any sensitive change to the account profile.
316
369
  * Transaction events: covered by the per-event rules in
317
- * `ReuseKycTriggers` (`deposit`, `withdrawal`, `large_bet_placement`,
370
+ * `EventBasedFaceVerificationTriggers` (`deposit`, `withdrawal`, `large_bet_placement`,
318
371
  * `high_frequency_betting`, `account_balance_transfer`).
319
372
  */
320
- type ReuseKycEvent = '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 CreateReuseKycSessionRequest {
373
+ 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';
374
+ interface CreateEventBasedFaceVerificationSessionRequest {
322
375
  /** Unique reference for the KYC session (e.g., customer ID or transaction ID) */
323
376
  reference: string;
324
377
  /** Customer ID to associate with the KYC session */
325
378
  customer_id: string;
326
379
  /**
327
- * The triggering event. One of the `ReuseKycEvent` union members.
380
+ * The triggering event. One of the `EventBasedFaceVerificationEvent` union members.
328
381
  * Required — when empty, the server falls through to the unknown-event
329
382
  * passthrough and allows the request silently.
330
383
  */
331
- event: ReuseKycEvent;
384
+ event: EventBasedFaceVerificationEvent;
332
385
  /**
333
386
  * USD amount associated with the event. Required for threshold-gated
334
387
  * events (`deposit`, `withdrawal`, `large_bet_placement`); ignored for
@@ -352,32 +405,54 @@ interface CreateReuseKycSessionRequest {
352
405
  event_window_minutes?: number;
353
406
  /** URL to redirect user after validate the facial submission (optional) */
354
407
  redirect_url?: string;
355
- /** URL to receive callback notifications via POST request when reuse KYC status changes (optional) */
408
+ /** URL to receive callback notifications via POST request when Event-Based Face Verification status changes (optional) */
356
409
  callback_url?: string;
357
410
  }
358
- interface SubmitReuseKycSessionRequest {
359
- /** Reuse KYC session token generated from createReuseKycSession */
411
+ interface SubmitEventBasedFaceVerificationSessionRequest {
412
+ /** Event-Based Face Verification session token generated from createEventBasedFaceVerificationSession */
360
413
  token: string;
361
414
  /** Base64 encoded face image or selfie for verification */
362
415
  proof: string;
363
416
  /** Unique reference for the KYC session (e.g., customer ID or transaction ID) */
364
417
  reference?: string;
418
+ /**
419
+ * Optional capture telemetry (JSON string): the face-detection
420
+ * bounding-box samples recorded in the moments before capture. Attached
421
+ * automatically by `FaceCaptureModal` when in-modal detection is active;
422
+ * omit when building a custom capture UI without detection. Stored
423
+ * verbatim server-side for audit/review — a weak presence signal, not
424
+ * certified anti-spoofing.
425
+ */
426
+ liveness_artifact?: string;
365
427
  }
366
428
  interface RequestKycSubmitLinkResponse {
367
429
  /** Generated KYC submission redirect URL */
368
430
  link: string;
369
431
  /** KYC request ID */
370
432
  kyc_id: string;
433
+ /**
434
+ * Whether KYC is required for the reported `trigger_event`, per the
435
+ * tenant's verification trigger preferences. `false` when the trigger
436
+ * is disabled for the tenant, or when the customer is already verified
437
+ * (in that case `link` and `kyc_id` are empty).
438
+ */
439
+ kyc_required: boolean;
440
+ /**
441
+ * Whether the user may skip verification. Only `true` for
442
+ * `trigger_event: "manual"` when the tenant enables allow-skip-on-manual,
443
+ * or when the customer is already verified.
444
+ */
445
+ can_skip: boolean;
371
446
  }
372
447
  /** Device class detected by the SDK (purely client-side — server doesn't care). */
373
- type ReuseKycDeviceType = 'mobile' | 'desktop';
374
- interface CreateReuseKycSessionResponse {
375
- /** Reuse KYC session reference (echo of the request reference) */
448
+ type EventBasedFaceVerificationDeviceType = 'mobile' | 'desktop';
449
+ interface CreateEventBasedFaceVerificationSessionResponse {
450
+ /** Event-Based Face Verification session reference (echo of the request reference) */
376
451
  reference: string;
377
- /** Generated reuse KYC session token, valid 10 minutes */
452
+ /** Generated Event-Based Face Verification session token, valid 10 minutes */
378
453
  token: string;
379
454
  /**
380
- * Empty string when Re-Use KYC is required. When `is_required` is
455
+ * Empty string when Event-Based Face Verification is required. When `is_required` is
381
456
  * false, this contains the human-readable reason (e.g. feature
382
457
  * disabled, threshold not met, customer has no prior KYC).
383
458
  */
@@ -406,7 +481,7 @@ interface CreateReuseKycSessionResponse {
406
481
  * or freeze the account. Reaction flags are only populated when
407
482
  * `retry_limit_exceeded` is true.
408
483
  */
409
- interface ReuseKycReactionResult {
484
+ interface EventBasedFaceVerificationReactionResult {
410
485
  /** Submissions the customer still has before the retry limit fires. */
411
486
  retries_remaining: number;
412
487
  /** True once the latest failed attempt exhausts the retry policy. */
@@ -414,27 +489,37 @@ interface ReuseKycReactionResult {
414
489
  trigger_alert: boolean;
415
490
  enforce_logout: boolean;
416
491
  freeze_account: boolean;
492
+ /** Tenant app should block the action/account when true. */
493
+ block: boolean;
417
494
  freeze_duration_minutes: number;
418
495
  /** Set when an alert was raised on the dashboard. */
419
496
  alert_id?: string;
420
497
  }
421
498
  /**
422
- * Shape of the webhook body POSTed to `callback_url` after a Re-Use KYC
499
+ * Shape of the webhook body POSTed to `callback_url` after a Event-Based Face Verification
423
500
  * submission completes (also returned synchronously from
424
- * `submitReuseKycSession`).
501
+ * `submitEventBasedFaceVerificationSession`).
425
502
  */
426
- interface ReuseKycCallback {
503
+ interface EventBasedFaceVerificationCallback {
427
504
  event: 'reuse_kyc';
428
505
  reference: string;
429
506
  resource_id: string;
430
507
  status: KycStatus;
508
+ /**
509
+ * True when the tenant app should block the action/account. Mirrors the
510
+ * `block` reaction on {@link data} at the top level of the callback so
511
+ * consumers can branch without inspecting `data`. Omitted when false.
512
+ */
513
+ block?: boolean;
514
+ /** Names the event/verification that triggered the block. Omitted when not blocked. */
515
+ block_reason?: string;
431
516
  /** Structured decline reasons. */
432
517
  declined_reasons?: Reason[];
433
518
  /** @deprecated Use {@link declined_reasons}. */
434
519
  declined_reason?: string;
435
520
  /** @deprecated Use structured reasons. */
436
521
  warnings?: Record<string, Record<string, string>>;
437
- data: ReuseKycReactionResult;
522
+ data: EventBasedFaceVerificationReactionResult;
438
523
  }
439
524
  /**
440
525
  * Server-side handoff session backed by Redis (TTL: 15 minutes). Shared
@@ -450,7 +535,7 @@ interface KycHandoffSession {
450
535
  face: string;
451
536
  /** True after a mobile device hits PUT /api/v1/kyc/session/connect. */
452
537
  mobile_connected: boolean;
453
- /** True after the (normal-KYC) document submission completes; unused for Re-Use KYC. */
538
+ /** True after the (normal-KYC) document submission completes; unused for Event-Based Face Verification. */
454
539
  is_submitted: boolean;
455
540
  }
456
541
  interface CheckKycStatusRequest {
@@ -635,7 +720,7 @@ interface UseKycPreferencesResult extends BaseHookState {
635
720
  */
636
721
  declare class KycClient extends BaseClient {
637
722
  private userId?;
638
- private riskProfileBaseURL?;
723
+ private readonly riskProfileBaseURL?;
639
724
  constructor(config: KycClientConfig);
640
725
  /**
641
726
  * Set the user ID for operations requiring user context
@@ -654,7 +739,13 @@ declare class KycClient extends BaseClient {
654
739
  *
655
740
  * Generates a link that the user can visit to submit their KYC documents.
656
741
  *
657
- * @param request - Request containing the user ID, optional redirect URL, and optional callback URL (receives POST requests)
742
+ * Optionally pass the customer's registered identity data as
743
+ * `customer_data` (same shape as the geolocation `customer_data` block).
744
+ * It seeds the customer's risk profile so document verification can
745
+ * cross-check the submitted document against trusted reference data;
746
+ * fields never overwrite data already on the profile.
747
+ *
748
+ * @param request - Request containing the user ID, optional redirect URL, optional callback URL (receives POST requests), and optional customer identity data
658
749
  * @returns Response containing the redirect link and KYC ID
659
750
  *
660
751
  * @example
@@ -662,7 +753,15 @@ declare class KycClient extends BaseClient {
662
753
  * const result = await client.requestKycSubmitLink({
663
754
  * user_id: "user_123",
664
755
  * redirect_url: "https://merchant.com/kyc-complete", // optional
665
- * callback_url: "https://merchant.com/api/kyc-webhook" // optional - receives POST requests on status change
756
+ * callback_url: "https://merchant.com/api/kyc-webhook", // optional - receives POST requests on status change
757
+ * customer_data: { // optional - seeds the risk profile for document cross-checks
758
+ * full_name: "John Doe",
759
+ * date_of_birth: "1999-06-02", // ISO 8601
760
+ * email: "john@example.com",
761
+ * phone: "+94771234567",
762
+ * address: "12 Main St, Colombo", // used for address verification
763
+ * country: "LK"
764
+ * }
666
765
  * });
667
766
  *
668
767
  * console.log(`Redirect user to: ${result.link}`);
@@ -671,7 +770,7 @@ declare class KycClient extends BaseClient {
671
770
  */
672
771
  requestKycSubmitLink(request: RequestKycSubmitLinkRequest): Promise<RequestKycSubmitLinkResponse>;
673
772
  /**
674
- * Create a Re-Use KYC session.
773
+ * Create a Event-Based Face Verification session.
675
774
  *
676
775
  * Inspect the response before showing UI:
677
776
  * - `is_required === false` → skip face capture; `reason` explains why.
@@ -681,35 +780,39 @@ declare class KycClient extends BaseClient {
681
780
  *
682
781
  * @param request - Reference, customer_id, event, amount (for threshold events), optional URLs.
683
782
  */
684
- createReuseKycSession(request: CreateReuseKycSessionRequest): Promise<CreateReuseKycSessionResponse>;
783
+ createEventBasedFaceVerificationSession(request: CreateEventBasedFaceVerificationSessionRequest): Promise<CreateEventBasedFaceVerificationSessionResponse>;
685
784
  /**
686
- * Submit a real-time face capture for an active Re-Use KYC session.
785
+ * Submit a real-time face capture for an active Event-Based Face Verification session.
687
786
  *
688
787
  * **Mobile-only.** The server rejects desktop User-Agents with HTTP
689
788
  * 400 (`face capture must be completed on a mobile device`). Use the
690
- * QR handoff from `createReuseKycSession` for desktop callers.
789
+ * QR handoff from `createEventBasedFaceVerificationSession` for desktop callers.
691
790
  *
692
791
  * The `data` field on the response carries `retries_remaining`,
693
792
  * `retry_limit_exceeded`, and the reaction flags (`enforce_logout`,
694
793
  * `freeze_account`, etc.) so the tenant app can act on a final failure.
695
794
  *
696
- * @param request - Token from `createReuseKycSession`, plus the base64 selfie.
795
+ * @param request - Token from `createEventBasedFaceVerificationSession`, plus the base64 selfie.
697
796
  */
698
- submitReuseKycSession(request: SubmitReuseKycSessionRequest): Promise<ReuseKycCallback>;
797
+ submitEventBasedFaceVerificationSession(request: SubmitEventBasedFaceVerificationSessionRequest): Promise<EventBasedFaceVerificationCallback>;
699
798
  /**
700
- * Look up the current state of a Re-Use KYC session by its forward
701
- * reference. Useful for desktop pollers waiting on the mobile handoff.
799
+ * Look up the current state of a Event-Based Face Verification session by its
800
+ * session token. Useful for desktop pollers waiting on the mobile handoff.
801
+ *
802
+ * The lookup is scoped by the unguessable, server-issued session token (not
803
+ * the enumerable forward reference): the endpoint is public/unauthenticated,
804
+ * and scoping by the token is what prevents cross-tenant status reads.
702
805
  *
703
- * @param reference - The reference used when the session was created.
806
+ * @param token - The session token returned by `createEventBasedFaceVerificationSession`.
704
807
  */
705
- getReuseKycSessionStatus(reference: string): Promise<ReuseKycCallback>;
808
+ getEventBasedFaceVerificationSessionStatus(token: string): Promise<EventBasedFaceVerificationCallback>;
706
809
  /**
707
810
  * Fetch the Redis-backed handoff session for a token. Same backing
708
811
  * store as normal KYC (`kyc:session:<token>`, 15-minute TTL). Desktop
709
812
  * callers poll `mobile_connected` to detect when a mobile device has
710
813
  * scanned the QR and attached.
711
814
  *
712
- * @param token - The session token returned by `createReuseKycSession`.
815
+ * @param token - The session token returned by `createEventBasedFaceVerificationSession`.
713
816
  */
714
817
  getHandoffSession(token: string): Promise<KycHandoffSession>;
715
818
  /**
@@ -763,7 +866,7 @@ declare class KycClient extends BaseClient {
763
866
  * @example
764
867
  * ```typescript
765
868
  * const result = await client.submitVerification({
766
- * reference: "customer_123",
869
+ * reference: "4d2aff34-ab86-422d-992e-50b1234a5b67",
767
870
  * email: "customer@example.com",
768
871
  * country: "US",
769
872
  * document: {
@@ -789,7 +892,7 @@ declare class KycClient extends BaseClient {
789
892
  *
790
893
  * @example
791
894
  * ```typescript
792
- * const kyc = await client.getKycRequest("kyc_abc123");
895
+ * const kyc = await client.getKycRequest("550e8400-e29b-41d4-a716-446655440000");
793
896
  * console.log(`Status: ${kyc.status}, ID Verified: ${kyc.id_verified}`);
794
897
  * ```
795
898
  */
@@ -842,7 +945,7 @@ declare class KycClient extends BaseClient {
842
945
  * @example
843
946
  * ```typescript
844
947
  * await client.requestAdditionalDocuments({
845
- * id: "kyc_abc123",
948
+ * id: "550e8400-e29b-41d4-a716-446655440000",
846
949
  * document_types: ["address", "document_two"],
847
950
  * message: "Please provide proof of address and secondary ID"
848
951
  * });
@@ -857,7 +960,7 @@ declare class KycClient extends BaseClient {
857
960
  *
858
961
  * @example
859
962
  * ```typescript
860
- * const proofs = await client.getProofDownloadURLs("kyc_abc123");
963
+ * const proofs = await client.getProofDownloadURLs("550e8400-e29b-41d4-a716-446655440000");
861
964
  * proofs.forEach(proof => {
862
965
  * console.log(`${proof.type}: ${proof.url} (expires: ${proof.expires_at})`);
863
966
  * });
@@ -1043,4 +1146,4 @@ declare class KycClient extends BaseClient {
1043
1146
  createCustomerProfile(profile: CreateProfileRequest): Promise<CustomerProfile>;
1044
1147
  }
1045
1148
 
1046
- 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, 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, type ReuseKycCallback, type ReuseKycDeviceType, type ReuseKycEvent, type ReuseKycFrequencyTrigger, type ReuseKycReactionResult, type ReuseKycReactions, type ReuseKycThresholdTrigger, type ReuseKycTriggers, 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 };
1149
+ 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 KycCustomerData, 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 };
package/dist/kyc/index.js CHANGED
@@ -603,7 +603,13 @@ var KycClient = class extends BaseClient {
603
603
  *
604
604
  * Generates a link that the user can visit to submit their KYC documents.
605
605
  *
606
- * @param request - Request containing the user ID, optional redirect URL, and optional callback URL (receives POST requests)
606
+ * Optionally pass the customer's registered identity data as
607
+ * `customer_data` (same shape as the geolocation `customer_data` block).
608
+ * It seeds the customer's risk profile so document verification can
609
+ * cross-check the submitted document against trusted reference data;
610
+ * fields never overwrite data already on the profile.
611
+ *
612
+ * @param request - Request containing the user ID, optional redirect URL, optional callback URL (receives POST requests), and optional customer identity data
607
613
  * @returns Response containing the redirect link and KYC ID
608
614
  *
609
615
  * @example
@@ -611,7 +617,15 @@ var KycClient = class extends BaseClient {
611
617
  * const result = await client.requestKycSubmitLink({
612
618
  * user_id: "user_123",
613
619
  * redirect_url: "https://merchant.com/kyc-complete", // optional
614
- * callback_url: "https://merchant.com/api/kyc-webhook" // optional - receives POST requests on status change
620
+ * callback_url: "https://merchant.com/api/kyc-webhook", // optional - receives POST requests on status change
621
+ * customer_data: { // optional - seeds the risk profile for document cross-checks
622
+ * full_name: "John Doe",
623
+ * date_of_birth: "1999-06-02", // ISO 8601
624
+ * email: "john@example.com",
625
+ * phone: "+94771234567",
626
+ * address: "12 Main St, Colombo", // used for address verification
627
+ * country: "LK"
628
+ * }
615
629
  * });
616
630
  *
617
631
  * console.log(`Redirect user to: ${result.link}`);
@@ -626,7 +640,7 @@ var KycClient = class extends BaseClient {
626
640
  });
627
641
  }
628
642
  /**
629
- * Create a Re-Use KYC session.
643
+ * Create a Event-Based Face Verification session.
630
644
  *
631
645
  * Inspect the response before showing UI:
632
646
  * - `is_required === false` → skip face capture; `reason` explains why.
@@ -636,7 +650,7 @@ var KycClient = class extends BaseClient {
636
650
  *
637
651
  * @param request - Reference, customer_id, event, amount (for threshold events), optional URLs.
638
652
  */
639
- async createReuseKycSession(request) {
653
+ async createEventBasedFaceVerificationSession(request) {
640
654
  return this.request("/api/v1/kyc/face/session", {
641
655
  method: "POST",
642
656
  body: JSON.stringify(request),
@@ -644,19 +658,19 @@ var KycClient = class extends BaseClient {
644
658
  });
645
659
  }
646
660
  /**
647
- * Submit a real-time face capture for an active Re-Use KYC session.
661
+ * Submit a real-time face capture for an active Event-Based Face Verification session.
648
662
  *
649
663
  * **Mobile-only.** The server rejects desktop User-Agents with HTTP
650
664
  * 400 (`face capture must be completed on a mobile device`). Use the
651
- * QR handoff from `createReuseKycSession` for desktop callers.
665
+ * QR handoff from `createEventBasedFaceVerificationSession` for desktop callers.
652
666
  *
653
667
  * The `data` field on the response carries `retries_remaining`,
654
668
  * `retry_limit_exceeded`, and the reaction flags (`enforce_logout`,
655
669
  * `freeze_account`, etc.) so the tenant app can act on a final failure.
656
670
  *
657
- * @param request - Token from `createReuseKycSession`, plus the base64 selfie.
671
+ * @param request - Token from `createEventBasedFaceVerificationSession`, plus the base64 selfie.
658
672
  */
659
- async submitReuseKycSession(request) {
673
+ async submitEventBasedFaceVerificationSession(request) {
660
674
  return this.request("/api/v1/kyc/face/submit", {
661
675
  method: "POST",
662
676
  body: JSON.stringify(request),
@@ -664,13 +678,17 @@ var KycClient = class extends BaseClient {
664
678
  });
665
679
  }
666
680
  /**
667
- * Look up the current state of a Re-Use KYC session by its forward
668
- * reference. Useful for desktop pollers waiting on the mobile handoff.
681
+ * Look up the current state of a Event-Based Face Verification session by its
682
+ * session token. Useful for desktop pollers waiting on the mobile handoff.
683
+ *
684
+ * The lookup is scoped by the unguessable, server-issued session token (not
685
+ * the enumerable forward reference): the endpoint is public/unauthenticated,
686
+ * and scoping by the token is what prevents cross-tenant status reads.
669
687
  *
670
- * @param reference - The reference used when the session was created.
688
+ * @param token - The session token returned by `createEventBasedFaceVerificationSession`.
671
689
  */
672
- async getReuseKycSessionStatus(reference) {
673
- return this.requestWithRetry(`/api/v1/kyc/face/verify/${encodeURIComponent(reference)}`, {
690
+ async getEventBasedFaceVerificationSessionStatus(token) {
691
+ return this.requestWithRetry(`/api/v1/kyc/face/verify/${encodeURIComponent(token)}`, {
674
692
  method: "GET",
675
693
  headers: this.getUserHeaders()
676
694
  });
@@ -681,7 +699,7 @@ var KycClient = class extends BaseClient {
681
699
  * callers poll `mobile_connected` to detect when a mobile device has
682
700
  * scanned the QR and attached.
683
701
  *
684
- * @param token - The session token returned by `createReuseKycSession`.
702
+ * @param token - The session token returned by `createEventBasedFaceVerificationSession`.
685
703
  */
686
704
  async getHandoffSession(token) {
687
705
  return this.request(
@@ -756,7 +774,7 @@ var KycClient = class extends BaseClient {
756
774
  * @example
757
775
  * ```typescript
758
776
  * const result = await client.submitVerification({
759
- * reference: "customer_123",
777
+ * reference: "4d2aff34-ab86-422d-992e-50b1234a5b67",
760
778
  * email: "customer@example.com",
761
779
  * country: "US",
762
780
  * document: {
@@ -788,7 +806,7 @@ var KycClient = class extends BaseClient {
788
806
  *
789
807
  * @example
790
808
  * ```typescript
791
- * const kyc = await client.getKycRequest("kyc_abc123");
809
+ * const kyc = await client.getKycRequest("550e8400-e29b-41d4-a716-446655440000");
792
810
  * console.log(`Status: ${kyc.status}, ID Verified: ${kyc.id_verified}`);
793
811
  * ```
794
812
  */
@@ -863,7 +881,7 @@ var KycClient = class extends BaseClient {
863
881
  * @example
864
882
  * ```typescript
865
883
  * await client.requestAdditionalDocuments({
866
- * id: "kyc_abc123",
884
+ * id: "550e8400-e29b-41d4-a716-446655440000",
867
885
  * document_types: ["address", "document_two"],
868
886
  * message: "Please provide proof of address and secondary ID"
869
887
  * });
@@ -884,7 +902,7 @@ var KycClient = class extends BaseClient {
884
902
  *
885
903
  * @example
886
904
  * ```typescript
887
- * const proofs = await client.getProofDownloadURLs("kyc_abc123");
905
+ * const proofs = await client.getProofDownloadURLs("550e8400-e29b-41d4-a716-446655440000");
888
906
  * proofs.forEach(proof => {
889
907
  * console.log(`${proof.type}: ${proof.url} (expires: ${proof.expires_at})`);
890
908
  * });