@incodetech/core 0.0.0-dev-20260515-ec7243b → 0.0.0-dev-20260515-80ea77b

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 (37) hide show
  1. package/dist/ae-signature.d.ts +1 -1
  2. package/dist/consent.d.ts +47 -47
  3. package/dist/cpf-ocr.d.ts +17 -17
  4. package/dist/curp-validation.d.ts +75 -2
  5. package/dist/curp-validation.esm.js +13 -4
  6. package/dist/{curpValidationStateMachine-BN9UT3zL.esm.js → curpValidationStateMachine-CitWLr2c.esm.js} +221 -98
  7. package/dist/document-capture.d.ts +74 -74
  8. package/dist/document-upload.d.ts +43 -43
  9. package/dist/ekyb.esm.js +3 -3
  10. package/dist/{ekybStateMachine-De42Qutp.esm.js → ekybStateMachine-DYxuz2QY.esm.js} +1 -1
  11. package/dist/electronic-signature.d.ts +1 -1
  12. package/dist/extensibility.esm.js +3 -3
  13. package/dist/flow.d.ts +2 -2
  14. package/dist/flow.esm.js +2 -2
  15. package/dist/{flowServices-BQMlQN1H.esm.js → flowServices-Du8Q3bE4.esm.js} +5 -1
  16. package/dist/home.d.ts +10 -10
  17. package/dist/id-ocr.d.ts +52 -52
  18. package/dist/id-verification.d.ts +25 -25
  19. package/dist/id.esm.js +3 -3
  20. package/dist/{idCaptureManager-BOt9d3Fz.esm.js → idCaptureManager-Csz8P9dH.esm.js} +1 -1
  21. package/dist/{idCaptureStateMachine-DNXJkuyQ.esm.js → idCaptureStateMachine-B-LCI5je.esm.js} +1 -1
  22. package/dist/identity-reuse.d.ts +44 -44
  23. package/dist/{index-BHLL4aAw.d.ts → index-BJL5opOT.d.ts} +119 -119
  24. package/dist/index.d.ts +1 -1
  25. package/dist/index.esm.js +2 -2
  26. package/dist/mandatory-consent.d.ts +50 -50
  27. package/dist/qe-signature.d.ts +1 -1
  28. package/dist/{session-g31RJBDt.esm.js → session-Np-FjqC8.esm.js} +20 -13
  29. package/dist/session.d.ts +78 -1
  30. package/dist/session.esm.js +2 -2
  31. package/dist/{setup-FpVUZIRi.d.ts → setup-C5AITV8m.d.ts} +48 -14
  32. package/dist/{setup-DfIZcesP.esm.js → setup-vPCAg9e5.esm.js} +47 -25
  33. package/dist/wasm.d.ts +1 -1
  34. package/dist/wasm.esm.js +2 -2
  35. package/dist/workflow.d.ts +87 -87
  36. package/dist/workflow.esm.js +5 -5
  37. package/package.json +1 -1
package/dist/index.esm.js CHANGED
@@ -1,11 +1,11 @@
1
- import { a as setup, n as isConfigured, r as reset } from "./setup-DfIZcesP.esm.js";
1
+ import { a as setup, n as isConfigured, r as reset } from "./setup-vPCAg9e5.esm.js";
2
2
  import "./BaseWasmProvider-C_DLEI40.esm.js";
3
3
  import "./WasmUtilProvider-j98OJf-S.esm.js";
4
4
  import "./BrowserTimerProvider-DhNc_x02.esm.js";
5
5
  import "./api-CESGtpbH.esm.js";
6
6
  import "./events-D6-e4vok.esm.js";
7
7
  import "./endpoints-CnN3SyDa.esm.js";
8
- import "./session-g31RJBDt.esm.js";
8
+ import "./session-Np-FjqC8.esm.js";
9
9
  import "./IpifyProvider-D7jx52AL.esm.js";
10
10
  import "./browserSimulation-gxD8cSpM.esm.js";
11
11
 
@@ -3,7 +3,7 @@ import "./Actor-CI32dTbG.js";
3
3
  import "./camera-DBSxa6ML.js";
4
4
  import "./types-CFV9G_7j.js";
5
5
  import { a as RegulationTypes } from "./types-BP1m8VRw.js";
6
- import * as xstate128 from "xstate";
6
+ import * as xstate1168 from "xstate";
7
7
 
8
8
  //#region src/modules/mandatory-consent/types.d.ts
9
9
  type MandatoryConsentConfig = {
@@ -30,7 +30,7 @@ type MandatoryConsentContext = {
30
30
  type MandatoryConsentInput = {
31
31
  config: MandatoryConsentConfig;
32
32
  };
33
- declare const mandatoryConsentMachine: xstate128.StateMachine<MandatoryConsentContext, {
33
+ declare const mandatoryConsentMachine: xstate1168.StateMachine<MandatoryConsentContext, {
34
34
  type: "LOAD";
35
35
  } | {
36
36
  type: "TOGGLE";
@@ -43,53 +43,53 @@ declare const mandatoryConsentMachine: xstate128.StateMachine<MandatoryConsentCo
43
43
  } | {
44
44
  type: "RESET";
45
45
  }, {
46
- [x: string]: xstate128.ActorRefFromLogic<xstate128.PromiseActorLogic<FetchMandatoryConsentResponse, {
46
+ [x: string]: xstate1168.ActorRefFromLogic<xstate1168.PromiseActorLogic<FetchMandatoryConsentResponse, {
47
47
  config: MandatoryConsentConfig;
48
- }, xstate128.EventObject>> | xstate128.ActorRefFromLogic<xstate128.PromiseActorLogic<void, {
48
+ }, xstate1168.EventObject>> | xstate1168.ActorRefFromLogic<xstate1168.PromiseActorLogic<void, {
49
49
  consentId: string;
50
50
  isSigned: boolean;
51
- }, xstate128.EventObject>> | undefined;
52
- }, xstate128.Values<{
51
+ }, xstate1168.EventObject>> | undefined;
52
+ }, xstate1168.Values<{
53
53
  fetchConsent: {
54
54
  src: "fetchConsent";
55
- logic: xstate128.PromiseActorLogic<FetchMandatoryConsentResponse, {
55
+ logic: xstate1168.PromiseActorLogic<FetchMandatoryConsentResponse, {
56
56
  config: MandatoryConsentConfig;
57
- }, xstate128.EventObject>;
57
+ }, xstate1168.EventObject>;
58
58
  id: string | undefined;
59
59
  };
60
60
  submitConsent: {
61
61
  src: "submitConsent";
62
- logic: xstate128.PromiseActorLogic<void, {
62
+ logic: xstate1168.PromiseActorLogic<void, {
63
63
  consentId: string;
64
64
  isSigned: boolean;
65
- }, xstate128.EventObject>;
65
+ }, xstate1168.EventObject>;
66
66
  id: string | undefined;
67
67
  };
68
- }>, xstate128.Values<{
68
+ }>, xstate1168.Values<{
69
69
  setConsent: {
70
70
  type: "setConsent";
71
- params: xstate128.NonReducibleUnknown;
71
+ params: xstate1168.NonReducibleUnknown;
72
72
  };
73
73
  setError: {
74
74
  type: "setError";
75
- params: xstate128.NonReducibleUnknown;
75
+ params: xstate1168.NonReducibleUnknown;
76
76
  };
77
77
  clearError: {
78
78
  type: "clearError";
79
- params: xstate128.NonReducibleUnknown;
80
- };
81
- toggleSigned: {
82
- type: "toggleSigned";
83
- params: xstate128.NonReducibleUnknown;
79
+ params: xstate1168.NonReducibleUnknown;
84
80
  };
85
81
  resetContext: {
86
82
  type: "resetContext";
87
- params: xstate128.NonReducibleUnknown;
83
+ params: xstate1168.NonReducibleUnknown;
84
+ };
85
+ toggleSigned: {
86
+ type: "toggleSigned";
87
+ params: xstate1168.NonReducibleUnknown;
88
88
  };
89
89
  }>, {
90
90
  type: "canSubmit";
91
91
  params: unknown;
92
- }, never, "error" | "idle" | "closed" | "finished" | "loading" | "display" | "submitting", string, MandatoryConsentInput, xstate128.NonReducibleUnknown, xstate128.EventObject, xstate128.MetaObject, {
92
+ }, never, "error" | "idle" | "closed" | "finished" | "loading" | "submitting" | "display", string, MandatoryConsentInput, xstate1168.NonReducibleUnknown, xstate1168.EventObject, xstate1168.MetaObject, {
93
93
  readonly id: "mandatoryConsent";
94
94
  readonly initial: "idle";
95
95
  readonly context: ({
@@ -98,70 +98,70 @@ declare const mandatoryConsentMachine: xstate128.StateMachine<MandatoryConsentCo
98
98
  spawn: {
99
99
  <TSrc extends "fetchConsent" | "submitConsent">(logic: TSrc, ...[options]: ({
100
100
  src: "fetchConsent";
101
- logic: xstate128.PromiseActorLogic<FetchMandatoryConsentResponse, {
101
+ logic: xstate1168.PromiseActorLogic<FetchMandatoryConsentResponse, {
102
102
  config: MandatoryConsentConfig;
103
- }, xstate128.EventObject>;
103
+ }, xstate1168.EventObject>;
104
104
  id: string | undefined;
105
105
  } extends infer T ? T extends {
106
106
  src: "fetchConsent";
107
- logic: xstate128.PromiseActorLogic<FetchMandatoryConsentResponse, {
107
+ logic: xstate1168.PromiseActorLogic<FetchMandatoryConsentResponse, {
108
108
  config: MandatoryConsentConfig;
109
- }, xstate128.EventObject>;
109
+ }, xstate1168.EventObject>;
110
110
  id: string | undefined;
111
111
  } ? T extends {
112
112
  src: TSrc;
113
- } ? xstate128.ConditionalRequired<[options?: ({
113
+ } ? xstate1168.ConditionalRequired<[options?: ({
114
114
  id?: T["id"] | undefined;
115
115
  systemId?: string;
116
- input?: xstate128.InputFrom<T["logic"]> | undefined;
116
+ input?: xstate1168.InputFrom<T["logic"]> | undefined;
117
117
  syncSnapshot?: boolean;
118
- } & { [K in xstate128.RequiredActorOptions<T>]: unknown }) | undefined], xstate128.IsNotNever<xstate128.RequiredActorOptions<T>>> : never : never : never) | ({
118
+ } & { [K in xstate1168.RequiredActorOptions<T>]: unknown }) | undefined], xstate1168.IsNotNever<xstate1168.RequiredActorOptions<T>>> : never : never : never) | ({
119
119
  src: "submitConsent";
120
- logic: xstate128.PromiseActorLogic<void, {
120
+ logic: xstate1168.PromiseActorLogic<void, {
121
121
  consentId: string;
122
122
  isSigned: boolean;
123
- }, xstate128.EventObject>;
123
+ }, xstate1168.EventObject>;
124
124
  id: string | undefined;
125
125
  } extends infer T_1 ? T_1 extends {
126
126
  src: "submitConsent";
127
- logic: xstate128.PromiseActorLogic<void, {
127
+ logic: xstate1168.PromiseActorLogic<void, {
128
128
  consentId: string;
129
129
  isSigned: boolean;
130
- }, xstate128.EventObject>;
130
+ }, xstate1168.EventObject>;
131
131
  id: string | undefined;
132
132
  } ? T_1 extends {
133
133
  src: TSrc;
134
- } ? xstate128.ConditionalRequired<[options?: ({
134
+ } ? xstate1168.ConditionalRequired<[options?: ({
135
135
  id?: T_1["id"] | undefined;
136
136
  systemId?: string;
137
- input?: xstate128.InputFrom<T_1["logic"]> | undefined;
137
+ input?: xstate1168.InputFrom<T_1["logic"]> | undefined;
138
138
  syncSnapshot?: boolean;
139
- } & { [K_1 in xstate128.RequiredActorOptions<T_1>]: unknown }) | undefined], xstate128.IsNotNever<xstate128.RequiredActorOptions<T_1>>> : never : never : never)): xstate128.ActorRefFromLogic<xstate128.GetConcreteByKey<xstate128.Values<{
139
+ } & { [K_1 in xstate1168.RequiredActorOptions<T_1>]: unknown }) | undefined], xstate1168.IsNotNever<xstate1168.RequiredActorOptions<T_1>>> : never : never : never)): xstate1168.ActorRefFromLogic<xstate1168.GetConcreteByKey<xstate1168.Values<{
140
140
  fetchConsent: {
141
141
  src: "fetchConsent";
142
- logic: xstate128.PromiseActorLogic<FetchMandatoryConsentResponse, {
142
+ logic: xstate1168.PromiseActorLogic<FetchMandatoryConsentResponse, {
143
143
  config: MandatoryConsentConfig;
144
- }, xstate128.EventObject>;
144
+ }, xstate1168.EventObject>;
145
145
  id: string | undefined;
146
146
  };
147
147
  submitConsent: {
148
148
  src: "submitConsent";
149
- logic: xstate128.PromiseActorLogic<void, {
149
+ logic: xstate1168.PromiseActorLogic<void, {
150
150
  consentId: string;
151
151
  isSigned: boolean;
152
- }, xstate128.EventObject>;
152
+ }, xstate1168.EventObject>;
153
153
  id: string | undefined;
154
154
  };
155
155
  }>, "src", TSrc>["logic"]>;
156
- <TLogic extends xstate128.AnyActorLogic>(src: TLogic, ...[options]: xstate128.ConditionalRequired<[options?: ({
156
+ <TLogic extends xstate1168.AnyActorLogic>(src: TLogic, ...[options]: xstate1168.ConditionalRequired<[options?: ({
157
157
  id?: never;
158
158
  systemId?: string;
159
- input?: xstate128.InputFrom<TLogic> | undefined;
159
+ input?: xstate1168.InputFrom<TLogic> | undefined;
160
160
  syncSnapshot?: boolean;
161
- } & { [K in xstate128.RequiredLogicInput<TLogic>]: unknown }) | undefined], xstate128.IsNotNever<xstate128.RequiredLogicInput<TLogic>>>): xstate128.ActorRefFromLogic<TLogic>;
161
+ } & { [K in xstate1168.RequiredLogicInput<TLogic>]: unknown }) | undefined], xstate1168.IsNotNever<xstate1168.RequiredLogicInput<TLogic>>>): xstate1168.ActorRefFromLogic<TLogic>;
162
162
  };
163
163
  input: MandatoryConsentInput;
164
- self: xstate128.ActorRef<xstate128.MachineSnapshot<MandatoryConsentContext, {
164
+ self: xstate1168.ActorRef<xstate1168.MachineSnapshot<MandatoryConsentContext, {
165
165
  type: "LOAD";
166
166
  } | {
167
167
  type: "TOGGLE";
@@ -173,7 +173,7 @@ declare const mandatoryConsentMachine: xstate128.StateMachine<MandatoryConsentCo
173
173
  type: "RETRY";
174
174
  } | {
175
175
  type: "RESET";
176
- }, Record<string, xstate128.AnyActorRef | undefined>, xstate128.StateValue, string, unknown, any, any>, {
176
+ }, Record<string, xstate1168.AnyActorRef | undefined>, xstate1168.StateValue, string, unknown, any, any>, {
177
177
  type: "LOAD";
178
178
  } | {
179
179
  type: "TOGGLE";
@@ -185,7 +185,7 @@ declare const mandatoryConsentMachine: xstate128.StateMachine<MandatoryConsentCo
185
185
  type: "RETRY";
186
186
  } | {
187
187
  type: "RESET";
188
- }, xstate128.AnyEventObject>;
188
+ }, xstate1168.AnyEventObject>;
189
189
  }) => {
190
190
  config: MandatoryConsentConfig;
191
191
  consent: undefined;
@@ -222,7 +222,7 @@ declare const mandatoryConsentMachine: xstate128.StateMachine<MandatoryConsentCo
222
222
  } | {
223
223
  type: "RESET";
224
224
  };
225
- self: xstate128.ActorRef<xstate128.MachineSnapshot<MandatoryConsentContext, {
225
+ self: xstate1168.ActorRef<xstate1168.MachineSnapshot<MandatoryConsentContext, {
226
226
  type: "LOAD";
227
227
  } | {
228
228
  type: "TOGGLE";
@@ -234,7 +234,7 @@ declare const mandatoryConsentMachine: xstate128.StateMachine<MandatoryConsentCo
234
234
  type: "RETRY";
235
235
  } | {
236
236
  type: "RESET";
237
- }, Record<string, xstate128.AnyActorRef>, xstate128.StateValue, string, unknown, any, any>, {
237
+ }, Record<string, xstate1168.AnyActorRef>, xstate1168.StateValue, string, unknown, any, any>, {
238
238
  type: "LOAD";
239
239
  } | {
240
240
  type: "TOGGLE";
@@ -246,7 +246,7 @@ declare const mandatoryConsentMachine: xstate128.StateMachine<MandatoryConsentCo
246
246
  type: "RETRY";
247
247
  } | {
248
248
  type: "RESET";
249
- }, xstate128.AnyEventObject>;
249
+ }, xstate1168.AnyEventObject>;
250
250
  }) => {
251
251
  config: MandatoryConsentConfig;
252
252
  };
@@ -299,7 +299,7 @@ declare const mandatoryConsentMachine: xstate128.StateMachine<MandatoryConsentCo
299
299
  } | {
300
300
  type: "RESET";
301
301
  };
302
- self: xstate128.ActorRef<xstate128.MachineSnapshot<MandatoryConsentContext, {
302
+ self: xstate1168.ActorRef<xstate1168.MachineSnapshot<MandatoryConsentContext, {
303
303
  type: "LOAD";
304
304
  } | {
305
305
  type: "TOGGLE";
@@ -311,7 +311,7 @@ declare const mandatoryConsentMachine: xstate128.StateMachine<MandatoryConsentCo
311
311
  type: "RETRY";
312
312
  } | {
313
313
  type: "RESET";
314
- }, Record<string, xstate128.AnyActorRef>, xstate128.StateValue, string, unknown, any, any>, {
314
+ }, Record<string, xstate1168.AnyActorRef>, xstate1168.StateValue, string, unknown, any, any>, {
315
315
  type: "LOAD";
316
316
  } | {
317
317
  type: "TOGGLE";
@@ -323,7 +323,7 @@ declare const mandatoryConsentMachine: xstate128.StateMachine<MandatoryConsentCo
323
323
  type: "RETRY";
324
324
  } | {
325
325
  type: "RESET";
326
- }, xstate128.AnyEventObject>;
326
+ }, xstate1168.AnyEventObject>;
327
327
  }) => {
328
328
  consentId: string;
329
329
  isSigned: boolean;
@@ -1,6 +1,6 @@
1
1
  import { t as Manager } from "./Manager-C8PrhBOx.js";
2
2
  import "./Actor-CI32dTbG.js";
3
- import { c as ConsentKey, f as QE_CONSENT_KEYS, g as getDefaultConsentChecks, i as electronicSignatureMachine, l as ElectronicSignatureConfig, m as areAllConsented, n as ElectronicSignatureState, s as ConsentChecks, u as ElectronicSignatureDocument } from "./index-BHLL4aAw.js";
3
+ import { c as ConsentKey, f as QE_CONSENT_KEYS, g as getDefaultConsentChecks, i as electronicSignatureMachine, l as ElectronicSignatureConfig, m as areAllConsented, n as ElectronicSignatureState, s as ConsentChecks, u as ElectronicSignatureDocument } from "./index-BJL5opOT.js";
4
4
 
5
5
  //#region src/modules/qe-signature/index.d.ts
6
6
 
@@ -1,5 +1,5 @@
1
- import { n as getApi, t as api } from "./api-CESGtpbH.esm.js";
2
- import { h as addEvent } from "./events-D6-e4vok.esm.js";
1
+ import { n as getApi, r as getToken, s as setToken, t as api } from "./api-CESGtpbH.esm.js";
2
+ import { g as getAnalyticsBatcher, h as addEvent } from "./events-D6-e4vok.esm.js";
3
3
  import { t as endpoints } from "./endpoints-CnN3SyDa.esm.js";
4
4
  import { n as resetIpifyCache, r as BrowserEnvironmentProvider, t as IpifyProvider } from "./IpifyProvider-D7jx52AL.esm.js";
5
5
  import { t as isBrowserSimulation } from "./browserSimulation-gxD8cSpM.esm.js";
@@ -3036,7 +3036,7 @@ function resetFeatureConfigCache() {
3036
3036
 
3037
3037
  //#endregion
3038
3038
  //#region src/internal/version/sdkVersion.ts
3039
- const SDK_VERSION = "0.0.0-dev-20260515-ec7243b";
3039
+ const SDK_VERSION = "0.0.0-dev-20260515-80ea77b";
3040
3040
 
3041
3041
  //#endregion
3042
3042
  //#region src/internal/fingerprint/fingerprintService.ts
@@ -3077,24 +3077,26 @@ let cachedFingerprintSuccess = false;
3077
3077
  let cachedFingerprintResult;
3078
3078
  let sessionInitPromise = null;
3079
3079
  /**
3080
- * Initializes session-level services after the token is set.
3081
- * This should be called once after createSession() or setToken().
3080
+ * Activates a session by setting the auth token on the HTTP client and
3081
+ * preloading session-scoped state.
3082
3082
  *
3083
3083
  * Performs:
3084
- * 1. Fetches feature configuration from backend
3085
- * 2. Submits device fingerprint
3084
+ * 1. Sets the token (and clears stale session-init cache if the token changed)
3085
+ * 2. Fetches feature configuration from backend
3086
+ * 3. Submits device fingerprint
3087
+ * 4. Starts the analytics batcher so buffered events are flushed
3086
3088
  *
3087
- * Results are cached for the session lifetime.
3089
+ * Results are cached per token. Calling again with the same token returns the
3090
+ * cached result; calling with a different token re-initializes from scratch.
3088
3091
  *
3089
- * @param options - Optional configuration
3092
+ * @param options - Session activation options (`token` required)
3090
3093
  * @returns Session initialization result with feature config
3091
3094
  *
3092
3095
  * @example
3093
3096
  * ```ts
3094
- * // After creating a session
3097
+ * await setup({ apiURL: 'https://api.incode.com' });
3095
3098
  * const session = await createSession('api-key', options);
3096
- * setup({ apiURL, token: session.token });
3097
- * const { features } = await initializeSession();
3099
+ * const { features } = await initializeSession({ token: session.token });
3098
3100
  *
3099
3101
  * // Check feature flags
3100
3102
  * if (isFeatureEnabled('DISABLE_IPIFY', features.features)) {
@@ -3103,7 +3105,11 @@ let sessionInitPromise = null;
3103
3105
  * ```
3104
3106
  */
3105
3107
  async function initializeSession(options = {}) {
3106
- const { hostingApp, signal } = options;
3108
+ const { token, hostingApp, signal } = options;
3109
+ if (token !== void 0 && token !== getToken()) {
3110
+ setToken(token);
3111
+ resetSessionInit();
3112
+ }
3107
3113
  if (sessionInitialized && cachedFeatures) return {
3108
3114
  features: cachedFeatures,
3109
3115
  disableIpify: cachedDisableIpify,
@@ -3167,6 +3173,7 @@ async function initializeSession(options = {}) {
3167
3173
  };
3168
3174
  })().finally(() => {
3169
3175
  sessionInitPromise = null;
3176
+ getAnalyticsBatcher()?.start();
3170
3177
  });
3171
3178
  return sessionInitPromise;
3172
3179
  }
package/dist/session.d.ts CHANGED
@@ -1,5 +1,17 @@
1
+ import "./camera-DBSxa6ML.js";
2
+ import "./types-CFV9G_7j.js";
3
+ import { a as RegulationTypes } from "./types-BP1m8VRw.js";
1
4
  import { n as GetFinishStatusFn, r as getFinishStatus, t as FinishStatus } from "./flowCompletionService-DhkT4SRY.js";
2
5
 
6
+ //#region src/internal/fingerprint/types.d.ts
7
+
8
+ type DeviceFingerprintResult = {
9
+ success: boolean;
10
+ sessionStatus: string;
11
+ showMandatoryConsent?: boolean;
12
+ regulationType?: RegulationTypes;
13
+ };
14
+ //#endregion
3
15
  //#region src/internal/session/sessionService.d.ts
4
16
  type CreateSessionOptions = {
5
17
  /** The configuration/flow ID from the Incode dashboard */
@@ -137,4 +149,69 @@ declare function refreshQrUrlUuid(options: RefreshQrUrlUuidOptions, signal?: Abo
137
149
  */
138
150
  declare function bootstrapSession(apiKey: string, options: BootstrapSessionOptions, signal?: AbortSignal): Promise<Session>;
139
151
  //#endregion
140
- export { type BootstrapSessionOptions, type CreateSessionOptions, type FinishStatus, type GetFinishStatusFn, QR_VALIDATION_ERROR_CODES, QrValidationError, type QrValidationErrorCode, type QrValidationResult, type RefreshQrUrlUuidOptions, type Session, type ValidateQrUuidOptions, bootstrapSession, createSession, getFinishStatus, refreshQrUrlUuid, validateQrUuid };
152
+ //#region src/internal/featureConfig/types.d.ts
153
+ type FeatureName = 'VIDEO_SELFIE_V2' | 'USE_CLIENT_GLARE' | 'USE_OPEN_VIDU' | 'DISABLE_IPIFY';
154
+ type FeatureConfig = {
155
+ enabled: boolean;
156
+ feature: FeatureName;
157
+ config?: number | string;
158
+ };
159
+ type Features = {
160
+ features?: FeatureConfig[];
161
+ sessionIdentifier: string;
162
+ };
163
+ //#endregion
164
+ //#region src/internal/session/sessionInitializer.d.ts
165
+ type SessionInitOptions = {
166
+ /**
167
+ * Session token returned by `createSession`. Persisted on the HTTP client
168
+ * for the rest of the session.
169
+ *
170
+ * Optional only for internal re-triggers from inside flow/workflow loaders,
171
+ * where the token was already activated by an earlier `initializeSession`
172
+ * call. When omitted the function falls back to the currently registered
173
+ * token. Application code should always pass `token` explicitly.
174
+ */
175
+ token?: string;
176
+ /** Custom hosting app name for fingerprint */
177
+ hostingApp?: string;
178
+ /** Abort signal for cancellation */
179
+ signal?: AbortSignal;
180
+ };
181
+ type SessionInitResult = {
182
+ features: Features;
183
+ disableIpify: boolean;
184
+ fingerprintSuccess: boolean;
185
+ fingerprintResult: DeviceFingerprintResult | undefined;
186
+ };
187
+ /**
188
+ * Activates a session by setting the auth token on the HTTP client and
189
+ * preloading session-scoped state.
190
+ *
191
+ * Performs:
192
+ * 1. Sets the token (and clears stale session-init cache if the token changed)
193
+ * 2. Fetches feature configuration from backend
194
+ * 3. Submits device fingerprint
195
+ * 4. Starts the analytics batcher so buffered events are flushed
196
+ *
197
+ * Results are cached per token. Calling again with the same token returns the
198
+ * cached result; calling with a different token re-initializes from scratch.
199
+ *
200
+ * @param options - Session activation options (`token` required)
201
+ * @returns Session initialization result with feature config
202
+ *
203
+ * @example
204
+ * ```ts
205
+ * await setup({ apiURL: 'https://api.incode.com' });
206
+ * const session = await createSession('api-key', options);
207
+ * const { features } = await initializeSession({ token: session.token });
208
+ *
209
+ * // Check feature flags
210
+ * if (isFeatureEnabled('DISABLE_IPIFY', features.features)) {
211
+ * // Handle disabled ipify
212
+ * }
213
+ * ```
214
+ */
215
+ declare function initializeSession(options?: SessionInitOptions): Promise<SessionInitResult>;
216
+ //#endregion
217
+ export { type BootstrapSessionOptions, type CreateSessionOptions, type FinishStatus, type GetFinishStatusFn, QR_VALIDATION_ERROR_CODES, QrValidationError, type QrValidationErrorCode, type QrValidationResult, type RefreshQrUrlUuidOptions, type Session, type SessionInitOptions, type SessionInitResult, type ValidateQrUuidOptions, bootstrapSession, createSession, getFinishStatus, initializeSession, refreshQrUrlUuid, validateQrUuid };
@@ -1,9 +1,9 @@
1
1
  import "./api-CESGtpbH.esm.js";
2
2
  import "./events-D6-e4vok.esm.js";
3
3
  import "./endpoints-CnN3SyDa.esm.js";
4
- import { c as QrValidationError, d as refreshQrUrlUuid, f as validateQrUuid, l as bootstrapSession, s as QR_VALIDATION_ERROR_CODES, u as createSession } from "./session-g31RJBDt.esm.js";
4
+ import { c as QrValidationError, d as refreshQrUrlUuid, f as validateQrUuid, l as bootstrapSession, r as initializeSession, s as QR_VALIDATION_ERROR_CODES, u as createSession } from "./session-Np-FjqC8.esm.js";
5
5
  import "./IpifyProvider-D7jx52AL.esm.js";
6
6
  import "./browserSimulation-gxD8cSpM.esm.js";
7
7
  import { t as getFinishStatus } from "./flowCompletionService-P54yzGvA.esm.js";
8
8
 
9
- export { QR_VALIDATION_ERROR_CODES, QrValidationError, bootstrapSession, createSession, getFinishStatus, refreshQrUrlUuid, validateQrUuid };
9
+ export { QR_VALIDATION_ERROR_CODES, QrValidationError, bootstrapSession, createSession, getFinishStatus, initializeSession, refreshQrUrlUuid, validateQrUuid };
@@ -57,7 +57,16 @@ type EncryptionOptions = {
57
57
  type SetupOptions = {
58
58
  /** The base URL for the API. When omitted, no HTTP client is created — useful when all API actors are overridden via .provide(). */
59
59
  apiURL?: string;
60
- /** The session token for API requests (optional - can be set later or omitted for createSession calls) */
60
+ /**
61
+ * The session token for API requests.
62
+ *
63
+ * Optional convenience — when provided, `setup` delegates to
64
+ * `initializeSession({ token, hostingApp })` after the HTTP client is in
65
+ * place. Equivalent to calling `initializeSession` yourself after
66
+ * `setup({ apiURL })` returns, which is the preferred shape when you want to
67
+ * own the moment the session is activated (e.g. between `createSession` and
68
+ * mounting `<incode-flow>`).
69
+ */
61
70
  token?: string;
62
71
  /** Custom headers to include in all requests */
63
72
  customHeaders?: Record<string, string>;
@@ -120,43 +129,63 @@ type SetupOptions = {
120
129
  *
121
130
  * WASM loads only when `options.wasm` is provided as an object.
122
131
  *
132
+ * `setup` is boot — it provisions the HTTP client, the optional E2EE
133
+ * handshake, WASM warmup, and the analytics batcher. The session token is a
134
+ * separate concern: hand it off via `initializeSession({ token })` from
135
+ * `@incodetech/core/session`, or pass it inline as `setup({ apiURL, token })`
136
+ * (a convenience that delegates to `initializeSession` for you).
137
+ *
123
138
  * @param options - Configuration options for the SDK
124
139
  *
125
- * @example
140
+ * @example Boot first, activate the session later (preferred)
126
141
  * ```ts
127
142
  * import { setup } from '@incodetech/core';
143
+ * import { createSession, initializeSession } from '@incodetech/core/session';
128
144
  *
129
- * // Zero-config: no WASM warmup
145
+ * await setup({ apiURL: 'https://api.incode.com' });
146
+ * const session = await createSession(apiKey, { configurationId });
147
+ * await initializeSession({ token: session.token });
148
+ * ```
149
+ *
150
+ * @example One-shot convenience
151
+ * ```ts
130
152
  * await setup({ apiURL: 'https://api.incode.com', token: 'session-token' });
153
+ * ```
131
154
  *
132
- * // Explicitly disable WASM
133
- * await setup({ apiURL: 'https://api.incode.com', token: 'session-token', wasm: false });
155
+ * @example Explicitly disable WASM
156
+ * ```ts
157
+ * await setup({ apiURL: 'https://api.incode.com', wasm: false });
158
+ * ```
134
159
  *
135
- * // Use CDN defaults for paths and preload only one pipeline
160
+ * @example Use CDN defaults for paths and preload only one pipeline
161
+ * ```ts
136
162
  * await setup({
137
163
  * apiURL: 'https://api.incode.com',
138
- * token: 'session-token',
139
164
  * wasm: { pipelines: ['selfie'] },
140
165
  * });
166
+ * ```
141
167
  *
142
- * // Self-hosted / custom version (full or partial path overrides)
168
+ * @example Self-hosted / custom version (full or partial path overrides)
169
+ * ```ts
143
170
  * await setup({
144
171
  * apiURL: 'https://api.incode.com',
145
- * token: 'session-token',
146
172
  * wasm: {
147
173
  * wasmPath: '/my-cdn/webLib.wasm',
148
174
  * glueCodePath: '/my-cdn/webLib.js',
149
175
  * },
150
176
  * });
177
+ * ```
151
178
  *
152
- * // Partial override: only models path, rest from CDN
179
+ * @example Partial override: only models path, rest from CDN
180
+ * ```ts
153
181
  * await setup({
154
182
  * apiURL: 'https://api.incode.com',
155
- * token: 'session-token',
156
183
  * wasm: { modelsBasePath: 'https://my-cdn/models' },
157
184
  * });
185
+ * ```
158
186
  *
159
- * // Sessionless setup (all API actors overridden via .provide())
187
+ * @example Sessionless setup (all API actors overridden via .provide())
188
+ * ```ts
160
189
  * await setup({
161
190
  * wasm: {
162
191
  * wasmPath: '/wasm/ml-wasm.wasm',
@@ -164,15 +193,20 @@ type SetupOptions = {
164
193
  * pipelines: ['selfie'],
165
194
  * },
166
195
  * });
196
+ * ```
167
197
  *
168
- * // Enable end-to-end encryption at boot (defaults to MGF1 = SHA-1)
198
+ * @example Enable end-to-end encryption at boot (defaults to MGF1 = SHA-1)
199
+ * ```ts
169
200
  * await setup({ apiURL: 'https://api.incode.com', encryption: true });
201
+ * ```
170
202
  *
171
- * // Enable encryption with the SHA-256 MGF1 padding
203
+ * @example Enable encryption with the SHA-256 MGF1 padding
204
+ * ```ts
172
205
  * await setup({
173
206
  * apiURL: 'https://api.incode.com',
174
207
  * encryption: { mgf1: 'sha256' },
175
208
  * });
209
+ * ```
176
210
  */
177
211
  declare function setup(options: SetupOptions): Promise<void>;
178
212
  /**