@checktiv/sdk-web 1.9.0 → 1.12.0

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 (64) hide show
  1. package/README.md +16 -1
  2. package/dist/agents/AGENTS.md +8 -0
  3. package/dist/agents/manifest.json +24 -0
  4. package/dist/capture-ui.d.ts +4 -4
  5. package/dist/capture-ui.js +7 -6
  6. package/dist/capture.d.ts +3 -3
  7. package/dist/capture.js +4 -3
  8. package/dist/challenge.js +2 -2
  9. package/dist/chunk-3KEVZCCZ.js +3 -0
  10. package/dist/chunk-4HIQN4KL.js +3 -0
  11. package/dist/chunk-C7GRMEYT.js +3 -0
  12. package/dist/chunk-CAI3JWWU.js +12 -0
  13. package/dist/chunk-EOTGVXW6.js +7 -0
  14. package/dist/{chunk-HV2QKVJX.js → chunk-FQSJUWRP.js} +1 -1
  15. package/dist/{chunk-FL2GCRSI.js → chunk-HWABVMID.js} +4 -4
  16. package/dist/{chunk-MCYAWMYQ.js → chunk-KYV5BPCD.js} +2 -2
  17. package/dist/chunk-MLQ2HMTS.js +3 -0
  18. package/dist/chunk-O3JECGW2.js +3 -0
  19. package/dist/chunk-PB2THQ3P.js +8 -0
  20. package/dist/chunk-TKK5CTVG.js +59 -0
  21. package/dist/chunk-UVTAPUGQ.js +3 -0
  22. package/dist/chunk-VMWTID63.js +3 -0
  23. package/dist/{chunk-WC6TLR42.js → chunk-WALPQ6TH.js} +2 -1
  24. package/dist/chunk-YE2LWN74.js +9 -0
  25. package/dist/{chunk-XSSM5ZB7.js → chunk-ZU4L3NDZ.js} +1 -1
  26. package/dist/collect-user-info.d.ts +4 -4
  27. package/dist/collect-user-info.js +5 -5
  28. package/dist/{controller-Ta5RgFZ4.d.ts → controller-Dh-rSrot.d.ts} +3 -2
  29. package/dist/{copy-CEILzVXc.d.ts → copy-Bsb1n1Wv.d.ts} +1 -1
  30. package/dist/credit-history.d.ts +4 -0
  31. package/dist/credit-history.js +12 -0
  32. package/dist/cross-device.js +2 -2
  33. package/dist/custom-form.css +1 -1
  34. package/dist/custom-form.d.ts +3 -3
  35. package/dist/custom-form.js +7 -8
  36. package/dist/esign/ceremony-runtime.js +7 -0
  37. package/dist/esign.d.ts +16 -0
  38. package/dist/esign.js +427 -0
  39. package/dist/fraud.d.ts +3 -3
  40. package/dist/fraud.js +5 -6
  41. package/dist/idv/cross-device.d.ts +7 -7
  42. package/dist/idv/cross-device.js +4 -5
  43. package/dist/idv.d.ts +3 -3
  44. package/dist/idv.js +13 -13
  45. package/dist/index-CGH7LlPH.d.ts +736 -0
  46. package/dist/{index-G5mVvjNZ.d.ts → index-CZt19Km4.d.ts} +5 -5
  47. package/dist/index.d.ts +6 -6
  48. package/dist/index.js +8 -8
  49. package/dist/{machine-BhPiYmOR.d.ts → machine-EePe2ERe.d.ts} +49 -2
  50. package/dist/react.d.ts +4 -4
  51. package/dist/react.js +11 -11
  52. package/dist/workspace.d.ts +3 -3
  53. package/dist/workspace.js +2 -1
  54. package/package.json +35 -9
  55. package/dist/api-BrQqQbGK.d.ts +0 -342
  56. package/dist/chunk-523TT3PD.js +0 -7
  57. package/dist/chunk-7GP5REM7.js +0 -3
  58. package/dist/chunk-BBO2X73Y.js +0 -9
  59. package/dist/chunk-GFHNOZVO.js +0 -3
  60. package/dist/chunk-NHNGQ5BB.js +0 -66
  61. package/dist/chunk-S2OOEDJS.js +0 -3
  62. package/dist/chunk-T4R5TTE5.js +0 -7
  63. package/dist/chunk-WPMO4FQ2.js +0 -13
  64. package/dist/chunk-XOGHMNBX.js +0 -3
@@ -1,9 +1,9 @@
1
- import * as react from 'react';
1
+ import * as React from 'react';
2
2
  import { ReactNode, ReactElement } from 'react';
3
3
  import { CollectUserInfoSession, CollectUserInfoCollector } from './collect-user-info.js';
4
- import { h as ChecktivIdvEvent, M as MountOptions, C as ChecktivInitOptions, H as ChecktivInitScope, a as ChecktivClient } from './api-BrQqQbGK.js';
5
- import { C as CaptureLayout, a as CaptureBehaviorMessage } from './machine-BhPiYmOR.js';
6
- import { M as MountCopy } from './copy-CEILzVXc.js';
4
+ import { S as ChecktivIdvEvent, U as MountOptions, V as ChecktivInitOptions, W as ChecktivInitScope, X as ChecktivClient } from './index-CGH7LlPH.js';
5
+ import { e as CaptureLayout, f as CaptureBehaviorMessage } from './machine-EePe2ERe.js';
6
+ import { M as MountCopy } from './copy-Bsb1n1Wv.js';
7
7
 
8
8
  interface SelfServiceResendResult {
9
9
  readonly requested: boolean;
@@ -31,7 +31,7 @@ interface ChecktivJourneyHandle {
31
31
  requestResend(confirmEmail: string): Promise<SelfServiceResendResult>;
32
32
  openCrossDevice(): void;
33
33
  }
34
- declare const ChecktivJourney: react.ForwardRefExoticComponent<MountOptions & react.RefAttributes<ChecktivJourneyHandle>>;
34
+ declare const ChecktivJourney: React.ForwardRefExoticComponent<MountOptions & React.RefAttributes<ChecktivJourneyHandle>>;
35
35
  declare function useCollectUserInfo(session: CollectUserInfoSession): CollectUserInfoCollector;
36
36
 
37
37
  export { type ChecktivIdvProps as C, type SelfServiceResendResult as S, type ChecktivJourneyHandle as a, type ChecktivJourneyProps as b, type ChecktivProviderProps as c, ChecktivIdv as d, ChecktivJourney as e, ChecktivProvider as f, type ChecktivProviderPropsBase as g, useCollectUserInfo as h, useChecktiv as u };
package/dist/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- import { C as ChecktivInitOptions, T as TokenManager, a as ChecktivClient, S as SdkRegion, P as ProvisionedHandle, M as MountOptions, I as InitOptions, b as ChecktivSessions } from './api-BrQqQbGK.js';
2
- export { c as CHECKTIV_ERROR_CODES, d as ChecktivError, e as ChecktivErrorCode, f as ChecktivEvent, g as ChecktivFraudEvent, h as ChecktivIdvEvent, i as ChecktivKnownErrorCode, j as ChecktivRecovery, k as CrossDeviceHandoffHook, F as FraudHandle, l as FraudMountOptions, G as GetSessionToken, m as GetSessionTokenContext, n as IdvCoachingHint, o as IdvHandle, p as IdvMountOptions, q as InvalidPublishableKeyError, r as MountCompleteResult, s as MountProvisionedOptions, t as MountScope, u as ParsedPublishableKey, R as ResolvedIdvConfig, v as SdkMode, w as SessionsCreateApplicant, x as SessionsCreateApplicantAddress, y as SessionsCreateInput, z as SessionsCreateOptions, A as SessionsCreateResult, B as SyntheticIdvScript, D as createChecktivError, E as parsePublishableKey } from './api-BrQqQbGK.js';
3
- import { S as SelfServiceResendResult } from './index-G5mVvjNZ.js';
4
- export { C as ChecktivIdvProps, a as ChecktivJourneyHandle, b as ChecktivJourneyProps, c as ChecktivProviderProps } from './index-G5mVvjNZ.js';
1
+ import { V as ChecktivInitOptions, _ as TokenManager, X as ChecktivClient, $ as SdkRegion, a0 as ProvisionedHandle, U as MountOptions, a1 as InitOptions, a2 as ChecktivSessions } from './index-CGH7LlPH.js';
2
+ export { a3 as CHECKTIV_ERROR_CODES, a4 as ChecktivCreditHistoryEvent, a5 as ChecktivError, a6 as ChecktivErrorCode, C as ChecktivEsignEvent, a7 as ChecktivEvent, a8 as ChecktivFraudEvent, S as ChecktivIdvEvent, a9 as ChecktivKnownErrorCode, aa as ChecktivRecovery, ab as CreditErrorCode, ac as CreditHistoryReconnectReason, ad as CreditScreen, ae as CreditSkipReason, Z as CrossDeviceHandoffHook, t as EsignCopy, w as EsignHandle, y as EsignMountOptions, D as EsignState, af as FraudHandle, ag as FraudMountOptions, ah as GetSessionToken, ai as GetSessionTokenContext, aj as IdvCoachingHint, ak as IdvHandle, al as IdvMountOptions, am as InvalidPublishableKeyError, an as MountCompleteResult, ao as MountProvisionedOptions, ap as MountScope, aq as ParsedPublishableKey, ar as ResolvedIdvConfig, as as SdkMode, at as SessionsCreateApplicant, au as SessionsCreateApplicantAddress, av as SessionsCreateInput, aw as SessionsCreateOptions, ax as SessionsCreateResult, ay as SyntheticIdvScript, az as createChecktivError, aA as isChecktivCreditHistoryEvent, aB as parsePublishableKey } from './index-CGH7LlPH.js';
3
+ import { S as SelfServiceResendResult } from './index-CZt19Km4.js';
4
+ export { C as ChecktivIdvProps, a as ChecktivJourneyHandle, b as ChecktivJourneyProps, c as ChecktivProviderProps } from './index-CZt19Km4.js';
5
5
  export { C as CrossDeviceCopy } from './copy-DCeQ4JKx.js';
6
- import './machine-BhPiYmOR.js';
7
- import './copy-CEILzVXc.js';
6
+ import './machine-EePe2ERe.js';
7
+ import './copy-Bsb1n1Wv.js';
8
8
  import 'react';
9
9
  import './collect-user-info.js';
10
10
 
package/dist/index.js CHANGED
@@ -1,12 +1,12 @@
1
- export { init, isSessionsCreateError, mount, mountButton, sessions, version } from './chunk-WPMO4FQ2.js';
2
- import './chunk-GFHNOZVO.js';
3
- export { CHECKTIV_ERROR_CODES, createChecktivError } from './chunk-7GP5REM7.js';
4
- export { InvalidPublishableKeyError, parsePublishableKey } from './chunk-WC6TLR42.js';
5
- import './chunk-523TT3PD.js';
1
+ export { init, isSessionsCreateError, mount, mountButton, sessions, version } from './chunk-CAI3JWWU.js';
2
+ import './chunk-3KEVZCCZ.js';
3
+ export { InvalidPublishableKeyError, parsePublishableKey } from './chunk-WALPQ6TH.js';
4
+ import './chunk-EOTGVXW6.js';
5
+ import './chunk-IQKHRPJR.js';
6
6
  import './chunk-UBQTPS5J.js';
7
- import './chunk-S2OOEDJS.js';
7
+ export { isChecktivCreditHistoryEvent } from './chunk-O3JECGW2.js';
8
+ import './chunk-VMWTID63.js';
9
+ export { CHECKTIV_ERROR_CODES, createChecktivError } from './chunk-C7GRMEYT.js';
8
10
  export { regionToApiBase } from './chunk-HFQJYEGZ.js';
9
- import './chunk-XOGHMNBX.js';
10
- import './chunk-IQKHRPJR.js';
11
11
  import './chunk-QFA3K5ZV.js';
12
12
  import './chunk-AIK7CDV6.js';
@@ -15,8 +15,42 @@ interface SelfieChromeCopy {
15
15
  confirm?: string;
16
16
  retake?: string;
17
17
  }
18
+ interface BeginScanCopyOverrides {
19
+ prompt?: string;
20
+ label?: string;
21
+ progressSlowLabel?: string;
22
+ cameraStartingLabel?: string;
23
+ cameraUnavailableNotice?: string;
24
+ uploadPrompt?: string;
25
+ uploadLabel?: string;
26
+ uploadSingleSideLabel?: string;
27
+ uploadFrontLabel?: string;
28
+ uploadBackLabel?: string;
29
+ uploadEntryLabel?: string;
30
+ uploadBackAction?: string;
31
+ uploadChangeDocumentAction?: string;
32
+ uploadChooseDocumentPrompt?: string;
33
+ documentTypePassport?: string;
34
+ documentTypeDriversLicense?: string;
35
+ documentTypeIdCard?: string;
36
+ documentTypeResidencePermit?: string;
37
+ documentTypeVisa?: string;
38
+ documentTypeWorkPermit?: string;
39
+ uploadPickAction?: string;
40
+ uploadReplaceAction?: string;
41
+ uploadKeepAction?: string;
42
+ uploadPreparingLabel?: string;
43
+ uploadAddedNotice?: string;
44
+ uploadBusyLabel?: string;
45
+ uploadIncompleteNotice?: string;
46
+ uploadIncompleteSingleNotice?: string;
47
+ uploadTooLargeNotice?: string;
48
+ uploadUnsupportedNotice?: string;
49
+ uploadUnreadableNotice?: string;
50
+ }
18
51
  type DataMode = 'live' | 'test';
19
52
  type TestHint = 'pass' | 'review' | 'fail' | 'doc_quality';
53
+ type IdvAcquisition = 'camera' | 'upload';
20
54
  type CaptureLayout = 'inline' | 'immersive';
21
55
  interface CaptureBrandTokens {
22
56
  primary: string;
@@ -38,7 +72,14 @@ interface IdVerificationConfig {
38
72
  requireExpiryValid: boolean;
39
73
  requireNameMatch: boolean;
40
74
  documentAuthenticity: boolean;
75
+ allowDocumentUpload?: boolean;
76
+ minAge?: number;
77
+ }
78
+ interface CaptureSessionClientConfig {
79
+ documentTypes: IdvDocumentType[];
80
+ biometricMode: 'none' | 'selfie' | 'liveness';
41
81
  minAge?: number;
82
+ allowDocumentUpload: boolean;
42
83
  }
43
84
  interface CaptureInitMessage {
44
85
  type: 'capture:init';
@@ -49,12 +90,13 @@ interface CaptureInitMessage {
49
90
  mode?: DataMode;
50
91
  testHint?: TestHint;
51
92
  protocolVersion?: number;
93
+ beginScanCopy?: BeginScanCopyOverrides;
52
94
  beginScanPrompt?: string;
53
95
  beginScanLabel?: string;
54
96
  selfiePromptMap?: SelfiePromptMap;
55
97
  selfieChromeCopy?: SelfieChromeCopy;
56
98
  }
57
- type CaptureInitStaticKey = 'config' | 'locale' | 'theme' | 'protocolVersion' | 'beginScanPrompt' | 'beginScanLabel' | 'selfiePromptMap' | 'selfieChromeCopy';
99
+ type CaptureInitStaticKey = 'config' | 'locale' | 'theme' | 'protocolVersion' | 'beginScanCopy' | 'beginScanPrompt' | 'beginScanLabel' | 'selfiePromptMap' | 'selfieChromeCopy';
58
100
  interface IdvR2Keys {
59
101
  front: string;
60
102
  back?: string;
@@ -77,6 +119,11 @@ interface CaptureBehaviorMessage {
77
119
  steps: CaptureBehaviorStep[];
78
120
  traits: CaptureBehaviorTraits;
79
121
  }
122
+ interface CaptureTimingSnapshot {
123
+ providerImportMs?: number;
124
+ gateDwellMs?: number;
125
+ captureUiMs?: number;
126
+ }
80
127
  interface SdkCrossDeviceStatusResponse {
81
128
  advanced: boolean;
82
129
  currentStepId: string | null;
@@ -160,4 +207,4 @@ declare function reducer(state: CaptureState, action: CaptureAction): CaptureSta
160
207
  declare function nextCapturePhaseAfterDocument(side: CaptureDocumentSide, documentTypes: IdVerificationConfig['documentTypes'], biometricMode: IdVerificationConfig['biometricMode']): CapturePhase;
161
208
  declare function isBiometricPhase(phase: CapturePhase): boolean;
162
209
 
163
- export { type CaptureLayout as C, type DataMode as D, type IdvR2Keys as I, type SdkCrossDeviceStatusResponse as S, type TestHint as T, type CaptureBehaviorMessage as a, type CoachingKind as b, type CaptureAction as c, type CaptureErrorKind as d, type CapturePhase as e, type CaptureState as f, type CaptureInitMessage as g, type CaptureInitStaticKey as h, isBiometricPhase as i, type SelfiePromptMap as j, type SelfieChromeCopy as k, nextCapturePhaseAfterDocument as n, reducer as r };
210
+ export { type BeginScanCopyOverrides as B, type CoachingKind as C, type DataMode as D, type IdvR2Keys as I, type SdkCrossDeviceStatusResponse as S, type TestHint as T, type CaptureAction as a, type CaptureErrorKind as b, type CapturePhase as c, type CaptureState as d, type CaptureLayout as e, type CaptureBehaviorMessage as f, type IdvAcquisition as g, type CaptureInitMessage as h, isBiometricPhase as i, type CaptureInitStaticKey as j, type CaptureTimingSnapshot as k, type CaptureBehaviorStep as l, type CaptureBehaviorTraits as m, nextCapturePhaseAfterDocument as n, type CaptureBrandTokens as o, type CaptureTheme as p, type CaptureSessionClientConfig as q, reducer as r, type SelfiePromptMap as s, type SelfieChromeCopy as t };
package/dist/react.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import 'react';
2
2
  import './collect-user-info.js';
3
- import './api-BrQqQbGK.js';
4
- import './machine-BhPiYmOR.js';
5
- import './copy-CEILzVXc.js';
6
- export { d as ChecktivIdv, C as ChecktivIdvProps, e as ChecktivJourney, a as ChecktivJourneyHandle, b as ChecktivJourneyProps, f as ChecktivProvider, c as ChecktivProviderProps, g as ChecktivProviderPropsBase, u as useChecktiv, h as useCollectUserInfo } from './index-G5mVvjNZ.js';
3
+ import './index-CGH7LlPH.js';
4
+ import './machine-EePe2ERe.js';
5
+ import './copy-Bsb1n1Wv.js';
6
+ export { d as ChecktivIdv, C as ChecktivIdvProps, e as ChecktivJourney, a as ChecktivJourneyHandle, b as ChecktivJourneyProps, f as ChecktivProvider, c as ChecktivProviderProps, g as ChecktivProviderPropsBase, u as useChecktiv, h as useCollectUserInfo } from './index-CZt19Km4.js';
7
7
  import './copy-DCeQ4JKx.js';
package/dist/react.js CHANGED
@@ -1,19 +1,19 @@
1
- import { mount, init } from './chunk-WPMO4FQ2.js';
2
- import './chunk-GFHNOZVO.js';
3
- import './chunk-7GP5REM7.js';
4
- import { collectUserInfo } from './chunk-BBO2X73Y.js';
5
- import './chunk-WC6TLR42.js';
6
- import './chunk-523TT3PD.js';
1
+ import { mount, init } from './chunk-CAI3JWWU.js';
2
+ import './chunk-3KEVZCCZ.js';
3
+ import { collectUserInfo } from './chunk-YE2LWN74.js';
4
+ import './chunk-WALPQ6TH.js';
5
+ import './chunk-EOTGVXW6.js';
6
+ import './chunk-IQKHRPJR.js';
7
7
  import './chunk-UBQTPS5J.js';
8
- import './chunk-S2OOEDJS.js';
8
+ import './chunk-O3JECGW2.js';
9
+ import './chunk-VMWTID63.js';
10
+ import './chunk-C7GRMEYT.js';
9
11
  import './chunk-HFQJYEGZ.js';
10
- import './chunk-XOGHMNBX.js';
11
- import './chunk-IQKHRPJR.js';
12
12
  import './chunk-QFA3K5ZV.js';
13
13
  import './chunk-AIK7CDV6.js';
14
+ import * as React from 'react';
14
15
  import { createContext, forwardRef, useRef, useImperativeHandle, useEffect, useMemo, useContext } from 'react';
15
- import { jsx } from 'react/jsx-runtime';
16
16
 
17
- var ChecktivContext=createContext(null);function ChecktivProvider(props){if(typeof window==="undefined")return null;return jsx(ProviderImpl,{...props})}function ProviderImpl(props){const{getSessionToken,theme,locale,children}=props;const scope="publishableKey"in props?{publishableKey:props.publishableKey}:{region:props.region,mode:props.mode};const pk="publishableKey"in props?props.publishableKey:void 0;const region="publishableKey"in props?void 0:props.region;const mode="publishableKey"in props?void 0:props.mode;const themeKey=JSON.stringify(theme??null);const client=useMemo(()=>init({...scope,getSessionToken,theme,locale}),[pk,region,mode,getSessionToken,themeKey,locale]);return jsx(ChecktivContext.Provider,{value:client,children})}function useChecktiv(){const client=useContext(ChecktivContext);if(client===null){throw new Error("useChecktiv must be used within a <ChecktivProvider>. Wrap the component tree that needs the Checktiv client with <ChecktivProvider>.")}return client}function ChecktivIdv({onEvent,copy,layout,onBeforeSubmit,onBehaviorSegment}){const client=useChecktiv();const containerRef=useRef(null);const handleRef=useRef(null);const mountConfigRef=useRef({copy,layout,onBeforeSubmit,onBehaviorSegment});const onEventRef=useRef(onEvent);onEventRef.current=onEvent;useEffect(()=>{if(typeof window==="undefined")return;if(containerRef.current===null)return;if(handleRef.current!==null)return;const mountConfig=mountConfigRef.current;handleRef.current=client.mount("idv",{target:containerRef.current,onEvent:e=>onEventRef.current(e),...mountConfig.copy!==void 0?{copy:mountConfig.copy}:{},...mountConfig.layout!==void 0?{layout:mountConfig.layout}:{},...mountConfig.onBeforeSubmit!==void 0?{onBeforeSubmit:mountConfig.onBeforeSubmit}:{},...mountConfig.onBehaviorSegment!==void 0?{onBehaviorSegment:mountConfig.onBehaviorSegment}:{}});return ()=>{handleRef.current?.destroy();handleRef.current=null;}},[client]);if(typeof window==="undefined")return null;return jsx("div",{ref:containerRef})}var ChecktivJourneyImpl=(props,ref)=>{const containerRef=useRef(null);const handleRef=useRef(null);const scope="publishableKey"in props?{publishableKey:props.publishableKey}:{region:props.region,mode:props.mode};const pk="publishableKey"in props?props.publishableKey:void 0;const region="publishableKey"in props?void 0:props.region;const mode="publishableKey"in props?void 0:props.mode;const journeyConfig={fetchToken:props.fetchToken,onConsent:props.onConsent,layout:props.layout,theme:props.theme,copy:props.copy,resumeKey:props.resumeKey,shortCode:props.shortCode,apiBase:props.apiBase,fetchImpl:props.fetchImpl,crossDeviceCopy:props.crossDeviceCopy,onOpenCrossDevice:props.onOpenCrossDevice,maxWidth:props.maxWidth};const mountConfigRef=useRef(journeyConfig);mountConfigRef.current=journeyConfig;const onEventRef=useRef(props.onEvent);onEventRef.current=props.onEvent;const onCompleteRef=useRef(props.onComplete);onCompleteRef.current=props.onComplete;useImperativeHandle(ref,()=>({requestResend:confirmEmail=>handleRef.current?.requestResend(confirmEmail)??Promise.resolve({requested:false}),openCrossDevice:()=>handleRef.current?.openCrossDevice?.()}),[]);useEffect(()=>{if(typeof window==="undefined")return;if(containerRef.current===null)return;if(handleRef.current!==null)return;const cfg=mountConfigRef.current;const opts={...scope,fetchToken:cfg.fetchToken,onEvent:e=>onEventRef.current?.(e),onComplete:r=>onCompleteRef.current?.(r),...cfg.onConsent!==void 0?{onConsent:cfg.onConsent}:{},...cfg.layout!==void 0?{layout:cfg.layout}:{},...cfg.theme!==void 0?{theme:cfg.theme}:{},...cfg.copy!==void 0?{copy:cfg.copy}:{},...cfg.resumeKey!==void 0?{resumeKey:cfg.resumeKey}:{},...cfg.shortCode!==void 0?{shortCode:cfg.shortCode}:{},...cfg.apiBase!==void 0?{apiBase:cfg.apiBase}:{},...cfg.fetchImpl!==void 0?{fetchImpl:cfg.fetchImpl}:{},...cfg.crossDeviceCopy!==void 0?{crossDeviceCopy:cfg.crossDeviceCopy}:{},...cfg.onOpenCrossDevice!==void 0?{onOpenCrossDevice:cfg.onOpenCrossDevice}:{},...cfg.maxWidth!==void 0?{maxWidth:cfg.maxWidth}:{}};handleRef.current=mount(containerRef.current,opts);return ()=>{handleRef.current?.destroy();handleRef.current=null;}},[pk,region,mode]);if(typeof window==="undefined")return null;return jsx("div",{ref:containerRef})};var ChecktivJourney=forwardRef(ChecktivJourneyImpl);function useCollectUserInfo(session){const sessionRef=useRef(session);return useMemo(()=>collectUserInfo({session:sessionRef.current}),[])}
17
+ var ChecktivContext=createContext(null);function ChecktivProvider(props){if(typeof window==="undefined")return null;return React.createElement(ProviderImpl,{...props})}function ProviderImpl(props){const{getSessionToken,theme,locale,children}=props;const scope="publishableKey"in props?{publishableKey:props.publishableKey}:{region:props.region,mode:props.mode};const pk="publishableKey"in props?props.publishableKey:void 0;const region="publishableKey"in props?void 0:props.region;const mode="publishableKey"in props?void 0:props.mode;const themeKey=JSON.stringify(theme??null);const client=useMemo(()=>init({...scope,getSessionToken,theme,locale}),[pk,region,mode,getSessionToken,themeKey,locale]);return React.createElement(ChecktivContext.Provider,{value:client},children)}function useChecktiv(){const client=useContext(ChecktivContext);if(client===null){throw new Error("useChecktiv must be used within a <ChecktivProvider>. Wrap the component tree that needs the Checktiv client with <ChecktivProvider>.")}return client}function ChecktivIdv({onEvent,copy,layout,onBeforeSubmit,onBehaviorSegment}){const client=useChecktiv();const containerRef=useRef(null);const handleRef=useRef(null);const mountConfigRef=useRef({copy,layout,onBeforeSubmit,onBehaviorSegment});const onEventRef=useRef(onEvent);onEventRef.current=onEvent;useEffect(()=>{if(typeof window==="undefined")return;if(containerRef.current===null)return;if(handleRef.current!==null)return;const mountConfig=mountConfigRef.current;handleRef.current=client.mount("idv",{target:containerRef.current,onEvent:e=>onEventRef.current(e),...mountConfig.copy!==void 0?{copy:mountConfig.copy}:{},...mountConfig.layout!==void 0?{layout:mountConfig.layout}:{},...mountConfig.onBeforeSubmit!==void 0?{onBeforeSubmit:mountConfig.onBeforeSubmit}:{},...mountConfig.onBehaviorSegment!==void 0?{onBehaviorSegment:mountConfig.onBehaviorSegment}:{}});return ()=>{handleRef.current?.destroy();handleRef.current=null;}},[client]);if(typeof window==="undefined")return null;return React.createElement("div",{ref:containerRef})}function pinnedJourneyConfig(props){return {fetchToken:props.fetchToken,onConsent:props.onConsent,layout:props.layout,theme:props.theme,copy:props.copy,resumeKey:props.resumeKey,shortCode:props.shortCode,apiBase:props.apiBase,fetchImpl:props.fetchImpl,crossDeviceCopy:props.crossDeviceCopy,onOpenCrossDevice:props.onOpenCrossDevice,maxWidth:props.maxWidth}}function latestJourneyHandlers(props){return {onEvent:props.onEvent,onComplete:props.onComplete,onError:props.onError}}var ChecktivJourneyImpl=(props,ref)=>{const containerRef=useRef(null);const handleRef=useRef(null);const scope="publishableKey"in props?{publishableKey:props.publishableKey}:{region:props.region,mode:props.mode};const pk="publishableKey"in props?props.publishableKey:void 0;const region="publishableKey"in props?void 0:props.region;const mode="publishableKey"in props?void 0:props.mode;const journeyConfig=pinnedJourneyConfig(props);const mountConfigRef=useRef(journeyConfig);mountConfigRef.current=journeyConfig;const handlers=latestJourneyHandlers(props);const handlersRef=useRef(handlers);handlersRef.current=handlers;useImperativeHandle(ref,()=>({requestResend:confirmEmail=>handleRef.current?.requestResend(confirmEmail)??Promise.resolve({requested:false}),openCrossDevice:()=>handleRef.current?.openCrossDevice?.()}),[]);useEffect(()=>{if(typeof window==="undefined")return;if(containerRef.current===null)return;if(handleRef.current!==null)return;const cfg=mountConfigRef.current;const opts={...scope,fetchToken:cfg.fetchToken,onEvent:e=>handlersRef.current.onEvent?.(e),onComplete:r=>handlersRef.current.onComplete?.(r),onError:err=>handlersRef.current.onError?.(err),...cfg.onConsent!==void 0?{onConsent:cfg.onConsent}:{},...cfg.layout!==void 0?{layout:cfg.layout}:{},...cfg.theme!==void 0?{theme:cfg.theme}:{},...cfg.copy!==void 0?{copy:cfg.copy}:{},...cfg.resumeKey!==void 0?{resumeKey:cfg.resumeKey}:{},...cfg.shortCode!==void 0?{shortCode:cfg.shortCode}:{},...cfg.apiBase!==void 0?{apiBase:cfg.apiBase}:{},...cfg.fetchImpl!==void 0?{fetchImpl:cfg.fetchImpl}:{},...cfg.crossDeviceCopy!==void 0?{crossDeviceCopy:cfg.crossDeviceCopy}:{},...cfg.onOpenCrossDevice!==void 0?{onOpenCrossDevice:cfg.onOpenCrossDevice}:{},...cfg.maxWidth!==void 0?{maxWidth:cfg.maxWidth}:{}};handleRef.current=mount(containerRef.current,opts);return ()=>{handleRef.current?.destroy();handleRef.current=null;}},[pk,region,mode]);if(typeof window==="undefined")return null;return React.createElement("div",{ref:containerRef})};var ChecktivJourney=forwardRef(ChecktivJourneyImpl);function useCollectUserInfo(session){const sessionRef=useRef(session);return useMemo(()=>collectUserInfo({session:sessionRef.current}),[])}
18
18
 
19
19
  export { ChecktivIdv, ChecktivJourney, ChecktivProvider, useChecktiv, useCollectUserInfo };
@@ -1,6 +1,6 @@
1
- import { S as SdkRegion } from './api-BrQqQbGK.js';
2
- import './machine-BhPiYmOR.js';
3
- import './copy-CEILzVXc.js';
1
+ import { $ as SdkRegion } from './index-CGH7LlPH.js';
2
+ import './machine-EePe2ERe.js';
3
+ import './copy-Bsb1n1Wv.js';
4
4
  import './copy-DCeQ4JKx.js';
5
5
 
6
6
  interface WorkspaceTokenBundle {
package/dist/workspace.js CHANGED
@@ -1,7 +1,8 @@
1
1
  import { isCanonicalOrigin, sdkPublicSettings } from './chunk-HFQJYEGZ.js';
2
2
  import { getServiceOrigin } from './chunk-QFA3K5ZV.js';
3
+ import { initTransport } from './chunk-UVTAPUGQ.js';
3
4
  import './chunk-AIK7CDV6.js';
4
5
 
5
- function isOriginTargetedPoster(value){return typeof value==="object"&&value!==null&&"postMessage"in value}function initTransport(options,announce){const{win,allowedOrigins,parse,onMessage,accept,reAnnounce}=options;if(!Array.isArray(allowedOrigins)||allowedOrigins.length===0){return {teardown:()=>{}}}const allowlist=new Set(allowedOrigins);const onMessageListener=event=>{if(!allowlist.has(event.origin))return;const parsed=parse(event.data);if(parsed===null)return;if(accept&&!accept(parsed,event.origin))return;const source=event.source;if(!isOriginTargetedPoster(source))return;const post=message=>source.postMessage(message,event.origin);onMessage(parsed,post,event.origin);};win.addEventListener("message",onMessageListener);const broadcast=message=>{for(const origin of allowlist){win.parent.postMessage(message,origin);}};let timer=null;if(reAnnounce!==void 0&&reAnnounce.maxAttempts>0){const scheduler=reAnnounce.schedule??{set:(cb,ms)=>setTimeout(cb,ms),clear:handle=>clearTimeout(handle)};let attemptsLeft=reAnnounce.maxAttempts;const tick=()=>{if(attemptsLeft<=0){timer=null;return}attemptsLeft-=1;broadcast(reAnnounce.message);timer=attemptsLeft>0?scheduler.set(tick,reAnnounce.intervalMs):null;};timer=scheduler.set(tick,reAnnounce.intervalMs);return {teardown:()=>{win.removeEventListener("message",onMessageListener);if(timer!==null){scheduler.clear(timer);timer=null;}}}}return {teardown:()=>{win.removeEventListener("message",onMessageListener);}}}var REVIEWER_COMPONENT="reviewer";var LOADER_PROTOCOL_VERSION=1;var NAVIGATION_EVENTS=new Set(["session_complete","navigate_away"]);function parseWorkspaceInbound(data){if(typeof data!=="object"||data===null)return null;const record=data;const type=record.type;if(type==="wk:ready"){if(record.component!==REVIEWER_COMPONENT)return null;if(typeof record.sessionId!=="string"||record.sessionId.length===0)return null;if(typeof record.nonce!=="string"||record.nonce.length===0)return null;return {type:"wk:ready",component:REVIEWER_COMPONENT,sessionId:record.sessionId,nonce:record.nonce,...typeof record.protocolVersion==="number"?{protocolVersion:record.protocolVersion}:{}}}if(type==="wk:token_refresh"){return {type:"wk:token_refresh",...typeof record.protocolVersion==="number"?{protocolVersion:record.protocolVersion}:{}}}if(type==="wk:event"){if(record.component!==REVIEWER_COMPONENT)return null;const event=record.event;if(typeof event!=="string"||!NAVIGATION_EVENTS.has(event)){return null}return {type:"wk:event",component:REVIEWER_COMPONENT,event,...typeof record.protocolVersion==="number"?{protocolVersion:record.protocolVersion}:{}}}if(type==="wk:error"){const code=record.code;if(code!=="session_expired"&&code!=="protocol_mismatch"&&code!=="origin_rejected"&&code!=="nonce_mismatch"){return null}return {type:"wk:error",code,...typeof record.protocolVersion==="number"?{protocolVersion:record.protocolVersion}:{}}}return null}function makeNonce(){const c=globalThis.crypto;if(c&&typeof c.randomUUID==="function")return c.randomUUID();return `wkn_${Date.now().toString(36)}_${Math.random().toString(36).slice(2)}`}function buildInitMessage(dataToken,nonce){return {type:"wk:init",component:REVIEWER_COMPONENT,dataToken,nonce,protocolVersion:LOADER_PROTOCOL_VERSION}}function buildErrorMessage(code){return {type:"wk:error",code,protocolVersion:LOADER_PROTOCOL_VERSION}}function wireWorkspaceTransport(options){const{win,workspaceOrigin,currentNonce,handlers}=options;return initTransport({win,allowedOrigins:[workspaceOrigin],parse:parseWorkspaceInbound,accept:message=>{if(message.type!=="wk:ready")return true;const current=currentNonce();if(current===null)return true;return message.nonce===current},onMessage:(message,post,origin)=>{switch(message.type){case "wk:ready":handlers.onReady(message,post,origin);return;case "wk:token_refresh":handlers.onTokenRefresh(post,origin);return;case "wk:event":handlers.onNavigation(message.event,origin);return;case "wk:error":handlers.onError(message,origin);return;default:return assertNeverInbound(message)}}})}function assertNeverInbound(message){throw new Error(`Unhandled workspace inbound message: ${JSON.stringify(message)}`)}function createWorkspaceTokenPair(getToken,sessionId){let cached=null;let pending=null;let liveDataToken=null;const mint=reason=>{const p=getToken({sessionId:sessionId(),reason});void p.then(bundle=>{liveDataToken=bundle.dataToken;},()=>{});return p};const initialBundle=()=>{if(cached!==null)return cached;const p=mint("initial");cached=p;void p.catch(()=>{if(cached===p)cached=null;});return p};return {framingToken(){return initialBundle().then(b=>b.framingToken)},currentDataToken(){return liveDataToken},dataToken(){return initialBundle().then(b=>b.dataToken)},refreshDataToken(){if(pending!==null)return pending.then(b=>b.dataToken);const p=mint("refresh");pending=p;cached=p;void p.then(()=>{if(pending===p)pending=null;},()=>{if(pending===p)pending=null;if(cached===p)cached=null;});return p.then(b=>b.dataToken)}}}function resolveWorkspaceOrigin(region){return getServiceOrigin(sdkPublicSettings.apps["workspace-embed"].subdomain,"prod",region,sdkPublicSettings)}function resolveWorkspaceBaseOrigin(workspaceBaseUrl,region){if(isCanonicalOrigin(workspaceBaseUrl))return workspaceBaseUrl;return resolveWorkspaceOrigin(region)}var REVIEWER_PATH_PREFIX="/reviewer";function buildReviewerSrc(origin,sessionId,framingToken,theme){const path=`${REVIEWER_PATH_PREFIX}/${encodeURIComponent(sessionId)}`;const url=new URL(path,`${origin}/`);url.searchParams.set("ctx",framingToken);if(theme?.primaryColor!==void 0&&theme.primaryColor.length>0){url.searchParams.set("primary",theme.primaryColor);}if(theme?.colorMode!==void 0){url.searchParams.set("mode",theme.colorMode);}if(theme?.logoUrl!==void 0&&theme.logoUrl.length>0){url.searchParams.set("logo",theme.logoUrl);}if(theme?.brandName!==void 0&&theme.brandName.length>0){url.searchParams.set("brand",theme.brandName);}return url.toString()}var IFRAME_SANDBOX="allow-scripts allow-same-origin allow-downloads";function createReviewerController(deps){return {mount(options){return mountReviewer(deps,options)}}}function mountReviewer(deps,options){const doc=deps.doc??deps.win.document;const{sessionId,target,onEvent}=options;const tokens=createWorkspaceTokenPair(deps.getToken,()=>sessionId);const workspaceOrigin=resolveWorkspaceBaseOrigin(deps.workspaceBaseUrl,deps.region);let currentNonce=null;let consecutiveRefreshRejects=0;const container=doc.createElement("div");container.style.width="100%";container.style.height="100%";target.appendChild(container);const iframe=doc.createElement("iframe");iframe.setAttribute("title","Identity review");iframe.setAttribute("sandbox",IFRAME_SANDBOX);iframe.setAttribute("referrerpolicy","no-referrer");Object.assign(iframe.style,{width:"100%",height:"100%",border:"0",display:"block"});container.appendChild(iframe);let destroyed=false;let transport=null;const emit=event=>{if(destroyed)return;try{onEvent?.(event);}catch{}};const deliverInit=(dataToken,post)=>{if(destroyed)return;currentNonce=makeNonce();post(buildInitMessage(dataToken,currentNonce));};transport=wireWorkspaceTransport({win:deps.win,workspaceOrigin,currentNonce:()=>currentNonce,handlers:{onReady:(_message,post)=>{consecutiveRefreshRejects=0;if(currentNonce!==null)return;void tokens.dataToken().then(dataToken=>{if(destroyed)return;deliverInit(dataToken,post);}).catch(()=>{emit({type:"checktiv.workspace.error",code:"session_expired",recoverable:true,recovery:"retry_review"});});},onTokenRefresh:post=>{void tokens.refreshDataToken().then(fresh=>{consecutiveRefreshRejects=0;deliverInit(fresh,post);}).catch(()=>{if(destroyed)return;consecutiveRefreshRejects+=1;if(consecutiveRefreshRejects>=2){post(buildErrorMessage("session_expired"));emit({type:"checktiv.workspace.error",code:"session_expired",recoverable:true,recovery:"retry_review"});}});},onNavigation:intent=>{emit({type:"checktiv.workspace.navigate",intent});},onError:message=>{const recoverable=message.code==="session_expired";emit({type:"checktiv.workspace.error",code:message.code,recoverable,recovery:recoverable?"retry_review":"reload_host"});}}});void tokens.framingToken().then(framingToken=>{if(destroyed)return;iframe.src=buildReviewerSrc(workspaceOrigin,sessionId,framingToken,deps.theme);}).catch(()=>{emit({type:"checktiv.workspace.error",code:"session_expired",recoverable:true,recovery:"retry_review"});});return {destroy(){if(destroyed)return;destroyed=true;transport?.teardown();transport=null;container.remove();}}}function workspace(config){const controller=createReviewerController({getToken:config.getToken,region:config.region,workspaceBaseUrl:config.workspaceBaseUrl,theme:config.theme,win:window});return {mount(_component,options){return controller.mount(options)}}}
6
+ var REVIEWER_COMPONENT="reviewer";var LOADER_PROTOCOL_VERSION=1;var NAVIGATION_EVENTS=new Set(["session_complete","navigate_away"]);function parseWorkspaceInbound(data){if(typeof data!=="object"||data===null)return null;const record=data;const type=record.type;if(type==="wk:ready"){if(record.component!==REVIEWER_COMPONENT)return null;if(typeof record.sessionId!=="string"||record.sessionId.length===0)return null;if(typeof record.nonce!=="string"||record.nonce.length===0)return null;return {type:"wk:ready",component:REVIEWER_COMPONENT,sessionId:record.sessionId,nonce:record.nonce,...typeof record.protocolVersion==="number"?{protocolVersion:record.protocolVersion}:{}}}if(type==="wk:token_refresh"){return {type:"wk:token_refresh",...typeof record.protocolVersion==="number"?{protocolVersion:record.protocolVersion}:{}}}if(type==="wk:event"){if(record.component!==REVIEWER_COMPONENT)return null;const event=record.event;if(typeof event!=="string"||!NAVIGATION_EVENTS.has(event)){return null}return {type:"wk:event",component:REVIEWER_COMPONENT,event,...typeof record.protocolVersion==="number"?{protocolVersion:record.protocolVersion}:{}}}if(type==="wk:error"){const code=record.code;if(code!=="session_expired"&&code!=="protocol_mismatch"&&code!=="origin_rejected"&&code!=="nonce_mismatch"){return null}return {type:"wk:error",code,...typeof record.protocolVersion==="number"?{protocolVersion:record.protocolVersion}:{}}}return null}function makeNonce(){const c=globalThis.crypto;if(c&&typeof c.randomUUID==="function")return c.randomUUID();return `wkn_${Date.now().toString(36)}_${Math.random().toString(36).slice(2)}`}function buildInitMessage(dataToken,nonce){return {type:"wk:init",component:REVIEWER_COMPONENT,dataToken,nonce,protocolVersion:LOADER_PROTOCOL_VERSION}}function buildErrorMessage(code){return {type:"wk:error",code,protocolVersion:LOADER_PROTOCOL_VERSION}}function wireWorkspaceTransport(options){const{win,workspaceOrigin,currentNonce,handlers}=options;return initTransport({win,allowedOrigins:[workspaceOrigin],parse:parseWorkspaceInbound,accept:message=>{if(message.type!=="wk:ready")return true;const current=currentNonce();if(current===null)return true;return message.nonce===current},onMessage:(message,post,origin)=>{switch(message.type){case "wk:ready":handlers.onReady(message,post,origin);return;case "wk:token_refresh":handlers.onTokenRefresh(post,origin);return;case "wk:event":handlers.onNavigation(message.event,origin);return;case "wk:error":handlers.onError(message,origin);return;default:return assertNeverInbound(message)}}})}function assertNeverInbound(message){throw new Error(`Unhandled workspace inbound message: ${JSON.stringify(message)}`)}function createWorkspaceTokenPair(getToken,sessionId){let cached=null;let pending=null;let liveDataToken=null;const mint=reason=>{const p=getToken({sessionId:sessionId(),reason});void p.then(bundle=>{liveDataToken=bundle.dataToken;},()=>{});return p};const initialBundle=()=>{if(cached!==null)return cached;const p=mint("initial");cached=p;void p.catch(()=>{if(cached===p)cached=null;});return p};return {framingToken(){return initialBundle().then(b=>b.framingToken)},currentDataToken(){return liveDataToken},dataToken(){return initialBundle().then(b=>b.dataToken)},refreshDataToken(){if(pending!==null)return pending.then(b=>b.dataToken);const p=mint("refresh");pending=p;cached=p;void p.then(()=>{if(pending===p)pending=null;},()=>{if(pending===p)pending=null;if(cached===p)cached=null;});return p.then(b=>b.dataToken)}}}function resolveWorkspaceOrigin(region){return getServiceOrigin(sdkPublicSettings.apps["workspace-embed"].subdomain,"prod",region,sdkPublicSettings)}function resolveWorkspaceBaseOrigin(workspaceBaseUrl,region){if(isCanonicalOrigin(workspaceBaseUrl))return workspaceBaseUrl;return resolveWorkspaceOrigin(region)}var REVIEWER_PATH_PREFIX="/reviewer";function buildReviewerSrc(origin,sessionId,framingToken,theme){const path=`${REVIEWER_PATH_PREFIX}/${encodeURIComponent(sessionId)}`;const url=new URL(path,`${origin}/`);url.searchParams.set("ctx",framingToken);if(theme?.primaryColor!==void 0&&theme.primaryColor.length>0){url.searchParams.set("primary",theme.primaryColor);}if(theme?.colorMode!==void 0){url.searchParams.set("mode",theme.colorMode);}if(theme?.logoUrl!==void 0&&theme.logoUrl.length>0){url.searchParams.set("logo",theme.logoUrl);}if(theme?.brandName!==void 0&&theme.brandName.length>0){url.searchParams.set("brand",theme.brandName);}return url.toString()}var IFRAME_SANDBOX="allow-scripts allow-same-origin allow-downloads";function createReviewerController(deps){return {mount(options){return mountReviewer(deps,options)}}}function mountReviewer(deps,options){const doc=deps.doc??deps.win.document;const{sessionId,target,onEvent}=options;const tokens=createWorkspaceTokenPair(deps.getToken,()=>sessionId);const workspaceOrigin=resolveWorkspaceBaseOrigin(deps.workspaceBaseUrl,deps.region);let currentNonce=null;let consecutiveRefreshRejects=0;const container=doc.createElement("div");container.style.width="100%";container.style.height="100%";target.appendChild(container);const iframe=doc.createElement("iframe");iframe.setAttribute("title","Identity review");iframe.setAttribute("sandbox",IFRAME_SANDBOX);iframe.setAttribute("referrerpolicy","no-referrer");Object.assign(iframe.style,{width:"100%",height:"100%",border:"0",display:"block"});container.appendChild(iframe);let destroyed=false;let transport=null;const emit=event=>{if(destroyed)return;try{onEvent?.(event);}catch{}};const deliverInit=(dataToken,post)=>{if(destroyed)return;currentNonce=makeNonce();post(buildInitMessage(dataToken,currentNonce));};transport=wireWorkspaceTransport({win:deps.win,workspaceOrigin,currentNonce:()=>currentNonce,handlers:{onReady:(_message,post)=>{consecutiveRefreshRejects=0;if(currentNonce!==null)return;void tokens.dataToken().then(dataToken=>{if(destroyed)return;deliverInit(dataToken,post);}).catch(()=>{emit({type:"checktiv.workspace.error",code:"session_expired",recoverable:true,recovery:"retry_review"});});},onTokenRefresh:post=>{void tokens.refreshDataToken().then(fresh=>{consecutiveRefreshRejects=0;deliverInit(fresh,post);}).catch(()=>{if(destroyed)return;consecutiveRefreshRejects+=1;if(consecutiveRefreshRejects>=2){post(buildErrorMessage("session_expired"));emit({type:"checktiv.workspace.error",code:"session_expired",recoverable:true,recovery:"retry_review"});}});},onNavigation:intent=>{emit({type:"checktiv.workspace.navigate",intent});},onError:message=>{const recoverable=message.code==="session_expired";emit({type:"checktiv.workspace.error",code:message.code,recoverable,recovery:recoverable?"retry_review":"reload_host"});}}});void tokens.framingToken().then(framingToken=>{if(destroyed)return;iframe.src=buildReviewerSrc(workspaceOrigin,sessionId,framingToken,deps.theme);}).catch(()=>{emit({type:"checktiv.workspace.error",code:"session_expired",recoverable:true,recovery:"retry_review"});});return {destroy(){if(destroyed)return;destroyed=true;transport?.teardown();transport=null;container.remove();}}}function workspace(config){const controller=createReviewerController({getToken:config.getToken,region:config.region,workspaceBaseUrl:config.workspaceBaseUrl,theme:config.theme,win:window});return {mount(_component,options){return controller.mount(options)}}}
6
7
 
7
8
  export { workspace };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checktiv/sdk-web",
3
- "version": "1.9.0",
3
+ "version": "1.12.0",
4
4
  "private": false,
5
5
  "license": "Apache-2.0",
6
6
  "publishConfig": {
@@ -30,6 +30,14 @@
30
30
  "types": "./dist/collect-user-info.d.ts",
31
31
  "import": "./dist/collect-user-info.js"
32
32
  },
33
+ "./esign": {
34
+ "types": "./dist/esign.d.ts",
35
+ "import": "./dist/esign.js"
36
+ },
37
+ "./credit-history": {
38
+ "types": "./dist/credit-history.d.ts",
39
+ "import": "./dist/credit-history.js"
40
+ },
33
41
  "./react": {
34
42
  "types": "./dist/react.d.ts",
35
43
  "import": "./dist/react.js"
@@ -59,16 +67,26 @@
59
67
  "./package.json": "./package.json"
60
68
  },
61
69
  "sideEffects": [
62
- "./src/idv/index.ts",
70
+ "./src/idv/register.ts",
71
+ "./src/idv/chunk-entry.ts",
72
+ "./src/idv/cdn.ts",
63
73
  "./src/idv/cross-device.ts",
64
74
  "./src/idv/cross-device-cdn.ts",
65
- "./src/fraud/index.ts",
66
- "./src/custom-form/index.ts",
75
+ "./src/fraud/register.ts",
76
+ "./src/fraud/cdn.ts",
77
+ "./src/custom-form/register.ts",
78
+ "./src/custom-form/cdn.ts",
79
+ "./src/esign/register.ts",
80
+ "./src/esign/cdn.ts",
81
+ "./src/credit-history/index.ts",
82
+ "./src/credit-history/cdn.ts",
67
83
  "./src/cdn.ts",
68
84
  "./dist/idv.js",
69
85
  "./dist/idv/cross-device.js",
70
86
  "./dist/fraud.js",
71
87
  "./dist/custom-form.js",
88
+ "./dist/esign.js",
89
+ "./dist/credit-history.js",
72
90
  "*.css"
73
91
  ],
74
92
  "files": [
@@ -78,8 +96,8 @@
78
96
  "qrcode-generator": "2.0.4"
79
97
  },
80
98
  "peerDependencies": {
81
- "react": "^19.2.7",
82
- "react-dom": "^19.2.7"
99
+ "react": "^17.0.0 || ^18.0.0 || ^19.0.0",
100
+ "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0"
83
101
  },
84
102
  "peerDependenciesMeta": {
85
103
  "react": {
@@ -90,18 +108,26 @@
90
108
  }
91
109
  },
92
110
  "scripts": {
93
- "build": "tsup && node scripts/generate-agent-steering.mjs && pnpm run build:embed-capture && pnpm run build:embed-challenge && pnpm run build:host-capture && pnpm run build:cross-device",
111
+ "build": "NODE_OPTIONS=--max-old-space-size=6144 tsup && node scripts/generate-agent-steering.mjs && pnpm run build:embed-capture && pnpm run build:embed-challenge && pnpm run build:embed-esign && pnpm run build:embed-credit && pnpm run build:host-capture && pnpm run build:chunks",
94
112
  "build:embed-capture": "node scripts/build-embed-capture.mjs",
95
113
  "build:embed-challenge": "node scripts/build-embed-challenge.mjs",
114
+ "build:embed-esign": "node scripts/build-embed-esign.mjs",
115
+ "build:embed-credit": "node scripts/build-embed-credit.mjs",
96
116
  "build:host-capture": "node scripts/build-host-capture.mjs",
97
- "build:cross-device": "node scripts/build-cross-device.mjs",
117
+ "build:chunks": "node scripts/build-module-chunk.mjs",
98
118
  "test": "vitest run",
99
119
  "typecheck": "tsc --noEmit",
100
120
  "lint": "echo 'lint via tsc'",
101
- "size": "node ../../scripts/audit-bundle-size.mjs ../../services/sdk-cdn/public/v1/sdk.js 106496",
121
+ "size": "node ../../scripts/audit-bundle-size.mjs ../../services/sdk-cdn/public/v1/sdk.js 17408",
102
122
  "size:host-capture": "node ../../scripts/audit-bundle-size.mjs ../../services/sdk-cdn/public/v1/capture.js 82944",
103
123
  "size:host-capture-ui": "node ../../scripts/audit-bundle-size.mjs ../../services/sdk-cdn/public/v1/capture-ui.js 89088",
104
124
  "size:cross-device": "node ../../scripts/audit-bundle-size.mjs ../../services/sdk-cdn/public/v1/cross-device.js 20480",
125
+ "size:credit-host": "node ../../scripts/audit-bundle-size.mjs ../../services/sdk-cdn/public/v1/credit-history.js 6144",
126
+ "size:fraud": "node ../../scripts/audit-bundle-size.mjs ../../services/sdk-cdn/public/v1/fraud.js 6144",
127
+ "size:custom-form": "node ../../scripts/audit-bundle-size.mjs ../../services/sdk-cdn/public/v1/custom-form.js 11264",
128
+ "size:esign": "node ../../scripts/audit-bundle-size.mjs ../../services/sdk-cdn/public/v1/esign.js 14336",
129
+ "size:idv": "node ../../scripts/audit-bundle-size.mjs ../../services/sdk-cdn/public/v1/idv.js 94208",
130
+ "size:embed-credit": "node ../../scripts/audit-bundle-size.mjs ../../services/sdk-cdn/public/v1/embed/credit-entry.js 21504",
105
131
  "size:npm": "node ../../scripts/audit-sdk-entry-size.mjs",
106
132
  "validate:publint": "publint --strict",
107
133
  "validate:attw": "node ../../scripts/validate-sdk-attw.mjs",