vesant-sdk 1.7.2-dev.617dd44 → 1.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +74 -29
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +74 -30
- package/dist/index.mjs.map +1 -1
- package/dist/kyc/core.d.mts +1 -1
- package/dist/kyc/core.d.ts +1 -1
- package/dist/kyc/core.js +74 -29
- package/dist/kyc/core.js.map +1 -1
- package/dist/kyc/core.mjs +74 -30
- package/dist/kyc/core.mjs.map +1 -1
- package/dist/kyc/index.d.mts +334 -65
- package/dist/kyc/index.d.ts +334 -65
- package/dist/kyc/index.js +74 -29
- package/dist/kyc/index.js.map +1 -1
- package/dist/kyc/index.mjs +74 -30
- package/dist/kyc/index.mjs.map +1 -1
- package/dist/react.d.mts +117 -46
- package/dist/react.d.ts +117 -46
- package/dist/react.js +243 -26
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +241 -27
- package/dist/react.mjs.map +1 -1
- package/package.json +1 -1
package/dist/react.d.mts
CHANGED
|
@@ -2,7 +2,8 @@ import { D as DeviceFingerprintRequest, G as GeolocationClient, i as CipherTextO
|
|
|
2
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';
|
|
3
3
|
import { RiskProfileClient } from './risk-profile/index.mjs';
|
|
4
4
|
import { C as CustomerProfile } from './types-BOFaMQxI.mjs';
|
|
5
|
-
import {
|
|
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
|
|
|
@@ -402,7 +403,11 @@ declare function useKycAlerts(client: KycClient, options?: UseKycAlertsOptions):
|
|
|
402
403
|
*/
|
|
403
404
|
declare function useKycOverview(client: KycClient, options?: UseKycOverviewOptions): UseKycOverviewResult;
|
|
404
405
|
/**
|
|
405
|
-
* React hook for
|
|
406
|
+
* React hook for reading KYC preferences
|
|
407
|
+
*
|
|
408
|
+
* Preferences are managed in the Vesant console. The returned
|
|
409
|
+
* `updatePreferences` is deprecated: the platform exposes no update
|
|
410
|
+
* operation, so it always fails.
|
|
406
411
|
*
|
|
407
412
|
* @param client - KycClient instance
|
|
408
413
|
* @param autoFetch - Auto-fetch preferences on mount (default: true)
|
|
@@ -410,31 +415,19 @@ declare function useKycOverview(client: KycClient, options?: UseKycOverviewOptio
|
|
|
410
415
|
*
|
|
411
416
|
* @example
|
|
412
417
|
* ```tsx
|
|
413
|
-
* function
|
|
414
|
-
* const { preferences, loading,
|
|
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
|
-
* };
|
|
418
|
+
* function PreferencesSummary() {
|
|
419
|
+
* const { preferences, loading, refresh } = useKycPreferences(client);
|
|
423
420
|
*
|
|
424
421
|
* if (loading) return <Spinner />;
|
|
425
422
|
*
|
|
426
423
|
* return (
|
|
427
|
-
* <
|
|
428
|
-
* <
|
|
429
|
-
*
|
|
430
|
-
*
|
|
431
|
-
*
|
|
432
|
-
* <
|
|
433
|
-
*
|
|
434
|
-
* value={preferences?.required_document_count}
|
|
435
|
-
* />
|
|
436
|
-
* <Button type="submit">Save</Button>
|
|
437
|
-
* </form>
|
|
424
|
+
* <dl>
|
|
425
|
+
* <dt>Face verification required</dt>
|
|
426
|
+
* <dd>{String(preferences?.is_face_verification_required)}</dd>
|
|
427
|
+
* <dt>Required documents</dt>
|
|
428
|
+
* <dd>{preferences?.required_document_count}</dd>
|
|
429
|
+
* <button onClick={refresh}>Refresh</button>
|
|
430
|
+
* </dl>
|
|
438
431
|
* );
|
|
439
432
|
* }
|
|
440
433
|
* ```
|
|
@@ -511,6 +504,56 @@ declare function getStatusColor(status: string): string;
|
|
|
511
504
|
* @returns CSS color class or hex color
|
|
512
505
|
*/
|
|
513
506
|
declare function getRiskColor(risk: string): string;
|
|
507
|
+
/**
|
|
508
|
+
* Detect whether the current browser is a mobile device. The check is
|
|
509
|
+
* deliberately conservative — anything that doesn't match the mobile
|
|
510
|
+
* pattern is treated as desktop and gets the QR handoff flow.
|
|
511
|
+
*
|
|
512
|
+
* Server-side device detection is intentionally absent; the SDK is the
|
|
513
|
+
* authority on UX selection.
|
|
514
|
+
*/
|
|
515
|
+
declare function isMobileDevice(userAgent?: string): boolean;
|
|
516
|
+
/**
|
|
517
|
+
* Build the opaque QR payload a desktop client renders for the mobile
|
|
518
|
+
* device to scan. Format matches the normal-KYC mobile-handoff scheme so
|
|
519
|
+
* a single mobile app can handle both flows.
|
|
520
|
+
*/
|
|
521
|
+
declare function buildEventBasedFaceVerificationQrPayload(token: string): string;
|
|
522
|
+
/**
|
|
523
|
+
* Options for `verifyFace` / `runFlow`. Mirrors `FaceCaptureModalProps`.
|
|
524
|
+
*
|
|
525
|
+
* - `defaultDevice` — `'ask'` (default on desktop) shows the device
|
|
526
|
+
* picker; `'this'` skips straight to capture; `'mobile'` skips
|
|
527
|
+
* straight to the QR handoff. Default on mobile is `'this'`. Ignored
|
|
528
|
+
* when the session carries a `verification_url` (hosted journey).
|
|
529
|
+
* - `renderQR` — bring-your-own QR renderer. Default uses a public QR
|
|
530
|
+
* rendering service.
|
|
531
|
+
* - `onCancel` — fires when the user dismisses the modal without
|
|
532
|
+
* reaching a terminal verification result (cancel button or close
|
|
533
|
+
* icon). The verifyFace promise still resolves with `null` for the
|
|
534
|
+
* same case, so this callback is purely a side-effect hook.
|
|
535
|
+
* - `mediapipeAssetBasePath` — self-hosted base URL for the
|
|
536
|
+
* face-detection assets. Defaults to a public CDN; set when a strict
|
|
537
|
+
* CSP blocks it.
|
|
538
|
+
*/
|
|
539
|
+
interface VerifyFaceOptions {
|
|
540
|
+
defaultDevice?: 'ask' | 'this' | 'mobile';
|
|
541
|
+
renderQR?: (payload: string) => React.ReactNode;
|
|
542
|
+
onCancel?: () => void;
|
|
543
|
+
mediapipeAssetBasePath?: string;
|
|
544
|
+
}
|
|
545
|
+
/** Discriminated result of `runFlow`. */
|
|
546
|
+
type RunFlowResult = {
|
|
547
|
+
kind: 'not_required';
|
|
548
|
+
session: CreateEventBasedFaceVerificationSessionResponse;
|
|
549
|
+
} | {
|
|
550
|
+
kind: 'cancelled';
|
|
551
|
+
session: CreateEventBasedFaceVerificationSessionResponse;
|
|
552
|
+
} | {
|
|
553
|
+
kind: 'completed';
|
|
554
|
+
session: CreateEventBasedFaceVerificationSessionResponse;
|
|
555
|
+
result: EventBasedFaceVerificationCallback;
|
|
556
|
+
};
|
|
514
557
|
/**
|
|
515
558
|
* Hook for the Event-Based Face Verification face-capture flow.
|
|
516
559
|
*
|
|
@@ -530,28 +573,56 @@ declare function getRiskColor(risk: string): string;
|
|
|
530
573
|
*/
|
|
531
574
|
declare function useEventBasedFaceVerificationSubmission(client: KycClient): {
|
|
532
575
|
startSession: (request: CreateEventBasedFaceVerificationSessionRequest) => Promise<CreateEventBasedFaceVerificationSessionResponse>;
|
|
533
|
-
verifyFace: (session: CreateEventBasedFaceVerificationSessionResponse, opts?:
|
|
534
|
-
|
|
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
|
-
}>;
|
|
576
|
+
verifyFace: (session: CreateEventBasedFaceVerificationSessionResponse, opts?: VerifyFaceOptions) => Promise<EventBasedFaceVerificationCallback | null>;
|
|
577
|
+
runFlow: (request: CreateEventBasedFaceVerificationSessionRequest, opts?: VerifyFaceOptions) => Promise<RunFlowResult>;
|
|
555
578
|
};
|
|
556
579
|
|
|
557
|
-
|
|
580
|
+
interface FaceCaptureModalProps {
|
|
581
|
+
client: KycClient;
|
|
582
|
+
session: CreateEventBasedFaceVerificationSessionResponse;
|
|
583
|
+
onComplete: (result: EventBasedFaceVerificationCallback | null) => void;
|
|
584
|
+
/**
|
|
585
|
+
* Optional callback fired when the user dismisses the modal **without
|
|
586
|
+
* reaching a terminal verification result** — i.e., they click Cancel
|
|
587
|
+
* in a pre-result stage (choose / qr / capture / error) or close it
|
|
588
|
+
* via the header close button before the provider returns a final outcome.
|
|
589
|
+
*
|
|
590
|
+
* Fires BEFORE `onComplete(null)` so consumers can run cancel-only
|
|
591
|
+
* logic (analytics, "are you sure?" recovery, etc.) without inspecting
|
|
592
|
+
* the result parameter.
|
|
593
|
+
*
|
|
594
|
+
* NOT fired when the modal closes after a terminal result has been
|
|
595
|
+
* shown (accepted / declined / max_attempts) — `onComplete(result)`
|
|
596
|
+
* with the full payload is the right signal for those cases.
|
|
597
|
+
*
|
|
598
|
+
* `onComplete(null)` still fires unconditionally for backwards
|
|
599
|
+
* compatibility with existing integrations that detect cancellation
|
|
600
|
+
* by checking `result === null`.
|
|
601
|
+
*/
|
|
602
|
+
onCancel?: () => void;
|
|
603
|
+
/**
|
|
604
|
+
* Initial UX. `'ask'` shows the device picker (default on desktop).
|
|
605
|
+
* `'this'` skips straight to capture (default on mobile). `'mobile'`
|
|
606
|
+
* skips straight to QR.
|
|
607
|
+
*/
|
|
608
|
+
defaultDevice?: "ask" | "this" | "mobile";
|
|
609
|
+
/**
|
|
610
|
+
* Override the default QR renderer. Receives the payload string and
|
|
611
|
+
* returns a React node to render inside the QR slot. Default uses a
|
|
612
|
+
* public QR rendering service (api.qrserver.com).
|
|
613
|
+
*/
|
|
614
|
+
renderQR?: (payload: string) => React$1.ReactNode;
|
|
615
|
+
/**
|
|
616
|
+
* Base URL the MediaPipe face-detection assets (face_detection.js +
|
|
617
|
+
* companion .wasm/.data/.binarypb files) are loaded from. Defaults to
|
|
618
|
+
* the jsDelivr CDN. Set this if your CSP blocks jsdelivr.net: self-host
|
|
619
|
+
* the contents of the @mediapipe/face_detection npm package and point
|
|
620
|
+
* this at them (e.g. "/mediapipe/face_detection"). If the assets can't
|
|
621
|
+
* be loaded, the modal falls back to manual capture without detection
|
|
622
|
+
* guidance — the user is never locked out.
|
|
623
|
+
*/
|
|
624
|
+
mediapipeAssetBasePath?: string;
|
|
625
|
+
}
|
|
626
|
+
declare function FaceCaptureModal({ client, session, onComplete, onCancel, defaultDevice, renderQR, mediapipeAssetBasePath, }: Readonly<FaceCaptureModalProps>): React$1.ReactElement;
|
|
627
|
+
|
|
628
|
+
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
|
@@ -2,7 +2,8 @@ import { D as DeviceFingerprintRequest, G as GeolocationClient, i as CipherTextO
|
|
|
2
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';
|
|
3
3
|
import { RiskProfileClient } from './risk-profile/index.js';
|
|
4
4
|
import { C as CustomerProfile } from './types-UGyDl1fd.js';
|
|
5
|
-
import {
|
|
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
|
|
|
@@ -402,7 +403,11 @@ declare function useKycAlerts(client: KycClient, options?: UseKycAlertsOptions):
|
|
|
402
403
|
*/
|
|
403
404
|
declare function useKycOverview(client: KycClient, options?: UseKycOverviewOptions): UseKycOverviewResult;
|
|
404
405
|
/**
|
|
405
|
-
* React hook for
|
|
406
|
+
* React hook for reading KYC preferences
|
|
407
|
+
*
|
|
408
|
+
* Preferences are managed in the Vesant console. The returned
|
|
409
|
+
* `updatePreferences` is deprecated: the platform exposes no update
|
|
410
|
+
* operation, so it always fails.
|
|
406
411
|
*
|
|
407
412
|
* @param client - KycClient instance
|
|
408
413
|
* @param autoFetch - Auto-fetch preferences on mount (default: true)
|
|
@@ -410,31 +415,19 @@ declare function useKycOverview(client: KycClient, options?: UseKycOverviewOptio
|
|
|
410
415
|
*
|
|
411
416
|
* @example
|
|
412
417
|
* ```tsx
|
|
413
|
-
* function
|
|
414
|
-
* const { preferences, loading,
|
|
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
|
-
* };
|
|
418
|
+
* function PreferencesSummary() {
|
|
419
|
+
* const { preferences, loading, refresh } = useKycPreferences(client);
|
|
423
420
|
*
|
|
424
421
|
* if (loading) return <Spinner />;
|
|
425
422
|
*
|
|
426
423
|
* return (
|
|
427
|
-
* <
|
|
428
|
-
* <
|
|
429
|
-
*
|
|
430
|
-
*
|
|
431
|
-
*
|
|
432
|
-
* <
|
|
433
|
-
*
|
|
434
|
-
* value={preferences?.required_document_count}
|
|
435
|
-
* />
|
|
436
|
-
* <Button type="submit">Save</Button>
|
|
437
|
-
* </form>
|
|
424
|
+
* <dl>
|
|
425
|
+
* <dt>Face verification required</dt>
|
|
426
|
+
* <dd>{String(preferences?.is_face_verification_required)}</dd>
|
|
427
|
+
* <dt>Required documents</dt>
|
|
428
|
+
* <dd>{preferences?.required_document_count}</dd>
|
|
429
|
+
* <button onClick={refresh}>Refresh</button>
|
|
430
|
+
* </dl>
|
|
438
431
|
* );
|
|
439
432
|
* }
|
|
440
433
|
* ```
|
|
@@ -511,6 +504,56 @@ declare function getStatusColor(status: string): string;
|
|
|
511
504
|
* @returns CSS color class or hex color
|
|
512
505
|
*/
|
|
513
506
|
declare function getRiskColor(risk: string): string;
|
|
507
|
+
/**
|
|
508
|
+
* Detect whether the current browser is a mobile device. The check is
|
|
509
|
+
* deliberately conservative — anything that doesn't match the mobile
|
|
510
|
+
* pattern is treated as desktop and gets the QR handoff flow.
|
|
511
|
+
*
|
|
512
|
+
* Server-side device detection is intentionally absent; the SDK is the
|
|
513
|
+
* authority on UX selection.
|
|
514
|
+
*/
|
|
515
|
+
declare function isMobileDevice(userAgent?: string): boolean;
|
|
516
|
+
/**
|
|
517
|
+
* Build the opaque QR payload a desktop client renders for the mobile
|
|
518
|
+
* device to scan. Format matches the normal-KYC mobile-handoff scheme so
|
|
519
|
+
* a single mobile app can handle both flows.
|
|
520
|
+
*/
|
|
521
|
+
declare function buildEventBasedFaceVerificationQrPayload(token: string): string;
|
|
522
|
+
/**
|
|
523
|
+
* Options for `verifyFace` / `runFlow`. Mirrors `FaceCaptureModalProps`.
|
|
524
|
+
*
|
|
525
|
+
* - `defaultDevice` — `'ask'` (default on desktop) shows the device
|
|
526
|
+
* picker; `'this'` skips straight to capture; `'mobile'` skips
|
|
527
|
+
* straight to the QR handoff. Default on mobile is `'this'`. Ignored
|
|
528
|
+
* when the session carries a `verification_url` (hosted journey).
|
|
529
|
+
* - `renderQR` — bring-your-own QR renderer. Default uses a public QR
|
|
530
|
+
* rendering service.
|
|
531
|
+
* - `onCancel` — fires when the user dismisses the modal without
|
|
532
|
+
* reaching a terminal verification result (cancel button or close
|
|
533
|
+
* icon). The verifyFace promise still resolves with `null` for the
|
|
534
|
+
* same case, so this callback is purely a side-effect hook.
|
|
535
|
+
* - `mediapipeAssetBasePath` — self-hosted base URL for the
|
|
536
|
+
* face-detection assets. Defaults to a public CDN; set when a strict
|
|
537
|
+
* CSP blocks it.
|
|
538
|
+
*/
|
|
539
|
+
interface VerifyFaceOptions {
|
|
540
|
+
defaultDevice?: 'ask' | 'this' | 'mobile';
|
|
541
|
+
renderQR?: (payload: string) => React.ReactNode;
|
|
542
|
+
onCancel?: () => void;
|
|
543
|
+
mediapipeAssetBasePath?: string;
|
|
544
|
+
}
|
|
545
|
+
/** Discriminated result of `runFlow`. */
|
|
546
|
+
type RunFlowResult = {
|
|
547
|
+
kind: 'not_required';
|
|
548
|
+
session: CreateEventBasedFaceVerificationSessionResponse;
|
|
549
|
+
} | {
|
|
550
|
+
kind: 'cancelled';
|
|
551
|
+
session: CreateEventBasedFaceVerificationSessionResponse;
|
|
552
|
+
} | {
|
|
553
|
+
kind: 'completed';
|
|
554
|
+
session: CreateEventBasedFaceVerificationSessionResponse;
|
|
555
|
+
result: EventBasedFaceVerificationCallback;
|
|
556
|
+
};
|
|
514
557
|
/**
|
|
515
558
|
* Hook for the Event-Based Face Verification face-capture flow.
|
|
516
559
|
*
|
|
@@ -530,28 +573,56 @@ declare function getRiskColor(risk: string): string;
|
|
|
530
573
|
*/
|
|
531
574
|
declare function useEventBasedFaceVerificationSubmission(client: KycClient): {
|
|
532
575
|
startSession: (request: CreateEventBasedFaceVerificationSessionRequest) => Promise<CreateEventBasedFaceVerificationSessionResponse>;
|
|
533
|
-
verifyFace: (session: CreateEventBasedFaceVerificationSessionResponse, opts?:
|
|
534
|
-
|
|
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
|
-
}>;
|
|
576
|
+
verifyFace: (session: CreateEventBasedFaceVerificationSessionResponse, opts?: VerifyFaceOptions) => Promise<EventBasedFaceVerificationCallback | null>;
|
|
577
|
+
runFlow: (request: CreateEventBasedFaceVerificationSessionRequest, opts?: VerifyFaceOptions) => Promise<RunFlowResult>;
|
|
555
578
|
};
|
|
556
579
|
|
|
557
|
-
|
|
580
|
+
interface FaceCaptureModalProps {
|
|
581
|
+
client: KycClient;
|
|
582
|
+
session: CreateEventBasedFaceVerificationSessionResponse;
|
|
583
|
+
onComplete: (result: EventBasedFaceVerificationCallback | null) => void;
|
|
584
|
+
/**
|
|
585
|
+
* Optional callback fired when the user dismisses the modal **without
|
|
586
|
+
* reaching a terminal verification result** — i.e., they click Cancel
|
|
587
|
+
* in a pre-result stage (choose / qr / capture / error) or close it
|
|
588
|
+
* via the header close button before the provider returns a final outcome.
|
|
589
|
+
*
|
|
590
|
+
* Fires BEFORE `onComplete(null)` so consumers can run cancel-only
|
|
591
|
+
* logic (analytics, "are you sure?" recovery, etc.) without inspecting
|
|
592
|
+
* the result parameter.
|
|
593
|
+
*
|
|
594
|
+
* NOT fired when the modal closes after a terminal result has been
|
|
595
|
+
* shown (accepted / declined / max_attempts) — `onComplete(result)`
|
|
596
|
+
* with the full payload is the right signal for those cases.
|
|
597
|
+
*
|
|
598
|
+
* `onComplete(null)` still fires unconditionally for backwards
|
|
599
|
+
* compatibility with existing integrations that detect cancellation
|
|
600
|
+
* by checking `result === null`.
|
|
601
|
+
*/
|
|
602
|
+
onCancel?: () => void;
|
|
603
|
+
/**
|
|
604
|
+
* Initial UX. `'ask'` shows the device picker (default on desktop).
|
|
605
|
+
* `'this'` skips straight to capture (default on mobile). `'mobile'`
|
|
606
|
+
* skips straight to QR.
|
|
607
|
+
*/
|
|
608
|
+
defaultDevice?: "ask" | "this" | "mobile";
|
|
609
|
+
/**
|
|
610
|
+
* Override the default QR renderer. Receives the payload string and
|
|
611
|
+
* returns a React node to render inside the QR slot. Default uses a
|
|
612
|
+
* public QR rendering service (api.qrserver.com).
|
|
613
|
+
*/
|
|
614
|
+
renderQR?: (payload: string) => React$1.ReactNode;
|
|
615
|
+
/**
|
|
616
|
+
* Base URL the MediaPipe face-detection assets (face_detection.js +
|
|
617
|
+
* companion .wasm/.data/.binarypb files) are loaded from. Defaults to
|
|
618
|
+
* the jsDelivr CDN. Set this if your CSP blocks jsdelivr.net: self-host
|
|
619
|
+
* the contents of the @mediapipe/face_detection npm package and point
|
|
620
|
+
* this at them (e.g. "/mediapipe/face_detection"). If the assets can't
|
|
621
|
+
* be loaded, the modal falls back to manual capture without detection
|
|
622
|
+
* guidance — the user is never locked out.
|
|
623
|
+
*/
|
|
624
|
+
mediapipeAssetBasePath?: string;
|
|
625
|
+
}
|
|
626
|
+
declare function FaceCaptureModal({ client, session, onComplete, onCancel, defaultDevice, renderQR, mediapipeAssetBasePath, }: Readonly<FaceCaptureModalProps>): React$1.ReactElement;
|
|
627
|
+
|
|
628
|
+
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 };
|