vesant-sdk 1.7.2-dev.5d70bb0 → 1.7.2-dev.846d9c3

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 (42) hide show
  1. package/README.md +4 -0
  2. package/dist/{client-D23KhWeh.d.mts → client-5q4whhGu.d.mts} +1 -1
  3. package/dist/{client-fy3trF2K.d.ts → client-BaUekQT8.d.ts} +32 -10
  4. package/dist/{client-B3DCAHlg.d.ts → client-DUHC-68_.d.ts} +1 -1
  5. package/dist/{client-BwXMQA2a.d.mts → client-XDEhh9VN.d.mts} +32 -10
  6. package/dist/compliance/index.d.mts +2 -2
  7. package/dist/compliance/index.d.ts +2 -2
  8. package/dist/compliance/index.js +39 -1
  9. package/dist/compliance/index.js.map +1 -1
  10. package/dist/compliance/index.mjs +39 -1
  11. package/dist/compliance/index.mjs.map +1 -1
  12. package/dist/geolocation/index.d.mts +2 -2
  13. package/dist/geolocation/index.d.ts +2 -2
  14. package/dist/geolocation/index.js +39 -1
  15. package/dist/geolocation/index.js.map +1 -1
  16. package/dist/geolocation/index.mjs +39 -1
  17. package/dist/geolocation/index.mjs.map +1 -1
  18. package/dist/index.d.mts +3 -3
  19. package/dist/index.d.ts +3 -3
  20. package/dist/index.js +113 -30
  21. package/dist/index.js.map +1 -1
  22. package/dist/index.mjs +113 -31
  23. package/dist/index.mjs.map +1 -1
  24. package/dist/kyc/core.d.mts +1 -1
  25. package/dist/kyc/core.d.ts +1 -1
  26. package/dist/kyc/core.js +74 -29
  27. package/dist/kyc/core.js.map +1 -1
  28. package/dist/kyc/core.mjs +74 -30
  29. package/dist/kyc/core.mjs.map +1 -1
  30. package/dist/kyc/index.d.mts +334 -65
  31. package/dist/kyc/index.d.ts +334 -65
  32. package/dist/kyc/index.js +74 -29
  33. package/dist/kyc/index.js.map +1 -1
  34. package/dist/kyc/index.mjs +74 -30
  35. package/dist/kyc/index.mjs.map +1 -1
  36. package/dist/react.d.mts +126 -48
  37. package/dist/react.d.ts +126 -48
  38. package/dist/react.js +257 -35
  39. package/dist/react.js.map +1 -1
  40. package/dist/react.mjs +255 -36
  41. package/dist/react.mjs.map +1 -1
  42. package/package.json +1 -1
package/dist/react.d.mts CHANGED
@@ -1,8 +1,9 @@
1
- import { D as DeviceFingerprintRequest, G as GeolocationClient, i as CipherTextOptions, l as CipherTextResult, Y as UseGeolocationOptions, Z as UseGeolocationResult, _ as UseLocationCaptureOptions, $ as UseLocationCaptureResult, a0 as UseLocationRequestsOptions, a1 as UseLocationRequestsResult } from './client-BwXMQA2a.mjs';
2
- import { e as LoginVerificationResponse, L as LoginVerificationRequest, f as RegistrationVerificationResponse, R as RegistrationVerificationRequest, h as TransactionVerificationResponse, g as TransactionVerificationRequest, C as ComplianceClient } from './client-D23KhWeh.mjs';
1
+ import { D as DeviceFingerprintRequest, G as GeolocationClient, i as CipherTextOptions, l as CipherTextResult, Y as UseGeolocationOptions, Z as UseGeolocationResult, _ as UseLocationCaptureOptions, $ as UseLocationCaptureResult, a0 as UseLocationRequestsOptions, a1 as UseLocationRequestsResult } from './client-XDEhh9VN.mjs';
2
+ import { e as LoginVerificationResponse, L as LoginVerificationRequest, f as RegistrationVerificationResponse, R as RegistrationVerificationRequest, h as TransactionVerificationResponse, g as TransactionVerificationRequest, C as ComplianceClient } from './client-5q4whhGu.mjs';
3
3
  import { RiskProfileClient } from './risk-profile/index.mjs';
4
4
  import { C as CustomerProfile } from './types-BOFaMQxI.mjs';
5
- import { KycClient, CreateEventBasedFaceVerificationSessionRequest, CreateEventBasedFaceVerificationSessionResponse, EventBasedFaceVerificationCallback, UseKycAlertsOptions, UseKycAlertsResult, UseKycOverviewOptions, UseKycOverviewResult, UseKycPreferencesResult, UseKycRequestsOptions, UseKycRequestsResult, UseKycSubmissionOptions, UseKycSubmissionResult } from './kyc/index.mjs';
5
+ import { CreateEventBasedFaceVerificationSessionResponse, EventBasedFaceVerificationCallback, KycClient, CreateEventBasedFaceVerificationSessionRequest, UseKycAlertsOptions, UseKycAlertsResult, UseKycOverviewOptions, UseKycOverviewResult, UseKycPreferencesResult, UseKycRequestsOptions, UseKycRequestsResult, UseKycSubmissionOptions, UseKycSubmissionResult } from './kyc/index.mjs';
6
+ import React$1 from 'react';
6
7
  import './client-q9fN8Hhf.mjs';
7
8
  import './types-CBQRNL-l.mjs';
8
9
 
@@ -63,6 +64,12 @@ declare function createDeviceFingerprint(): DeviceFingerprintRequest;
63
64
  /**
64
65
  * React hook for generating cipherText
65
66
  *
67
+ * The tenant's GPS requirements are read from the client before each generation.
68
+ * The client reuses a fetched copy for a short period, so this does not add a
69
+ * request per event, and a requirement changed in the compliance console takes
70
+ * effect without reloading the page. Call `refreshConfig` to apply a change
71
+ * immediately.
72
+ *
66
73
  * @example
67
74
  * ```tsx
68
75
  * function LoginForm() {
@@ -79,6 +86,7 @@ declare function createDeviceFingerprint(): DeviceFingerprintRequest;
79
86
  */
80
87
  declare function useCipherText(client?: GeolocationClient): {
81
88
  generate: (options: CipherTextOptions) => Promise<CipherTextResult | null>;
89
+ refreshConfig: () => Promise<void>;
82
90
  configLoading: boolean;
83
91
  configError: Error | null;
84
92
  };
@@ -402,7 +410,11 @@ declare function useKycAlerts(client: KycClient, options?: UseKycAlertsOptions):
402
410
  */
403
411
  declare function useKycOverview(client: KycClient, options?: UseKycOverviewOptions): UseKycOverviewResult;
404
412
  /**
405
- * React hook for managing KYC preferences
413
+ * React hook for reading KYC preferences
414
+ *
415
+ * Preferences are managed in the Vesant console. The returned
416
+ * `updatePreferences` is deprecated: the platform exposes no update
417
+ * operation, so it always fails.
406
418
  *
407
419
  * @param client - KycClient instance
408
420
  * @param autoFetch - Auto-fetch preferences on mount (default: true)
@@ -410,31 +422,19 @@ declare function useKycOverview(client: KycClient, options?: UseKycOverviewOptio
410
422
  *
411
423
  * @example
412
424
  * ```tsx
413
- * function PreferencesForm() {
414
- * const { preferences, loading, updatePreferences, refresh } = useKycPreferences(client);
415
- *
416
- * const handleUpdate = async (e: FormEvent) => {
417
- * e.preventDefault();
418
- * await updatePreferences({
419
- * is_face_verification_required: true,
420
- * required_document_count: 2
421
- * });
422
- * };
425
+ * function PreferencesSummary() {
426
+ * const { preferences, loading, refresh } = useKycPreferences(client);
423
427
  *
424
428
  * if (loading) return <Spinner />;
425
429
  *
426
430
  * return (
427
- * <form onSubmit={handleUpdate}>
428
- * <Checkbox
429
- * label="Require Face Verification"
430
- * checked={preferences?.is_face_verification_required}
431
- * />
432
- * <NumberInput
433
- * label="Required Documents"
434
- * value={preferences?.required_document_count}
435
- * />
436
- * <Button type="submit">Save</Button>
437
- * </form>
431
+ * <dl>
432
+ * <dt>Face verification required</dt>
433
+ * <dd>{String(preferences?.is_face_verification_required)}</dd>
434
+ * <dt>Required documents</dt>
435
+ * <dd>{preferences?.required_document_count}</dd>
436
+ * <button onClick={refresh}>Refresh</button>
437
+ * </dl>
438
438
  * );
439
439
  * }
440
440
  * ```
@@ -511,6 +511,56 @@ declare function getStatusColor(status: string): string;
511
511
  * @returns CSS color class or hex color
512
512
  */
513
513
  declare function getRiskColor(risk: string): string;
514
+ /**
515
+ * Detect whether the current browser is a mobile device. The check is
516
+ * deliberately conservative — anything that doesn't match the mobile
517
+ * pattern is treated as desktop and gets the QR handoff flow.
518
+ *
519
+ * Server-side device detection is intentionally absent; the SDK is the
520
+ * authority on UX selection.
521
+ */
522
+ declare function isMobileDevice(userAgent?: string): boolean;
523
+ /**
524
+ * Build the opaque QR payload a desktop client renders for the mobile
525
+ * device to scan. Format matches the normal-KYC mobile-handoff scheme so
526
+ * a single mobile app can handle both flows.
527
+ */
528
+ declare function buildEventBasedFaceVerificationQrPayload(token: string): string;
529
+ /**
530
+ * Options for `verifyFace` / `runFlow`. Mirrors `FaceCaptureModalProps`.
531
+ *
532
+ * - `defaultDevice` — `'ask'` (default on desktop) shows the device
533
+ * picker; `'this'` skips straight to capture; `'mobile'` skips
534
+ * straight to the QR handoff. Default on mobile is `'this'`. Ignored
535
+ * when the session carries a `verification_url` (hosted journey).
536
+ * - `renderQR` — bring-your-own QR renderer. Default uses a public QR
537
+ * rendering service.
538
+ * - `onCancel` — fires when the user dismisses the modal without
539
+ * reaching a terminal verification result (cancel button or close
540
+ * icon). The verifyFace promise still resolves with `null` for the
541
+ * same case, so this callback is purely a side-effect hook.
542
+ * - `mediapipeAssetBasePath` — self-hosted base URL for the
543
+ * face-detection assets. Defaults to a public CDN; set when a strict
544
+ * CSP blocks it.
545
+ */
546
+ interface VerifyFaceOptions {
547
+ defaultDevice?: 'ask' | 'this' | 'mobile';
548
+ renderQR?: (payload: string) => React.ReactNode;
549
+ onCancel?: () => void;
550
+ mediapipeAssetBasePath?: string;
551
+ }
552
+ /** Discriminated result of `runFlow`. */
553
+ type RunFlowResult = {
554
+ kind: 'not_required';
555
+ session: CreateEventBasedFaceVerificationSessionResponse;
556
+ } | {
557
+ kind: 'cancelled';
558
+ session: CreateEventBasedFaceVerificationSessionResponse;
559
+ } | {
560
+ kind: 'completed';
561
+ session: CreateEventBasedFaceVerificationSessionResponse;
562
+ result: EventBasedFaceVerificationCallback;
563
+ };
514
564
  /**
515
565
  * Hook for the Event-Based Face Verification face-capture flow.
516
566
  *
@@ -530,28 +580,56 @@ declare function getRiskColor(risk: string): string;
530
580
  */
531
581
  declare function useEventBasedFaceVerificationSubmission(client: KycClient): {
532
582
  startSession: (request: CreateEventBasedFaceVerificationSessionRequest) => Promise<CreateEventBasedFaceVerificationSessionResponse>;
533
- verifyFace: (session: CreateEventBasedFaceVerificationSessionResponse, opts?: {
534
- defaultDevice?: "ask" | "this" | "mobile";
535
- renderQR?: (payload: string) => React.ReactNode;
536
- onCancel?: () => void;
537
- mediapipeAssetBasePath?: string;
538
- }) => Promise<EventBasedFaceVerificationCallback | null>;
539
- runFlow: (request: CreateEventBasedFaceVerificationSessionRequest, opts?: {
540
- defaultDevice?: "ask" | "this" | "mobile";
541
- renderQR?: (payload: string) => React.ReactNode;
542
- onCancel?: () => void;
543
- mediapipeAssetBasePath?: string;
544
- }) => Promise<{
545
- kind: "not_required";
546
- session: CreateEventBasedFaceVerificationSessionResponse;
547
- } | {
548
- kind: "cancelled";
549
- session: CreateEventBasedFaceVerificationSessionResponse;
550
- } | {
551
- kind: "completed";
552
- session: CreateEventBasedFaceVerificationSessionResponse;
553
- result: EventBasedFaceVerificationCallback;
554
- }>;
583
+ verifyFace: (session: CreateEventBasedFaceVerificationSessionResponse, opts?: VerifyFaceOptions) => Promise<EventBasedFaceVerificationCallback | null>;
584
+ runFlow: (request: CreateEventBasedFaceVerificationSessionRequest, opts?: VerifyFaceOptions) => Promise<RunFlowResult>;
555
585
  };
556
586
 
557
- export { type UseCustomerProfileOptions, type UseCustomerProfileResult, UseGeolocationOptions, UseGeolocationResult, UseKycAlertsOptions, UseKycAlertsResult, UseKycOverviewOptions, UseKycOverviewResult, UseKycPreferencesResult, UseKycRequestsOptions, UseKycRequestsResult, UseKycSubmissionOptions, UseKycSubmissionResult, UseLocationCaptureOptions, UseLocationCaptureResult, UseLocationRequestsOptions, UseLocationRequestsResult, type UseLoginVerificationOptions, type UseLoginVerificationResult, type UseRegistrationOptions, type UseRegistrationResult, type UseTransactionVerificationOptions, type UseTransactionVerificationResult, createDeviceFingerprint, fileToBase64, formatKycStatus, getBrowserInfo, getRiskColor, getStatusColor, isValidFileSize, isValidFileType, useCipherText, useCustomerProfile, useEventBasedFaceVerificationSubmission, useGeolocation, useKycAlerts, useKycOverview, useKycPreferences, useKycRequests, useKycSubmission, useLocationCapture, useLocationRequests, useLoginVerification, useRegistration, useTransactionVerification };
587
+ interface FaceCaptureModalProps {
588
+ client: KycClient;
589
+ session: CreateEventBasedFaceVerificationSessionResponse;
590
+ onComplete: (result: EventBasedFaceVerificationCallback | null) => void;
591
+ /**
592
+ * Optional callback fired when the user dismisses the modal **without
593
+ * reaching a terminal verification result** — i.e., they click Cancel
594
+ * in a pre-result stage (choose / qr / capture / error) or close it
595
+ * via the header close button before the provider returns a final outcome.
596
+ *
597
+ * Fires BEFORE `onComplete(null)` so consumers can run cancel-only
598
+ * logic (analytics, "are you sure?" recovery, etc.) without inspecting
599
+ * the result parameter.
600
+ *
601
+ * NOT fired when the modal closes after a terminal result has been
602
+ * shown (accepted / declined / max_attempts) — `onComplete(result)`
603
+ * with the full payload is the right signal for those cases.
604
+ *
605
+ * `onComplete(null)` still fires unconditionally for backwards
606
+ * compatibility with existing integrations that detect cancellation
607
+ * by checking `result === null`.
608
+ */
609
+ onCancel?: () => void;
610
+ /**
611
+ * Initial UX. `'ask'` shows the device picker (default on desktop).
612
+ * `'this'` skips straight to capture (default on mobile). `'mobile'`
613
+ * skips straight to QR.
614
+ */
615
+ defaultDevice?: "ask" | "this" | "mobile";
616
+ /**
617
+ * Override the default QR renderer. Receives the payload string and
618
+ * returns a React node to render inside the QR slot. Default uses a
619
+ * public QR rendering service (api.qrserver.com).
620
+ */
621
+ renderQR?: (payload: string) => React$1.ReactNode;
622
+ /**
623
+ * Base URL the MediaPipe face-detection assets (face_detection.js +
624
+ * companion .wasm/.data/.binarypb files) are loaded from. Defaults to
625
+ * the jsDelivr CDN. Set this if your CSP blocks jsdelivr.net: self-host
626
+ * the contents of the @mediapipe/face_detection npm package and point
627
+ * this at them (e.g. "/mediapipe/face_detection"). If the assets can't
628
+ * be loaded, the modal falls back to manual capture without detection
629
+ * guidance — the user is never locked out.
630
+ */
631
+ mediapipeAssetBasePath?: string;
632
+ }
633
+ declare function FaceCaptureModal({ client, session, onComplete, onCancel, defaultDevice, renderQR, mediapipeAssetBasePath, }: Readonly<FaceCaptureModalProps>): React$1.ReactElement;
634
+
635
+ export { FaceCaptureModal, type FaceCaptureModalProps, type RunFlowResult, type UseCustomerProfileOptions, type UseCustomerProfileResult, UseGeolocationOptions, UseGeolocationResult, UseKycAlertsOptions, UseKycAlertsResult, UseKycOverviewOptions, UseKycOverviewResult, UseKycPreferencesResult, UseKycRequestsOptions, UseKycRequestsResult, UseKycSubmissionOptions, UseKycSubmissionResult, UseLocationCaptureOptions, UseLocationCaptureResult, UseLocationRequestsOptions, UseLocationRequestsResult, type UseLoginVerificationOptions, type UseLoginVerificationResult, type UseRegistrationOptions, type UseRegistrationResult, type UseTransactionVerificationOptions, type UseTransactionVerificationResult, type VerifyFaceOptions, buildEventBasedFaceVerificationQrPayload, createDeviceFingerprint, fileToBase64, formatKycStatus, getBrowserInfo, getRiskColor, getStatusColor, isMobileDevice, isValidFileSize, isValidFileType, useCipherText, useCustomerProfile, useEventBasedFaceVerificationSubmission, useGeolocation, useKycAlerts, useKycOverview, useKycPreferences, useKycRequests, useKycSubmission, useLocationCapture, useLocationRequests, useLoginVerification, useRegistration, useTransactionVerification };
package/dist/react.d.ts CHANGED
@@ -1,8 +1,9 @@
1
- import { D as DeviceFingerprintRequest, G as GeolocationClient, i as CipherTextOptions, l as CipherTextResult, Y as UseGeolocationOptions, Z as UseGeolocationResult, _ as UseLocationCaptureOptions, $ as UseLocationCaptureResult, a0 as UseLocationRequestsOptions, a1 as UseLocationRequestsResult } from './client-fy3trF2K.js';
2
- import { e as LoginVerificationResponse, L as LoginVerificationRequest, f as RegistrationVerificationResponse, R as RegistrationVerificationRequest, h as TransactionVerificationResponse, g as TransactionVerificationRequest, C as ComplianceClient } from './client-B3DCAHlg.js';
1
+ import { D as DeviceFingerprintRequest, G as GeolocationClient, i as CipherTextOptions, l as CipherTextResult, Y as UseGeolocationOptions, Z as UseGeolocationResult, _ as UseLocationCaptureOptions, $ as UseLocationCaptureResult, a0 as UseLocationRequestsOptions, a1 as UseLocationRequestsResult } from './client-BaUekQT8.js';
2
+ import { e as LoginVerificationResponse, L as LoginVerificationRequest, f as RegistrationVerificationResponse, R as RegistrationVerificationRequest, h as TransactionVerificationResponse, g as TransactionVerificationRequest, C as ComplianceClient } from './client-DUHC-68_.js';
3
3
  import { RiskProfileClient } from './risk-profile/index.js';
4
4
  import { C as CustomerProfile } from './types-UGyDl1fd.js';
5
- import { KycClient, CreateEventBasedFaceVerificationSessionRequest, CreateEventBasedFaceVerificationSessionResponse, EventBasedFaceVerificationCallback, UseKycAlertsOptions, UseKycAlertsResult, UseKycOverviewOptions, UseKycOverviewResult, UseKycPreferencesResult, UseKycRequestsOptions, UseKycRequestsResult, UseKycSubmissionOptions, UseKycSubmissionResult } from './kyc/index.js';
5
+ import { CreateEventBasedFaceVerificationSessionResponse, EventBasedFaceVerificationCallback, KycClient, CreateEventBasedFaceVerificationSessionRequest, UseKycAlertsOptions, UseKycAlertsResult, UseKycOverviewOptions, UseKycOverviewResult, UseKycPreferencesResult, UseKycRequestsOptions, UseKycRequestsResult, UseKycSubmissionOptions, UseKycSubmissionResult } from './kyc/index.js';
6
+ import React$1 from 'react';
6
7
  import './client-q9fN8Hhf.js';
7
8
  import './types-CBQRNL-l.js';
8
9
 
@@ -63,6 +64,12 @@ declare function createDeviceFingerprint(): DeviceFingerprintRequest;
63
64
  /**
64
65
  * React hook for generating cipherText
65
66
  *
67
+ * The tenant's GPS requirements are read from the client before each generation.
68
+ * The client reuses a fetched copy for a short period, so this does not add a
69
+ * request per event, and a requirement changed in the compliance console takes
70
+ * effect without reloading the page. Call `refreshConfig` to apply a change
71
+ * immediately.
72
+ *
66
73
  * @example
67
74
  * ```tsx
68
75
  * function LoginForm() {
@@ -79,6 +86,7 @@ declare function createDeviceFingerprint(): DeviceFingerprintRequest;
79
86
  */
80
87
  declare function useCipherText(client?: GeolocationClient): {
81
88
  generate: (options: CipherTextOptions) => Promise<CipherTextResult | null>;
89
+ refreshConfig: () => Promise<void>;
82
90
  configLoading: boolean;
83
91
  configError: Error | null;
84
92
  };
@@ -402,7 +410,11 @@ declare function useKycAlerts(client: KycClient, options?: UseKycAlertsOptions):
402
410
  */
403
411
  declare function useKycOverview(client: KycClient, options?: UseKycOverviewOptions): UseKycOverviewResult;
404
412
  /**
405
- * React hook for managing KYC preferences
413
+ * React hook for reading KYC preferences
414
+ *
415
+ * Preferences are managed in the Vesant console. The returned
416
+ * `updatePreferences` is deprecated: the platform exposes no update
417
+ * operation, so it always fails.
406
418
  *
407
419
  * @param client - KycClient instance
408
420
  * @param autoFetch - Auto-fetch preferences on mount (default: true)
@@ -410,31 +422,19 @@ declare function useKycOverview(client: KycClient, options?: UseKycOverviewOptio
410
422
  *
411
423
  * @example
412
424
  * ```tsx
413
- * function PreferencesForm() {
414
- * const { preferences, loading, updatePreferences, refresh } = useKycPreferences(client);
415
- *
416
- * const handleUpdate = async (e: FormEvent) => {
417
- * e.preventDefault();
418
- * await updatePreferences({
419
- * is_face_verification_required: true,
420
- * required_document_count: 2
421
- * });
422
- * };
425
+ * function PreferencesSummary() {
426
+ * const { preferences, loading, refresh } = useKycPreferences(client);
423
427
  *
424
428
  * if (loading) return <Spinner />;
425
429
  *
426
430
  * return (
427
- * <form onSubmit={handleUpdate}>
428
- * <Checkbox
429
- * label="Require Face Verification"
430
- * checked={preferences?.is_face_verification_required}
431
- * />
432
- * <NumberInput
433
- * label="Required Documents"
434
- * value={preferences?.required_document_count}
435
- * />
436
- * <Button type="submit">Save</Button>
437
- * </form>
431
+ * <dl>
432
+ * <dt>Face verification required</dt>
433
+ * <dd>{String(preferences?.is_face_verification_required)}</dd>
434
+ * <dt>Required documents</dt>
435
+ * <dd>{preferences?.required_document_count}</dd>
436
+ * <button onClick={refresh}>Refresh</button>
437
+ * </dl>
438
438
  * );
439
439
  * }
440
440
  * ```
@@ -511,6 +511,56 @@ declare function getStatusColor(status: string): string;
511
511
  * @returns CSS color class or hex color
512
512
  */
513
513
  declare function getRiskColor(risk: string): string;
514
+ /**
515
+ * Detect whether the current browser is a mobile device. The check is
516
+ * deliberately conservative — anything that doesn't match the mobile
517
+ * pattern is treated as desktop and gets the QR handoff flow.
518
+ *
519
+ * Server-side device detection is intentionally absent; the SDK is the
520
+ * authority on UX selection.
521
+ */
522
+ declare function isMobileDevice(userAgent?: string): boolean;
523
+ /**
524
+ * Build the opaque QR payload a desktop client renders for the mobile
525
+ * device to scan. Format matches the normal-KYC mobile-handoff scheme so
526
+ * a single mobile app can handle both flows.
527
+ */
528
+ declare function buildEventBasedFaceVerificationQrPayload(token: string): string;
529
+ /**
530
+ * Options for `verifyFace` / `runFlow`. Mirrors `FaceCaptureModalProps`.
531
+ *
532
+ * - `defaultDevice` — `'ask'` (default on desktop) shows the device
533
+ * picker; `'this'` skips straight to capture; `'mobile'` skips
534
+ * straight to the QR handoff. Default on mobile is `'this'`. Ignored
535
+ * when the session carries a `verification_url` (hosted journey).
536
+ * - `renderQR` — bring-your-own QR renderer. Default uses a public QR
537
+ * rendering service.
538
+ * - `onCancel` — fires when the user dismisses the modal without
539
+ * reaching a terminal verification result (cancel button or close
540
+ * icon). The verifyFace promise still resolves with `null` for the
541
+ * same case, so this callback is purely a side-effect hook.
542
+ * - `mediapipeAssetBasePath` — self-hosted base URL for the
543
+ * face-detection assets. Defaults to a public CDN; set when a strict
544
+ * CSP blocks it.
545
+ */
546
+ interface VerifyFaceOptions {
547
+ defaultDevice?: 'ask' | 'this' | 'mobile';
548
+ renderQR?: (payload: string) => React.ReactNode;
549
+ onCancel?: () => void;
550
+ mediapipeAssetBasePath?: string;
551
+ }
552
+ /** Discriminated result of `runFlow`. */
553
+ type RunFlowResult = {
554
+ kind: 'not_required';
555
+ session: CreateEventBasedFaceVerificationSessionResponse;
556
+ } | {
557
+ kind: 'cancelled';
558
+ session: CreateEventBasedFaceVerificationSessionResponse;
559
+ } | {
560
+ kind: 'completed';
561
+ session: CreateEventBasedFaceVerificationSessionResponse;
562
+ result: EventBasedFaceVerificationCallback;
563
+ };
514
564
  /**
515
565
  * Hook for the Event-Based Face Verification face-capture flow.
516
566
  *
@@ -530,28 +580,56 @@ declare function getRiskColor(risk: string): string;
530
580
  */
531
581
  declare function useEventBasedFaceVerificationSubmission(client: KycClient): {
532
582
  startSession: (request: CreateEventBasedFaceVerificationSessionRequest) => Promise<CreateEventBasedFaceVerificationSessionResponse>;
533
- verifyFace: (session: CreateEventBasedFaceVerificationSessionResponse, opts?: {
534
- defaultDevice?: "ask" | "this" | "mobile";
535
- renderQR?: (payload: string) => React.ReactNode;
536
- onCancel?: () => void;
537
- mediapipeAssetBasePath?: string;
538
- }) => Promise<EventBasedFaceVerificationCallback | null>;
539
- runFlow: (request: CreateEventBasedFaceVerificationSessionRequest, opts?: {
540
- defaultDevice?: "ask" | "this" | "mobile";
541
- renderQR?: (payload: string) => React.ReactNode;
542
- onCancel?: () => void;
543
- mediapipeAssetBasePath?: string;
544
- }) => Promise<{
545
- kind: "not_required";
546
- session: CreateEventBasedFaceVerificationSessionResponse;
547
- } | {
548
- kind: "cancelled";
549
- session: CreateEventBasedFaceVerificationSessionResponse;
550
- } | {
551
- kind: "completed";
552
- session: CreateEventBasedFaceVerificationSessionResponse;
553
- result: EventBasedFaceVerificationCallback;
554
- }>;
583
+ verifyFace: (session: CreateEventBasedFaceVerificationSessionResponse, opts?: VerifyFaceOptions) => Promise<EventBasedFaceVerificationCallback | null>;
584
+ runFlow: (request: CreateEventBasedFaceVerificationSessionRequest, opts?: VerifyFaceOptions) => Promise<RunFlowResult>;
555
585
  };
556
586
 
557
- export { type UseCustomerProfileOptions, type UseCustomerProfileResult, UseGeolocationOptions, UseGeolocationResult, UseKycAlertsOptions, UseKycAlertsResult, UseKycOverviewOptions, UseKycOverviewResult, UseKycPreferencesResult, UseKycRequestsOptions, UseKycRequestsResult, UseKycSubmissionOptions, UseKycSubmissionResult, UseLocationCaptureOptions, UseLocationCaptureResult, UseLocationRequestsOptions, UseLocationRequestsResult, type UseLoginVerificationOptions, type UseLoginVerificationResult, type UseRegistrationOptions, type UseRegistrationResult, type UseTransactionVerificationOptions, type UseTransactionVerificationResult, createDeviceFingerprint, fileToBase64, formatKycStatus, getBrowserInfo, getRiskColor, getStatusColor, isValidFileSize, isValidFileType, useCipherText, useCustomerProfile, useEventBasedFaceVerificationSubmission, useGeolocation, useKycAlerts, useKycOverview, useKycPreferences, useKycRequests, useKycSubmission, useLocationCapture, useLocationRequests, useLoginVerification, useRegistration, useTransactionVerification };
587
+ interface FaceCaptureModalProps {
588
+ client: KycClient;
589
+ session: CreateEventBasedFaceVerificationSessionResponse;
590
+ onComplete: (result: EventBasedFaceVerificationCallback | null) => void;
591
+ /**
592
+ * Optional callback fired when the user dismisses the modal **without
593
+ * reaching a terminal verification result** — i.e., they click Cancel
594
+ * in a pre-result stage (choose / qr / capture / error) or close it
595
+ * via the header close button before the provider returns a final outcome.
596
+ *
597
+ * Fires BEFORE `onComplete(null)` so consumers can run cancel-only
598
+ * logic (analytics, "are you sure?" recovery, etc.) without inspecting
599
+ * the result parameter.
600
+ *
601
+ * NOT fired when the modal closes after a terminal result has been
602
+ * shown (accepted / declined / max_attempts) — `onComplete(result)`
603
+ * with the full payload is the right signal for those cases.
604
+ *
605
+ * `onComplete(null)` still fires unconditionally for backwards
606
+ * compatibility with existing integrations that detect cancellation
607
+ * by checking `result === null`.
608
+ */
609
+ onCancel?: () => void;
610
+ /**
611
+ * Initial UX. `'ask'` shows the device picker (default on desktop).
612
+ * `'this'` skips straight to capture (default on mobile). `'mobile'`
613
+ * skips straight to QR.
614
+ */
615
+ defaultDevice?: "ask" | "this" | "mobile";
616
+ /**
617
+ * Override the default QR renderer. Receives the payload string and
618
+ * returns a React node to render inside the QR slot. Default uses a
619
+ * public QR rendering service (api.qrserver.com).
620
+ */
621
+ renderQR?: (payload: string) => React$1.ReactNode;
622
+ /**
623
+ * Base URL the MediaPipe face-detection assets (face_detection.js +
624
+ * companion .wasm/.data/.binarypb files) are loaded from. Defaults to
625
+ * the jsDelivr CDN. Set this if your CSP blocks jsdelivr.net: self-host
626
+ * the contents of the @mediapipe/face_detection npm package and point
627
+ * this at them (e.g. "/mediapipe/face_detection"). If the assets can't
628
+ * be loaded, the modal falls back to manual capture without detection
629
+ * guidance — the user is never locked out.
630
+ */
631
+ mediapipeAssetBasePath?: string;
632
+ }
633
+ declare function FaceCaptureModal({ client, session, onComplete, onCancel, defaultDevice, renderQR, mediapipeAssetBasePath, }: Readonly<FaceCaptureModalProps>): React$1.ReactElement;
634
+
635
+ export { FaceCaptureModal, type FaceCaptureModalProps, type RunFlowResult, type UseCustomerProfileOptions, type UseCustomerProfileResult, UseGeolocationOptions, UseGeolocationResult, UseKycAlertsOptions, UseKycAlertsResult, UseKycOverviewOptions, UseKycOverviewResult, UseKycPreferencesResult, UseKycRequestsOptions, UseKycRequestsResult, UseKycSubmissionOptions, UseKycSubmissionResult, UseLocationCaptureOptions, UseLocationCaptureResult, UseLocationRequestsOptions, UseLocationRequestsResult, type UseLoginVerificationOptions, type UseLoginVerificationResult, type UseRegistrationOptions, type UseRegistrationResult, type UseTransactionVerificationOptions, type UseTransactionVerificationResult, type VerifyFaceOptions, buildEventBasedFaceVerificationQrPayload, createDeviceFingerprint, fileToBase64, formatKycStatus, getBrowserInfo, getRiskColor, getStatusColor, isMobileDevice, isValidFileSize, isValidFileType, useCipherText, useCustomerProfile, useEventBasedFaceVerificationSubmission, useGeolocation, useKycAlerts, useKycOverview, useKycPreferences, useKycRequests, useKycSubmission, useLocationCapture, useLocationRequests, useLoginVerification, useRegistration, useTransactionVerification };