vesant-sdk 1.7.1-dev.8d808aa → 1.7.1-dev.a461ee2
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/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +27 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +27 -8
- 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 +27 -7
- package/dist/kyc/core.js.map +1 -1
- package/dist/kyc/core.mjs +27 -8
- package/dist/kyc/core.mjs.map +1 -1
- package/dist/kyc/index.d.mts +130 -19
- package/dist/kyc/index.d.ts +130 -19
- package/dist/kyc/index.js +27 -7
- package/dist/kyc/index.js.map +1 -1
- package/dist/kyc/index.mjs +27 -8
- package/dist/kyc/index.mjs.map +1 -1
- package/dist/react.js +132 -24
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +132 -24
- package/dist/react.mjs.map +1 -1
- package/package.json +1 -1
package/dist/kyc/index.d.mts
CHANGED
|
@@ -315,6 +315,48 @@ interface UpdateKycStatusRequest {
|
|
|
315
315
|
/** Shufti warnings data */
|
|
316
316
|
warnings?: Record<string, Record<string, string>>;
|
|
317
317
|
}
|
|
318
|
+
/**
|
|
319
|
+
* Events that can trigger a KYC request. Each maps to a per-event toggle in
|
|
320
|
+
* the tenant's KYC verification trigger preferences, except `manual` (always
|
|
321
|
+
* required) and `login` (only for an expired identity document).
|
|
322
|
+
*/
|
|
323
|
+
type KycTriggerEvent = 'onboarding' | 'first_withdrawal' | 'first_purchase'
|
|
324
|
+
/** Aliases of `first_withdrawal` / `first_purchase` — same tenant toggles. */
|
|
325
|
+
| 'withdrawal' | 'purchase' | 'manual'
|
|
326
|
+
/**
|
|
327
|
+
* The customer is signing in. Answers for any state: never verified (asked,
|
|
328
|
+
* not skippable, per the tenant's onboarding policy), document expired
|
|
329
|
+
* (asked, skippable — "Remind me later"), or verified with a valid document
|
|
330
|
+
* (not asked). One call covers every customer.
|
|
331
|
+
*/
|
|
332
|
+
| 'login';
|
|
333
|
+
/**
|
|
334
|
+
* Why verification is — or is not — being asked for. Codes are stable;
|
|
335
|
+
* `message` is display-ready text you can show the customer as-is.
|
|
336
|
+
*/
|
|
337
|
+
interface KycRequestReason {
|
|
338
|
+
code: KycRequestReasonCode | (string & Record<string, never>);
|
|
339
|
+
message: string;
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* Reason codes returned by `requestKycSubmitLink`. Treat unrecognised codes
|
|
343
|
+
* as "verification required" and fall back to `message` for display.
|
|
344
|
+
*/
|
|
345
|
+
type KycRequestReasonCode =
|
|
346
|
+
/** Required to complete registration. */
|
|
347
|
+
'KYC_REQUIRED_ONBOARDING'
|
|
348
|
+
/** Required before the customer's first withdrawal. */
|
|
349
|
+
| 'KYC_REQUIRED_FIRST_WITHDRAWAL'
|
|
350
|
+
/** Required before the customer's first purchase. */
|
|
351
|
+
| 'KYC_REQUIRED_FIRST_PURCHASE'
|
|
352
|
+
/** The customer's identity document has expired and must be re-verified. */
|
|
353
|
+
| 'KYC_REQUIRED_ID_EXPIRED'
|
|
354
|
+
/** Verification was explicitly requested by the tenant. */
|
|
355
|
+
| 'KYC_REQUIRED_MANUAL'
|
|
356
|
+
/** Not required — the customer already has an accepted verification. */
|
|
357
|
+
| 'KYC_NOT_REQUIRED_ALREADY_VERIFIED'
|
|
358
|
+
/** Not required — the tenant has this trigger event switched off. */
|
|
359
|
+
| 'KYC_NOT_REQUIRED_TRIGGER_DISABLED';
|
|
318
360
|
interface RequestKycSubmitLinkRequest {
|
|
319
361
|
/** User ID to generate KYC submission link for */
|
|
320
362
|
user_id: string;
|
|
@@ -323,14 +365,20 @@ interface RequestKycSubmitLinkRequest {
|
|
|
323
365
|
/** URL to receive callback notifications via POST request when KYC status changes (optional) */
|
|
324
366
|
callback_url?: string;
|
|
325
367
|
/**
|
|
326
|
-
* Event that triggered the KYC request.
|
|
327
|
-
*
|
|
328
|
-
*
|
|
329
|
-
*
|
|
330
|
-
*
|
|
368
|
+
* Event that triggered the KYC request. The tenant's KYC verification
|
|
369
|
+
* trigger preferences decide, per event, whether KYC is required
|
|
370
|
+
* (`kyc_required` in the response). "manual" always requires KYC and
|
|
371
|
+
* honors the tenant's allow-skip-on-manual option (`can_skip`). "login"
|
|
372
|
+
* answers for any customer state — never verified (asked, not skippable),
|
|
373
|
+
* document expired (asked, skippable so you can offer "Remind me later"),
|
|
374
|
+
* or verified and valid (not asked) — so a platform that gates entry on KYC
|
|
375
|
+
* needs only this one call at sign-in. The same expired document is *not*
|
|
376
|
+
* skippable on withdrawal / purchase events: it is enforced on
|
|
377
|
+
* "first_withdrawal", "withdrawal", "first_purchase" and "purchase" alike,
|
|
378
|
+
* so keep sending whichever of those you already send.
|
|
331
379
|
* Omitted or unknown values default to KYC required with no skip.
|
|
332
380
|
*/
|
|
333
|
-
trigger_event?: string;
|
|
381
|
+
trigger_event?: KycTriggerEvent | (string & Record<string, never>);
|
|
334
382
|
/**
|
|
335
383
|
* Registered customer identity data (optional). Seeds the customer's risk
|
|
336
384
|
* profile so document verification can cross-check the submitted document
|
|
@@ -442,12 +490,57 @@ interface RequestKycSubmitLinkResponse {
|
|
|
442
490
|
*/
|
|
443
491
|
kyc_required: boolean;
|
|
444
492
|
/**
|
|
445
|
-
* Whether the user may skip verification.
|
|
493
|
+
* Whether the user may skip verification. `true` for
|
|
446
494
|
* `trigger_event: "manual"` when the tenant enables allow-skip-on-manual,
|
|
447
|
-
*
|
|
495
|
+
* for `"login"` when an expired identity document triggered the request
|
|
496
|
+
* (offer "Remind me later"), and when the customer is already verified.
|
|
497
|
+
* Always `false` at `"withdrawal"` / `"purchase"` — that is where a
|
|
498
|
+
* postponed re-verification becomes mandatory.
|
|
448
499
|
*/
|
|
449
500
|
can_skip: boolean;
|
|
501
|
+
/**
|
|
502
|
+
* Why verification is — or is not — being asked for. Use `reason.code` to
|
|
503
|
+
* branch (for example `KYC_REQUIRED_ID_EXPIRED` warrants a different prompt
|
|
504
|
+
* than a first-time verification) and `reason.message` for display.
|
|
505
|
+
*/
|
|
506
|
+
reason?: KycRequestReason;
|
|
450
507
|
}
|
|
508
|
+
/**
|
|
509
|
+
* Body POSTed to your `callback_url` when a customer's identity document
|
|
510
|
+
* passes its expiry date. Signed with `X-Webhook-Signature: sha256=<hex>`
|
|
511
|
+
* (HMAC-SHA256 of the raw body), like every other Vesant callback.
|
|
512
|
+
*
|
|
513
|
+
* An expiry happens on a **date**, not on a customer action, so this webhook
|
|
514
|
+
* is the only signal for it — nothing the customer does triggers it. Delivered
|
|
515
|
+
* once per customer, when the document first becomes expired.
|
|
516
|
+
*
|
|
517
|
+
* It is sent regardless of the tenant's auto-trigger-on-ID-expiration setting:
|
|
518
|
+
* that setting governs whether verification is *enforced*, not whether you are
|
|
519
|
+
* *told*.
|
|
520
|
+
*/
|
|
521
|
+
interface KycDocumentExpiredCallbackEvent {
|
|
522
|
+
/** Always `"kyc_document_expired"` — dispatch on this. */
|
|
523
|
+
event: 'kyc_document_expired';
|
|
524
|
+
/** Your customer identifier (the `user_id` you supplied). */
|
|
525
|
+
reference: string;
|
|
526
|
+
/** The customer's risk-profile ID. */
|
|
527
|
+
resource_id: string;
|
|
528
|
+
/**
|
|
529
|
+
* Always `"expired"`. Describes the document — not the customer's KYC
|
|
530
|
+
* status, which remains `accepted` until they re-verify.
|
|
531
|
+
*/
|
|
532
|
+
status: 'expired';
|
|
533
|
+
data: {
|
|
534
|
+
customer_id: string;
|
|
535
|
+
/** The document's expiry date (ISO 8601 `YYYY-MM-DD`). */
|
|
536
|
+
id_expiry_date: string;
|
|
537
|
+
};
|
|
538
|
+
}
|
|
539
|
+
/**
|
|
540
|
+
* Type guard for the identity-document expiry webhook. Narrows an already
|
|
541
|
+
* signature-verified, parsed payload to {@link KycDocumentExpiredCallbackEvent}.
|
|
542
|
+
*/
|
|
543
|
+
declare function isKycDocumentExpiredCallbackEvent(value: unknown): value is KycDocumentExpiredCallbackEvent;
|
|
451
544
|
/** Device class detected by the SDK (purely client-side — server doesn't care). */
|
|
452
545
|
type EventBasedFaceVerificationDeviceType = 'mobile' | 'desktop';
|
|
453
546
|
interface CreateEventBasedFaceVerificationSessionResponse {
|
|
@@ -478,6 +571,13 @@ interface CreateEventBasedFaceVerificationSessionResponse {
|
|
|
478
571
|
* (`reuse_kyc_reactions.max_retry_attempts + 1`).
|
|
479
572
|
*/
|
|
480
573
|
max_attempts: number;
|
|
574
|
+
/**
|
|
575
|
+
* Hosted verification journey URL. When present, the capture runs on a
|
|
576
|
+
* hosted page (embedded by `FaceCaptureModal` in an iframe) instead of the
|
|
577
|
+
* SDK's local camera; the verdict is read via the session status poll.
|
|
578
|
+
* Absent when the platform runs the local-capture flow.
|
|
579
|
+
*/
|
|
580
|
+
verification_url?: string;
|
|
481
581
|
}
|
|
482
582
|
/**
|
|
483
583
|
* Reaction outcome returned on every face-submit callback. Tenant apps
|
|
@@ -526,9 +626,10 @@ interface EventBasedFaceVerificationCallback {
|
|
|
526
626
|
data: EventBasedFaceVerificationReactionResult;
|
|
527
627
|
}
|
|
528
628
|
/**
|
|
529
|
-
* Server-side handoff
|
|
530
|
-
*
|
|
531
|
-
*
|
|
629
|
+
* Server-side handoff state backed by the normal KYC Redis store (15-minute
|
|
630
|
+
* cache TTL). Event-Based Face Verification remains valid for 10 minutes;
|
|
631
|
+
* this cache does not extend that session. Desktop clients poll it to detect
|
|
632
|
+
* when a mobile device has attached to the same token via QR.
|
|
532
633
|
*/
|
|
533
634
|
interface KycHandoffSession {
|
|
534
635
|
document: string;
|
|
@@ -786,10 +887,9 @@ declare class KycClient extends BaseClient {
|
|
|
786
887
|
* Create a Event-Based Face Verification session.
|
|
787
888
|
*
|
|
788
889
|
* Inspect the response before showing UI:
|
|
789
|
-
* - `is_required === false` → skip face
|
|
790
|
-
* - `
|
|
791
|
-
*
|
|
792
|
-
* - `device_type === 'mobile'` → open the face capture modal directly.
|
|
890
|
+
* - `is_required === false` → skip face verification; `reason` explains why.
|
|
891
|
+
* - `verification_url` present → embed the hosted journey and poll status.
|
|
892
|
+
* - `verification_url` absent → use the local camera / QR fallback.
|
|
793
893
|
*
|
|
794
894
|
* @param request - Reference, customer_id, event, amount (for threshold events), optional URLs.
|
|
795
895
|
*/
|
|
@@ -819,11 +919,22 @@ declare class KycClient extends BaseClient {
|
|
|
819
919
|
* @param token - The session token returned by `createEventBasedFaceVerificationSession`.
|
|
820
920
|
*/
|
|
821
921
|
getEventBasedFaceVerificationSessionStatus(token: string): Promise<EventBasedFaceVerificationCallback>;
|
|
922
|
+
/**
|
|
923
|
+
* Mint a fresh hosted verification journey for the next attempt on an
|
|
924
|
+
* active session whose previous hosted-journey attempt was declined.
|
|
925
|
+
* Only valid while the session is active and attempts remain; the
|
|
926
|
+
* response carries the new `verification_url` to embed. Used internally
|
|
927
|
+
* by `FaceCaptureModal`'s Try Again flow in hosted-journey mode.
|
|
928
|
+
*
|
|
929
|
+
* @param token - The session token returned by `createEventBasedFaceVerificationSession`.
|
|
930
|
+
*/
|
|
931
|
+
retryEventBasedFaceVerificationJourney(token: string): Promise<CreateEventBasedFaceVerificationSessionResponse>;
|
|
822
932
|
/**
|
|
823
933
|
* Fetch the Redis-backed handoff session for a token. Same backing
|
|
824
|
-
* store as normal KYC (`kyc:session:<token>`, 15-minute TTL).
|
|
825
|
-
*
|
|
826
|
-
*
|
|
934
|
+
* store as normal KYC (`kyc:session:<token>`, 15-minute TTL). The
|
|
935
|
+
* Event-Based Face Verification database session still expires after
|
|
936
|
+
* 10 minutes. Desktop callers poll `mobile_connected` to detect when a
|
|
937
|
+
* mobile device has scanned the QR and attached.
|
|
827
938
|
*
|
|
828
939
|
* @param token - The session token returned by `createEventBasedFaceVerificationSession`.
|
|
829
940
|
*/
|
|
@@ -1159,4 +1270,4 @@ declare class KycClient extends BaseClient {
|
|
|
1159
1270
|
createCustomerProfile(profile: CreateProfileRequest): Promise<CustomerProfile>;
|
|
1160
1271
|
}
|
|
1161
1272
|
|
|
1162
|
-
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 };
|
|
1273
|
+
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 KycDocumentExpiredCallbackEvent, type KycHandoffSession, type KycOverview, type KycPagination, type KycPreferences, type KycRequest, type KycRequestFilters, type KycRequestListResponse, type KycRequestReason, type KycRequestReasonCode, type KycStatus, type KycTriggerEvent, 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, isKycDocumentExpiredCallbackEvent };
|
package/dist/kyc/index.d.ts
CHANGED
|
@@ -315,6 +315,48 @@ interface UpdateKycStatusRequest {
|
|
|
315
315
|
/** Shufti warnings data */
|
|
316
316
|
warnings?: Record<string, Record<string, string>>;
|
|
317
317
|
}
|
|
318
|
+
/**
|
|
319
|
+
* Events that can trigger a KYC request. Each maps to a per-event toggle in
|
|
320
|
+
* the tenant's KYC verification trigger preferences, except `manual` (always
|
|
321
|
+
* required) and `login` (only for an expired identity document).
|
|
322
|
+
*/
|
|
323
|
+
type KycTriggerEvent = 'onboarding' | 'first_withdrawal' | 'first_purchase'
|
|
324
|
+
/** Aliases of `first_withdrawal` / `first_purchase` — same tenant toggles. */
|
|
325
|
+
| 'withdrawal' | 'purchase' | 'manual'
|
|
326
|
+
/**
|
|
327
|
+
* The customer is signing in. Answers for any state: never verified (asked,
|
|
328
|
+
* not skippable, per the tenant's onboarding policy), document expired
|
|
329
|
+
* (asked, skippable — "Remind me later"), or verified with a valid document
|
|
330
|
+
* (not asked). One call covers every customer.
|
|
331
|
+
*/
|
|
332
|
+
| 'login';
|
|
333
|
+
/**
|
|
334
|
+
* Why verification is — or is not — being asked for. Codes are stable;
|
|
335
|
+
* `message` is display-ready text you can show the customer as-is.
|
|
336
|
+
*/
|
|
337
|
+
interface KycRequestReason {
|
|
338
|
+
code: KycRequestReasonCode | (string & Record<string, never>);
|
|
339
|
+
message: string;
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* Reason codes returned by `requestKycSubmitLink`. Treat unrecognised codes
|
|
343
|
+
* as "verification required" and fall back to `message` for display.
|
|
344
|
+
*/
|
|
345
|
+
type KycRequestReasonCode =
|
|
346
|
+
/** Required to complete registration. */
|
|
347
|
+
'KYC_REQUIRED_ONBOARDING'
|
|
348
|
+
/** Required before the customer's first withdrawal. */
|
|
349
|
+
| 'KYC_REQUIRED_FIRST_WITHDRAWAL'
|
|
350
|
+
/** Required before the customer's first purchase. */
|
|
351
|
+
| 'KYC_REQUIRED_FIRST_PURCHASE'
|
|
352
|
+
/** The customer's identity document has expired and must be re-verified. */
|
|
353
|
+
| 'KYC_REQUIRED_ID_EXPIRED'
|
|
354
|
+
/** Verification was explicitly requested by the tenant. */
|
|
355
|
+
| 'KYC_REQUIRED_MANUAL'
|
|
356
|
+
/** Not required — the customer already has an accepted verification. */
|
|
357
|
+
| 'KYC_NOT_REQUIRED_ALREADY_VERIFIED'
|
|
358
|
+
/** Not required — the tenant has this trigger event switched off. */
|
|
359
|
+
| 'KYC_NOT_REQUIRED_TRIGGER_DISABLED';
|
|
318
360
|
interface RequestKycSubmitLinkRequest {
|
|
319
361
|
/** User ID to generate KYC submission link for */
|
|
320
362
|
user_id: string;
|
|
@@ -323,14 +365,20 @@ interface RequestKycSubmitLinkRequest {
|
|
|
323
365
|
/** URL to receive callback notifications via POST request when KYC status changes (optional) */
|
|
324
366
|
callback_url?: string;
|
|
325
367
|
/**
|
|
326
|
-
* Event that triggered the KYC request.
|
|
327
|
-
*
|
|
328
|
-
*
|
|
329
|
-
*
|
|
330
|
-
*
|
|
368
|
+
* Event that triggered the KYC request. The tenant's KYC verification
|
|
369
|
+
* trigger preferences decide, per event, whether KYC is required
|
|
370
|
+
* (`kyc_required` in the response). "manual" always requires KYC and
|
|
371
|
+
* honors the tenant's allow-skip-on-manual option (`can_skip`). "login"
|
|
372
|
+
* answers for any customer state — never verified (asked, not skippable),
|
|
373
|
+
* document expired (asked, skippable so you can offer "Remind me later"),
|
|
374
|
+
* or verified and valid (not asked) — so a platform that gates entry on KYC
|
|
375
|
+
* needs only this one call at sign-in. The same expired document is *not*
|
|
376
|
+
* skippable on withdrawal / purchase events: it is enforced on
|
|
377
|
+
* "first_withdrawal", "withdrawal", "first_purchase" and "purchase" alike,
|
|
378
|
+
* so keep sending whichever of those you already send.
|
|
331
379
|
* Omitted or unknown values default to KYC required with no skip.
|
|
332
380
|
*/
|
|
333
|
-
trigger_event?: string;
|
|
381
|
+
trigger_event?: KycTriggerEvent | (string & Record<string, never>);
|
|
334
382
|
/**
|
|
335
383
|
* Registered customer identity data (optional). Seeds the customer's risk
|
|
336
384
|
* profile so document verification can cross-check the submitted document
|
|
@@ -442,12 +490,57 @@ interface RequestKycSubmitLinkResponse {
|
|
|
442
490
|
*/
|
|
443
491
|
kyc_required: boolean;
|
|
444
492
|
/**
|
|
445
|
-
* Whether the user may skip verification.
|
|
493
|
+
* Whether the user may skip verification. `true` for
|
|
446
494
|
* `trigger_event: "manual"` when the tenant enables allow-skip-on-manual,
|
|
447
|
-
*
|
|
495
|
+
* for `"login"` when an expired identity document triggered the request
|
|
496
|
+
* (offer "Remind me later"), and when the customer is already verified.
|
|
497
|
+
* Always `false` at `"withdrawal"` / `"purchase"` — that is where a
|
|
498
|
+
* postponed re-verification becomes mandatory.
|
|
448
499
|
*/
|
|
449
500
|
can_skip: boolean;
|
|
501
|
+
/**
|
|
502
|
+
* Why verification is — or is not — being asked for. Use `reason.code` to
|
|
503
|
+
* branch (for example `KYC_REQUIRED_ID_EXPIRED` warrants a different prompt
|
|
504
|
+
* than a first-time verification) and `reason.message` for display.
|
|
505
|
+
*/
|
|
506
|
+
reason?: KycRequestReason;
|
|
450
507
|
}
|
|
508
|
+
/**
|
|
509
|
+
* Body POSTed to your `callback_url` when a customer's identity document
|
|
510
|
+
* passes its expiry date. Signed with `X-Webhook-Signature: sha256=<hex>`
|
|
511
|
+
* (HMAC-SHA256 of the raw body), like every other Vesant callback.
|
|
512
|
+
*
|
|
513
|
+
* An expiry happens on a **date**, not on a customer action, so this webhook
|
|
514
|
+
* is the only signal for it — nothing the customer does triggers it. Delivered
|
|
515
|
+
* once per customer, when the document first becomes expired.
|
|
516
|
+
*
|
|
517
|
+
* It is sent regardless of the tenant's auto-trigger-on-ID-expiration setting:
|
|
518
|
+
* that setting governs whether verification is *enforced*, not whether you are
|
|
519
|
+
* *told*.
|
|
520
|
+
*/
|
|
521
|
+
interface KycDocumentExpiredCallbackEvent {
|
|
522
|
+
/** Always `"kyc_document_expired"` — dispatch on this. */
|
|
523
|
+
event: 'kyc_document_expired';
|
|
524
|
+
/** Your customer identifier (the `user_id` you supplied). */
|
|
525
|
+
reference: string;
|
|
526
|
+
/** The customer's risk-profile ID. */
|
|
527
|
+
resource_id: string;
|
|
528
|
+
/**
|
|
529
|
+
* Always `"expired"`. Describes the document — not the customer's KYC
|
|
530
|
+
* status, which remains `accepted` until they re-verify.
|
|
531
|
+
*/
|
|
532
|
+
status: 'expired';
|
|
533
|
+
data: {
|
|
534
|
+
customer_id: string;
|
|
535
|
+
/** The document's expiry date (ISO 8601 `YYYY-MM-DD`). */
|
|
536
|
+
id_expiry_date: string;
|
|
537
|
+
};
|
|
538
|
+
}
|
|
539
|
+
/**
|
|
540
|
+
* Type guard for the identity-document expiry webhook. Narrows an already
|
|
541
|
+
* signature-verified, parsed payload to {@link KycDocumentExpiredCallbackEvent}.
|
|
542
|
+
*/
|
|
543
|
+
declare function isKycDocumentExpiredCallbackEvent(value: unknown): value is KycDocumentExpiredCallbackEvent;
|
|
451
544
|
/** Device class detected by the SDK (purely client-side — server doesn't care). */
|
|
452
545
|
type EventBasedFaceVerificationDeviceType = 'mobile' | 'desktop';
|
|
453
546
|
interface CreateEventBasedFaceVerificationSessionResponse {
|
|
@@ -478,6 +571,13 @@ interface CreateEventBasedFaceVerificationSessionResponse {
|
|
|
478
571
|
* (`reuse_kyc_reactions.max_retry_attempts + 1`).
|
|
479
572
|
*/
|
|
480
573
|
max_attempts: number;
|
|
574
|
+
/**
|
|
575
|
+
* Hosted verification journey URL. When present, the capture runs on a
|
|
576
|
+
* hosted page (embedded by `FaceCaptureModal` in an iframe) instead of the
|
|
577
|
+
* SDK's local camera; the verdict is read via the session status poll.
|
|
578
|
+
* Absent when the platform runs the local-capture flow.
|
|
579
|
+
*/
|
|
580
|
+
verification_url?: string;
|
|
481
581
|
}
|
|
482
582
|
/**
|
|
483
583
|
* Reaction outcome returned on every face-submit callback. Tenant apps
|
|
@@ -526,9 +626,10 @@ interface EventBasedFaceVerificationCallback {
|
|
|
526
626
|
data: EventBasedFaceVerificationReactionResult;
|
|
527
627
|
}
|
|
528
628
|
/**
|
|
529
|
-
* Server-side handoff
|
|
530
|
-
*
|
|
531
|
-
*
|
|
629
|
+
* Server-side handoff state backed by the normal KYC Redis store (15-minute
|
|
630
|
+
* cache TTL). Event-Based Face Verification remains valid for 10 minutes;
|
|
631
|
+
* this cache does not extend that session. Desktop clients poll it to detect
|
|
632
|
+
* when a mobile device has attached to the same token via QR.
|
|
532
633
|
*/
|
|
533
634
|
interface KycHandoffSession {
|
|
534
635
|
document: string;
|
|
@@ -786,10 +887,9 @@ declare class KycClient extends BaseClient {
|
|
|
786
887
|
* Create a Event-Based Face Verification session.
|
|
787
888
|
*
|
|
788
889
|
* Inspect the response before showing UI:
|
|
789
|
-
* - `is_required === false` → skip face
|
|
790
|
-
* - `
|
|
791
|
-
*
|
|
792
|
-
* - `device_type === 'mobile'` → open the face capture modal directly.
|
|
890
|
+
* - `is_required === false` → skip face verification; `reason` explains why.
|
|
891
|
+
* - `verification_url` present → embed the hosted journey and poll status.
|
|
892
|
+
* - `verification_url` absent → use the local camera / QR fallback.
|
|
793
893
|
*
|
|
794
894
|
* @param request - Reference, customer_id, event, amount (for threshold events), optional URLs.
|
|
795
895
|
*/
|
|
@@ -819,11 +919,22 @@ declare class KycClient extends BaseClient {
|
|
|
819
919
|
* @param token - The session token returned by `createEventBasedFaceVerificationSession`.
|
|
820
920
|
*/
|
|
821
921
|
getEventBasedFaceVerificationSessionStatus(token: string): Promise<EventBasedFaceVerificationCallback>;
|
|
922
|
+
/**
|
|
923
|
+
* Mint a fresh hosted verification journey for the next attempt on an
|
|
924
|
+
* active session whose previous hosted-journey attempt was declined.
|
|
925
|
+
* Only valid while the session is active and attempts remain; the
|
|
926
|
+
* response carries the new `verification_url` to embed. Used internally
|
|
927
|
+
* by `FaceCaptureModal`'s Try Again flow in hosted-journey mode.
|
|
928
|
+
*
|
|
929
|
+
* @param token - The session token returned by `createEventBasedFaceVerificationSession`.
|
|
930
|
+
*/
|
|
931
|
+
retryEventBasedFaceVerificationJourney(token: string): Promise<CreateEventBasedFaceVerificationSessionResponse>;
|
|
822
932
|
/**
|
|
823
933
|
* Fetch the Redis-backed handoff session for a token. Same backing
|
|
824
|
-
* store as normal KYC (`kyc:session:<token>`, 15-minute TTL).
|
|
825
|
-
*
|
|
826
|
-
*
|
|
934
|
+
* store as normal KYC (`kyc:session:<token>`, 15-minute TTL). The
|
|
935
|
+
* Event-Based Face Verification database session still expires after
|
|
936
|
+
* 10 minutes. Desktop callers poll `mobile_connected` to detect when a
|
|
937
|
+
* mobile device has scanned the QR and attached.
|
|
827
938
|
*
|
|
828
939
|
* @param token - The session token returned by `createEventBasedFaceVerificationSession`.
|
|
829
940
|
*/
|
|
@@ -1159,4 +1270,4 @@ declare class KycClient extends BaseClient {
|
|
|
1159
1270
|
createCustomerProfile(profile: CreateProfileRequest): Promise<CustomerProfile>;
|
|
1160
1271
|
}
|
|
1161
1272
|
|
|
1162
|
-
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 };
|
|
1273
|
+
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 KycDocumentExpiredCallbackEvent, type KycHandoffSession, type KycOverview, type KycPagination, type KycPreferences, type KycRequest, type KycRequestFilters, type KycRequestListResponse, type KycRequestReason, type KycRequestReasonCode, type KycStatus, type KycTriggerEvent, 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, isKycDocumentExpiredCallbackEvent };
|
package/dist/kyc/index.js
CHANGED
|
@@ -704,10 +704,9 @@ var KycClient = class extends BaseClient {
|
|
|
704
704
|
* Create a Event-Based Face Verification session.
|
|
705
705
|
*
|
|
706
706
|
* Inspect the response before showing UI:
|
|
707
|
-
* - `is_required === false` → skip face
|
|
708
|
-
* - `
|
|
709
|
-
*
|
|
710
|
-
* - `device_type === 'mobile'` → open the face capture modal directly.
|
|
707
|
+
* - `is_required === false` → skip face verification; `reason` explains why.
|
|
708
|
+
* - `verification_url` present → embed the hosted journey and poll status.
|
|
709
|
+
* - `verification_url` absent → use the local camera / QR fallback.
|
|
711
710
|
*
|
|
712
711
|
* @param request - Reference, customer_id, event, amount (for threshold events), optional URLs.
|
|
713
712
|
*/
|
|
@@ -754,11 +753,28 @@ var KycClient = class extends BaseClient {
|
|
|
754
753
|
headers: this.getUserHeaders()
|
|
755
754
|
});
|
|
756
755
|
}
|
|
756
|
+
/**
|
|
757
|
+
* Mint a fresh hosted verification journey for the next attempt on an
|
|
758
|
+
* active session whose previous hosted-journey attempt was declined.
|
|
759
|
+
* Only valid while the session is active and attempts remain; the
|
|
760
|
+
* response carries the new `verification_url` to embed. Used internally
|
|
761
|
+
* by `FaceCaptureModal`'s Try Again flow in hosted-journey mode.
|
|
762
|
+
*
|
|
763
|
+
* @param token - The session token returned by `createEventBasedFaceVerificationSession`.
|
|
764
|
+
*/
|
|
765
|
+
async retryEventBasedFaceVerificationJourney(token) {
|
|
766
|
+
return this.request("/api/v1/kyc/face/onsite/journey", {
|
|
767
|
+
method: "POST",
|
|
768
|
+
body: JSON.stringify({ token }),
|
|
769
|
+
headers: this.getUserHeaders()
|
|
770
|
+
});
|
|
771
|
+
}
|
|
757
772
|
/**
|
|
758
773
|
* Fetch the Redis-backed handoff session for a token. Same backing
|
|
759
|
-
* store as normal KYC (`kyc:session:<token>`, 15-minute TTL).
|
|
760
|
-
*
|
|
761
|
-
*
|
|
774
|
+
* store as normal KYC (`kyc:session:<token>`, 15-minute TTL). The
|
|
775
|
+
* Event-Based Face Verification database session still expires after
|
|
776
|
+
* 10 minutes. Desktop callers poll `mobile_connected` to detect when a
|
|
777
|
+
* mobile device has scanned the QR and attached.
|
|
762
778
|
*
|
|
763
779
|
* @param token - The session token returned by `createEventBasedFaceVerificationSession`.
|
|
764
780
|
*/
|
|
@@ -1267,8 +1283,12 @@ var KYC_DECLINED_DESCRIPTIONS = {
|
|
|
1267
1283
|
KYC_PROVIDER_REJECTED: "Identity verification was rejected by the verification provider",
|
|
1268
1284
|
KYC_DECLINED: "Identity verification was declined"
|
|
1269
1285
|
};
|
|
1286
|
+
function isKycDocumentExpiredCallbackEvent(value) {
|
|
1287
|
+
return typeof value === "object" && value !== null && value.event === "kyc_document_expired";
|
|
1288
|
+
}
|
|
1270
1289
|
|
|
1271
1290
|
exports.KYC_DECLINED_DESCRIPTIONS = KYC_DECLINED_DESCRIPTIONS;
|
|
1272
1291
|
exports.KycClient = KycClient;
|
|
1292
|
+
exports.isKycDocumentExpiredCallbackEvent = isKycDocumentExpiredCallbackEvent;
|
|
1273
1293
|
//# sourceMappingURL=index.js.map
|
|
1274
1294
|
//# sourceMappingURL=index.js.map
|