@corbado/observe 1.10.0 → 1.11.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 (47) hide show
  1. package/dist/analysis/client.mjs +37 -1605
  2. package/dist/analysis/config.mjs +1 -4
  3. package/dist/analysis/default-tracker.mjs +16 -0
  4. package/dist/analysis/device.mjs +0 -79
  5. package/dist/analysis/index.mjs +29 -41
  6. package/dist/analysis/low-events/grouped-input-tracker.mjs +2 -3
  7. package/dist/analysis/low-events/input-change-recorder.mjs +35 -12
  8. package/dist/analysis/low-events/input-tracker.mjs +0 -58
  9. package/dist/analysis/plugins/cookie-storage.mjs +11 -0
  10. package/dist/analysis/plugins/cross-origin-session.mjs +171 -0
  11. package/dist/analysis/plugins/probes.mjs +69 -0
  12. package/dist/analysis/plugins/raw-errors.mjs +8 -0
  13. package/dist/analysis/probe-lane.mjs +175 -0
  14. package/dist/analysis/queue.mjs +18 -141
  15. package/dist/analysis/readers/network.mjs +5 -0
  16. package/dist/analysis/session-keys.mjs +11 -0
  17. package/dist/analysis/tracker-core.mjs +1352 -0
  18. package/dist/analysis/tracker-features.mjs +80 -0
  19. package/dist/analysis/tracker-functions.mjs +103 -0
  20. package/dist/analysis/transports/fetch.mjs +16 -1
  21. package/dist/analysis/utils/appconfirmation-operation-full.mjs +5 -1
  22. package/dist/analysis/utils/captcha-operation-full.mjs +5 -1
  23. package/dist/analysis/utils/email-link-operation-full.mjs +9 -1
  24. package/dist/analysis/utils/email-otp-operation-full.mjs +5 -1
  25. package/dist/analysis/utils/form-operation-full.mjs +5 -1
  26. package/dist/analysis/utils/key-operation-full.mjs +9 -1
  27. package/dist/analysis/utils/operation-full-provide-identifier-with-cui.mjs +8 -1
  28. package/dist/analysis/utils/operation-full.mjs +4 -3
  29. package/dist/analysis/utils/passkey-deletion-operation-full.mjs +5 -1
  30. package/dist/analysis/utils/passkey-enrollment-operation-full.mjs +5 -1
  31. package/dist/analysis/utils/passkey-login-operation-full.mjs +5 -1
  32. package/dist/analysis/utils/password-enrollment-operation-full.mjs +5 -1
  33. package/dist/analysis/utils/password-login-operation-full.mjs +5 -1
  34. package/dist/analysis/utils/provide-data-operation-full.mjs +5 -1
  35. package/dist/analysis/utils/sms-otp-operation-full.mjs +5 -1
  36. package/dist/analysis/utils/social-operation-login.mjs +5 -1
  37. package/dist/analysis/utils/sso-operation-login.mjs +5 -1
  38. package/dist/analysis/utils/totp-operation-full.mjs +5 -1
  39. package/dist/analysis/utils/trusted-device-operation-full.mjs +9 -1
  40. package/dist/analysis/version.mjs +1 -1
  41. package/dist/cdn/script.global.js +4 -4
  42. package/dist/index.d.mts +1349 -888
  43. package/dist/index.d.ts +1349 -888
  44. package/dist/index.js +4 -4
  45. package/dist/index.mjs +4 -4
  46. package/package.json +1 -1
  47. package/dist/analysis/readers/password-manager-dom.mjs +0 -112
package/dist/index.d.ts CHANGED
@@ -716,14 +716,12 @@ interface FixedDataConfig {
716
716
  /**
717
717
  * Password-manager detection.
718
718
  *
719
- * - `true`: the extension probes (reported as {@link Event.passwordManagers}) and the DOM
720
- * password-manager scan (`pa-1`..`pa-6` lows) run.
721
- * - `false`: neither runs.
722
- * - omitted (with `fixedDataConfig` given): the extension probes are off (`pmd` resolves to `false`,
723
- * regardless of the built-in default, `sdkConfig.pmd` and the server config); the DOM scan keeps
724
- * today's behaviour and runs.
719
+ * - `true`: the extension probes run (reported as {@link Event.passwordManagers}).
720
+ * - `false`: they do not run.
721
+ * - omitted (with `fixedDataConfig` given): they are off (`pmd` resolves to `false`, regardless of the
722
+ * built-in default, `sdkConfig.pmd` and the server config).
725
723
  *
726
- * Without `fixedDataConfig` the probes follow the server's `pmd` and the DOM scan always runs.
724
+ * Without `fixedDataConfig` the probes follow the server's `pmd`.
727
725
  */
728
726
  pmd?: boolean;
729
727
  /**
@@ -798,122 +796,6 @@ type SdkReliabilityConfigOverrides = Partial<Omit<SdkReliabilityConfig, "retry"
798
796
  pmd?: boolean;
799
797
  };
800
798
 
801
- /**
802
- * Where low events go. `flushKeepalive` is requested on `pagehide` teardown so lows batched after
803
- * the queue's own lifecycle flush still get out; operations wire it to the client's
804
- * `lowEventFlushKeepalive()`, which is gated by the server-controlled `tlf` trigger switch
805
- * (default true = historical behavior, can be disabled remotely).
806
- */
807
- interface LowEventSink {
808
- reserveCaptureSeq?(): number;
809
- enqueueLowEvent(low: LowEvent): void;
810
- flushKeepalive(): void;
811
- registerInputs?(fields: readonly HTMLInputElement[], flush: () => void): () => void;
812
- beginCeremony?(initiator?: LowEventInitiator): {
813
- settle(tailMs: number): void;
814
- destroy(): void;
815
- };
816
- /**
817
- * Whether the DOM password-manager scan (`pa-1`..`pa-6` lows) may run. Absent or true keeps the
818
- * historical behaviour (always scan); false only under `fixedDataConfig` with `pmd` explicitly
819
- * `false` (an omitted `pmd` keeps the scan on).
820
- */
821
- passwordManagerDomScan?(): boolean;
822
- }
823
-
824
- /**
825
- * Limits for optional raw-error serialization. Modeled on Sentry's client options
826
- * (`normalizeDepth`, `normalizeMaxBreadth`, `maxValueLength`, `normalizeToSize`, the
827
- * stack-frame limit and the linked-errors limit) with defaults tuned for an authentication
828
- * event stream rather than an error monitor. Every value is clamped to {@link RAW_ERROR_BOUNDS};
829
- * invalid values fall back to the default. A fixed 1024-node budget per depth attempt and
830
- * incremental text-byte accounting also bound work before the final JSON-size check.
831
- */
832
- type SerializeRawErrorOptions = {
833
- /** Include `stack` strings. Default false. */
834
- stack?: boolean;
835
- /** Stack lines kept after the header line when `stack` is on. Default 50 (Sentry: 50). */
836
- maxStackFrames?: number;
837
- /** Object nesting depth below the envelope. Default 3 (Sentry `normalizeDepth`: 3). */
838
- depth?: number;
839
- /** Keys per object and items per array, Map or Set. Default 30 (Sentry `normalizeMaxBreadth`: 1000). */
840
- maxBreadth?: number;
841
- /** Characters kept per string. Default 1024 (Sentry `maxValueLength`: 250). */
842
- maxValueLength?: number;
843
- /** `cause` hops followed. Default 3 (Sentry linked errors: 5, Datadog: 10). */
844
- maxCauseDepth?: number;
845
- /** Maximum UTF-8 JSON size in bytes. Depth is reduced until the output fits; omit diagnostics that cannot fit. Default 32768 (Sentry `normalizeToSize`: 100 KiB). */
846
- maxBytes?: number;
847
- };
848
- /** Envelope produced by {@link serializeRawError}. */
849
- type RawErrorEnvelope = {
850
- /** Class tag of the original value: `DOMException`, `Error`, `Object`, `Response`, `number`, `null`, `unserializable`, … */
851
- type: string;
852
- /** Bounded plain-JSON copy of the value; absent when it could not be serialized within the limits. */
853
- value?: unknown;
854
- /** Set when even the shallowest serialization exceeded `maxBytes`. */
855
- truncated?: true;
856
- };
857
- type Limits = Required<Omit<SerializeRawErrorOptions, "stack">> & {
858
- stack: boolean;
859
- };
860
- /** Inclusive bounds for every numeric limit; defaults sit inside them. */
861
- declare const RAW_ERROR_BOUNDS: {
862
- readonly maxStackFrames: {
863
- readonly min: 1;
864
- readonly max: 100;
865
- readonly default: 50;
866
- };
867
- readonly depth: {
868
- readonly min: 0;
869
- readonly max: 10;
870
- readonly default: 3;
871
- };
872
- readonly maxBreadth: {
873
- readonly min: 1;
874
- readonly max: 1000;
875
- readonly default: 30;
876
- };
877
- readonly maxValueLength: {
878
- readonly min: 1;
879
- readonly max: 10000;
880
- readonly default: 1024;
881
- };
882
- readonly maxCauseDepth: {
883
- readonly min: 0;
884
- readonly max: 10;
885
- readonly default: 3;
886
- };
887
- readonly maxBytes: {
888
- readonly min: 0;
889
- readonly max: 65536;
890
- readonly default: 32768;
891
- };
892
- };
893
- /** Resolve caller options into clamped limits. Exported for tests and integrations that want to inspect the effective values. */
894
- declare function resolveRawErrorLimits(options?: SerializeRawErrorOptions): Limits;
895
- /**
896
- * Serialize an arbitrary thrown value for the `rawError` diagnostic field.
897
- *
898
- * Copies standard error fields and serializable own properties within the configured limits.
899
- * Standard fields are read through the prototype chain so DOMException and cross-realm errors
900
- * serialize. Output is plain JSON, bounded in depth, breadth, string length, cause chain and
901
- * UTF-8 size, and never throws.
902
- *
903
- * The result is an envelope `{ type, value }`: `type` is the value's class tag (`DOMException`,
904
- * `Error`, `Object`, `number`, …) and `value` is a bounded diagnostic copy. Keeping the class tag
905
- * outside value preserves the library's own `type` field. When the value cannot be serialized
906
- * within the limits the envelope carries `truncated: true` or the type `unserializable` and no
907
- * `value`.
908
- *
909
- * Stacks are omitted unless `stack: true`; they carry page URLs and add the most bytes.
910
- * Binary data (ArrayBuffer, typed arrays) is reported by type and length only, never by content.
911
- *
912
- * @param value - Original thrown value or an explicit diagnostic projection.
913
- * @param options - Limits; see {@link SerializeRawErrorOptions} for defaults and {@link RAW_ERROR_BOUNDS} for clamping.
914
- */
915
- declare function serializeRawError(value: unknown, options?: SerializeRawErrorOptions): RawErrorEnvelope | undefined;
916
-
917
799
  /** Sink that escalates a diagnostic message to the telemetry stream. */
918
800
  type TelemetrySink = (level: TelemetryLevel, message: string) => void;
919
801
  interface Logger {
@@ -936,152 +818,6 @@ interface CreateLoggerOptions {
936
818
  }
937
819
  declare function createLogger(options: CreateLoggerOptions): Logger;
938
820
 
939
- /** Ceremony context lease on the shared observer. Never installs its own window listeners. */
940
- declare class LowEventWindowTracker {
941
- private logger;
942
- private sink;
943
- private lease?;
944
- private destroyed;
945
- constructor(logger: Logger, sink: LowEventSink);
946
- arm(initiator?: LowEventInitiator, conditional?: boolean): void;
947
- scheduleDisarm(delayMs: number): void;
948
- disarm(): void;
949
- destroy(): void;
950
- }
951
-
952
- /**
953
- * How long window low-event listeners stay armed after a ceremony settles: focus return and
954
- * picker dismiss animations land shortly after the WebAuthn promise resolves/rejects.
955
- */
956
- declare const CEREMONY_LOW_EVENT_TAIL_MS = 1500;
957
- /**
958
- * Optional diagnostic context for both normal and typed step errors.
959
- *
960
- * Use `rawError` when a library error contains useful context beyond its classified name,
961
- * code and message, such as a nested cause, an error array or a response status.
962
- * Serialization requires SDK config `rawErrors: true` (default true). Config refreshes apply
963
- * to subsequent errors; diagnostics already queued are unchanged.
964
- * It is emitted as a bounded `{ type, value }` envelope in `stepData.rawError` for raw-event
965
- * inspection. The envelope type describes the JavaScript value; the library's own fields
966
- * stay inside value. See {@link serializeRawError} for serialization limits.
967
- *
968
- * @remarks
969
- * The first argument to `.error()` or `.errorTyped()` supplies the classified diagnostic.
970
- * `rawError` does not fill missing classified fields or affect outcomes, error-group assignment
971
- * or severity: a code-only typed error remains code-only even if its raw diagnostic has a name
972
- * and message. Existing StepOptions such as userReference and explicitTimestamp can accompany
973
- * rawError; calls without it behave as before.
974
- *
975
- * Supply a deliberate diagnostic object without credentials, cookies or personal data.
976
- * Arrays retain their structure in rawError; arrays passed directly to `.error()` become a
977
- * string message. Keep the original error for application handling; serialization makes a copy.
978
- *
979
- * @example
980
- * ```ts
981
- * // Normal error with additional provider context.
982
- * passkey.ceremony.error(originalError, { rawError: providerDiagnostic });
983
- *
984
- * // Typed error with the original error available for inspection.
985
- * password.postResponse.errorTyped(
986
- * { code: "invalid_password" },
987
- * { rawError: originalError },
988
- * );
989
- *
990
- * // A classified code and message plus additional raw context.
991
- * password.postResponse.error(
992
- * { code: "invalid_password", name: "AuthenticationError", message: "The password was rejected" },
993
- * { rawError: providerDiagnostic },
994
- * );
995
- * ```
996
- */
997
- type ErrorStepOptions = StepOptions & {
998
- /** Explicit opt-in. Serialized with bounded depth and UTF-8 size; stacks are omitted by default and binary contents are summarized. */
999
- rawError?: unknown;
1000
- /** Per-call limits for `rawError` serialization (depth, breadth, string length, cause chain, bytes, stack). See {@link SerializeRawErrorOptions}. */
1001
- rawErrorLimits?: SerializeRawErrorOptions;
1002
- };
1003
- type StepHelper<TStart = {}, TFinished = {}, TTypedError = never> = {
1004
- start: (data: TStart, options?: StepOptions) => void;
1005
- finished: (data: TFinished, options?: StepOptions) => void;
1006
- error: (error: unknown, options?: ErrorStepOptions) => void;
1007
- } & ([TTypedError] extends [never] ? {} : {
1008
- errorTyped: (error: TTypedError, options?: ErrorStepOptions) => void;
1009
- });
1010
- declare abstract class OperationFull {
1011
- private tracker;
1012
- private operationName;
1013
- private startReference?;
1014
- private captureSpecType?;
1015
- private captureSessionId?;
1016
- private readonly lowFlushers;
1017
- private readonly lowPrefillCapturers;
1018
- protected lowEventSink(sourceKind: LowEventSourceKind, fieldRole?: LowEventFieldRole): LowEventSink;
1019
- protected createLowCollector<T extends {
1020
- capturePrefill(newCapture?: boolean): void;
1021
- }>(create: () => T): T | undefined;
1022
- protected registerLowFlusher(flush: () => void): void;
1023
- private captureOptions;
1024
- constructor(tracker: CorbadoTracker, operationName: SubflowType);
1025
- /** Anchor (subflowStartEventId) of the current start; undefined before the first start. */
1026
- protected get captureReference(): string | undefined;
1027
- /** Session the current start was tracked under. */
1028
- protected get captureSession(): string | undefined;
1029
- /**
1030
- * Continue an attempt started elsewhere (e.g. on another page of the same session) without
1031
- * emitting a subflow_started: later steps and low events carry the given anchor and session.
1032
- */
1033
- protected adoptCapture(reference: string, sessionId: string, specType?: string): void;
1034
- /**
1035
- * Emits an additional subflow_started; construction already emits the initial start.
1036
- * `data` supports SubflowTrigger fields (`actor`, `explicitSpecType`, `ignoreAsInteraction`)
1037
- * plus free-form extras; see SubflowTrigger for programmatic interaction suppression.
1038
- */
1039
- subflowStart(data: any, options?: StepOptions): void;
1040
- /**
1041
- * Capture values initialized by the application after constructing this operation, without
1042
- * dispatching DOM input events. Call immediately after initialization, before user editing.
1043
- * Each field/group emits at most one prefill per subflow start; values are never recorded.
1044
- */
1045
- capturePrefill(): void;
1046
- private captureInputPrefills;
1047
- /**
1048
- * @deprecated `subflow_trigger` will be removed in the next major version.
1049
- */
1050
- trigger(data: SubflowTrigger, options?: StepOptions): void;
1051
- customStep<TStart = {}, TFinished = {}>(stepName: string): StepHelper<TStart, TFinished>;
1052
- protected subflowStepStarted(stepName: string, data: any, options?: StepOptions, ignoreAsInteraction?: boolean): void;
1053
- protected subflowStepFinished(stepName: string, data: any, options?: StepOptions): void;
1054
- protected subflowStepError(stepName: string, data: any, options?: ErrorStepOptions): void;
1055
- /**
1056
- * Decorate a (ceremony) step so window low-event collection follows its lifecycle: `start` arms
1057
- * the tracker, `finished`/`error`/`errorTyped` schedule disarming after
1058
- * {@link CEREMONY_LOW_EVENT_TAIL_MS}. A `start` during the tail (ceremony retry) keeps the
1059
- * tracker armed.
1060
- */
1061
- protected withWindowLowEvents<S extends StepHelper<never, never, never>>(step: S, windowTracker: LowEventWindowTracker): S;
1062
- protected defineStep<TStart = {}, TFinished = {}, TTypedError = never>(stepName: string, ignoreAsInteractionOnStart?: boolean): StepHelper<TStart, TFinished, TTypedError>;
1063
- }
1064
-
1065
- /** Shared configuration for direct key signing and authority registration. */
1066
- type KeyOperationConfig = {
1067
- /** Reserved for future variants; no spec types are currently defined. */
1068
- explicitSpecType?: undefined;
1069
- };
1070
- declare class KeySigningOperationFull extends OperationFull {
1071
- /** Resolve an eligible key and prepare the input for an actual signing attempt. */
1072
- readonly prepare: StepHelper;
1073
- /** Sign and assemble the usable signed artifact. Does not include submitting it. */
1074
- readonly sign: StepHelper;
1075
- constructor(tracker: CorbadoTracker, config?: KeyOperationConfig);
1076
- }
1077
- declare class KeyRegistrationOperationFull extends OperationFull {
1078
- /** Build the request that will establish the key's authority. */
1079
- readonly prepare: StepHelper;
1080
- /** Submit and await acceptance: finish only when the key is authorized and usable. */
1081
- readonly postResponse: StepHelper;
1082
- constructor(tracker: CorbadoTracker, config?: KeyOperationConfig);
1083
- }
1084
-
1085
821
  type WindowCaptureContext = Pick<LowEvent, "subflowStartEventId" | "fieldRole" | "initiator"> & {
1086
822
  sessionId?: string;
1087
823
  };
@@ -1227,7 +963,865 @@ declare class SessionStorage implements StorageEngine {
1227
963
  removeItem(key: string): void;
1228
964
  }
1229
965
 
1230
- declare const INPUT_HANDOFF: unique symbol;
966
+ /**
967
+ * Limits for optional raw-error serialization. Modeled on Sentry's client options
968
+ * (`normalizeDepth`, `normalizeMaxBreadth`, `maxValueLength`, `normalizeToSize`, the
969
+ * stack-frame limit and the linked-errors limit) with defaults tuned for an authentication
970
+ * event stream rather than an error monitor. Every value is clamped to {@link RAW_ERROR_BOUNDS};
971
+ * invalid values fall back to the default. A fixed 1024-node budget per depth attempt and
972
+ * incremental text-byte accounting also bound work before the final JSON-size check.
973
+ */
974
+ type SerializeRawErrorOptions = {
975
+ /** Include `stack` strings. Default false. */
976
+ stack?: boolean;
977
+ /** Stack lines kept after the header line when `stack` is on. Default 50 (Sentry: 50). */
978
+ maxStackFrames?: number;
979
+ /** Object nesting depth below the envelope. Default 3 (Sentry `normalizeDepth`: 3). */
980
+ depth?: number;
981
+ /** Keys per object and items per array, Map or Set. Default 30 (Sentry `normalizeMaxBreadth`: 1000). */
982
+ maxBreadth?: number;
983
+ /** Characters kept per string. Default 1024 (Sentry `maxValueLength`: 250). */
984
+ maxValueLength?: number;
985
+ /** `cause` hops followed. Default 3 (Sentry linked errors: 5, Datadog: 10). */
986
+ maxCauseDepth?: number;
987
+ /** Maximum UTF-8 JSON size in bytes. Depth is reduced until the output fits; omit diagnostics that cannot fit. Default 32768 (Sentry `normalizeToSize`: 100 KiB). */
988
+ maxBytes?: number;
989
+ };
990
+ /** Envelope produced by {@link serializeRawError}. */
991
+ type RawErrorEnvelope = {
992
+ /** Class tag of the original value: `DOMException`, `Error`, `Object`, `Response`, `number`, `null`, `unserializable`, … */
993
+ type: string;
994
+ /** Bounded plain-JSON copy of the value; absent when it could not be serialized within the limits. */
995
+ value?: unknown;
996
+ /** Set when even the shallowest serialization exceeded `maxBytes`. */
997
+ truncated?: true;
998
+ };
999
+ type Limits = Required<Omit<SerializeRawErrorOptions, "stack">> & {
1000
+ stack: boolean;
1001
+ };
1002
+ /** Inclusive bounds for every numeric limit; defaults sit inside them. */
1003
+ declare const RAW_ERROR_BOUNDS: {
1004
+ readonly maxStackFrames: {
1005
+ readonly min: 1;
1006
+ readonly max: 100;
1007
+ readonly default: 50;
1008
+ };
1009
+ readonly depth: {
1010
+ readonly min: 0;
1011
+ readonly max: 10;
1012
+ readonly default: 3;
1013
+ };
1014
+ readonly maxBreadth: {
1015
+ readonly min: 1;
1016
+ readonly max: 1000;
1017
+ readonly default: 30;
1018
+ };
1019
+ readonly maxValueLength: {
1020
+ readonly min: 1;
1021
+ readonly max: 10000;
1022
+ readonly default: 1024;
1023
+ };
1024
+ readonly maxCauseDepth: {
1025
+ readonly min: 0;
1026
+ readonly max: 10;
1027
+ readonly default: 3;
1028
+ };
1029
+ readonly maxBytes: {
1030
+ readonly min: 0;
1031
+ readonly max: 65536;
1032
+ readonly default: 32768;
1033
+ };
1034
+ };
1035
+ /** Resolve caller options into clamped limits. Exported for tests and integrations that want to inspect the effective values. */
1036
+ declare function resolveRawErrorLimits(options?: SerializeRawErrorOptions): Limits;
1037
+ /**
1038
+ * Serialize an arbitrary thrown value for the `rawError` diagnostic field.
1039
+ *
1040
+ * Copies standard error fields and serializable own properties within the configured limits.
1041
+ * Standard fields are read through the prototype chain so DOMException and cross-realm errors
1042
+ * serialize. Output is plain JSON, bounded in depth, breadth, string length, cause chain and
1043
+ * UTF-8 size, and never throws.
1044
+ *
1045
+ * The result is an envelope `{ type, value }`: `type` is the value's class tag (`DOMException`,
1046
+ * `Error`, `Object`, `number`, …) and `value` is a bounded diagnostic copy. Keeping the class tag
1047
+ * outside value preserves the library's own `type` field. When the value cannot be serialized
1048
+ * within the limits the envelope carries `truncated: true` or the type `unserializable` and no
1049
+ * `value`.
1050
+ *
1051
+ * Stacks are omitted unless `stack: true`; they carry page URLs and add the most bytes.
1052
+ * Binary data (ArrayBuffer, typed arrays) is reported by type and length only, never by content.
1053
+ *
1054
+ * @param value - Original thrown value or an explicit diagnostic projection.
1055
+ * @param options - Limits; see {@link SerializeRawErrorOptions} for defaults and {@link RAW_ERROR_BOUNDS} for clamping.
1056
+ */
1057
+ declare function serializeRawError(value: unknown, options?: SerializeRawErrorOptions): RawErrorEnvelope | undefined;
1058
+
1059
+ interface TrackerOptions {
1060
+ /** All persisted SDK state and cross-tab locks are isolated by this project id. */
1061
+ projectId: string;
1062
+ apiBaseUrl: string;
1063
+ apiEventPath?: string;
1064
+ /**
1065
+ * Per-field overrides over server config and defaults. A complete policy disables remote fetching.
1066
+ * Data-collection switches (`pmd`) are deprecated here: use {@link TrackerOptions.fixedDataConfig}.
1067
+ */
1068
+ sdkConfig?: SdkReliabilityConfigOverrides;
1069
+ /**
1070
+ * Opt-in: fix the data-collection switches (password-manager and private-mode detection) instead of
1071
+ * taking them from the server config or the cached `cbo_sdk_config_cache`. Batches then carry
1072
+ * `meta.fixedData: true`. Omitted (default): unchanged, server-driven behaviour. See {@link FixedDataConfig}.
1073
+ */
1074
+ fixedDataConfig?: FixedDataConfig;
1075
+ /** Config endpoint override for integrations that proxy Observe under a different path. */
1076
+ apiConfigPath?: string;
1077
+ storage?: "cookie" | "local";
1078
+ cookieDomain?: string;
1079
+ debug?: boolean;
1080
+ logger?: Logger;
1081
+ /** Minimum time between attaching cached device info to events. */
1082
+ deviceInfoDebounceTime?: number;
1083
+ /**
1084
+ * @deprecated No effect: device info is collected with built-in deadlines (a fast snapshot within
1085
+ * 300 ms, slower fields as a later update within 6000 ms). Still accepted so existing integrations
1086
+ * keep compiling. It will be removed in a future release.
1087
+ */
1088
+ deviceInfoCollectorTimeout?: number;
1089
+ defaultTags?: Record<string, string>;
1090
+ /**
1091
+ * Experiment assignments to seed at init (experiment key → variant). Merged over any persisted
1092
+ * assignments and then attached to every event the tracker produces (see {@link CorbadoTracker.setExperiment}).
1093
+ */
1094
+ experiments?: Record<string, string>;
1095
+ /**
1096
+ * Data policy code to seed at init: a project-scoped non-negative integer (0..255) selecting a
1097
+ * policy configured in Corbado (0 is the project default). Overlays any persisted code and is then
1098
+ * sent as `meta.dataPolicy` on every batch (see {@link CorbadoTracker.setDataPolicy}).
1099
+ */
1100
+ dataPolicy?: number;
1101
+ /**
1102
+ * Version of the integration that drives the SDK (e.g. an autocapture bundle `"1.1.22"`), sent as
1103
+ * `sdk.integrationVersion` on every batch so analyses can cohort sessions by integration version.
1104
+ * At most 32 characters of `[0-9A-Za-z.+_-]`; any other value is ignored (logged in debug mode).
1105
+ */
1106
+ integrationVersion?: string;
1107
+ applicationId?: string;
1108
+ /**
1109
+ * @deprecated The flush interval is server-controlled via the SDK reliability config
1110
+ * (`flushIntervalMs`). This option only applies as long as no server config has been received
1111
+ * (i.e. before the first config response is cached); once a server config is cached it wins.
1112
+ * It will be removed in a future release.
1113
+ */
1114
+ flushInterval?: number;
1115
+ }
1116
+ /**
1117
+ * Options of {@link CorbadoTrackerCore} ({@link initCore}). The same as {@link TrackerOptions}, except that
1118
+ * optional features are selected by importing them and passing them in `plugins` instead of by option
1119
+ * values, so a bundle that does not import a feature does not contain its code:
1120
+ *
1121
+ * - `storage: "cookie"` / `cookieDomain` → `plugins: [cookieStorage({ cookieDomain })]`
1122
+ * - `fixedDataConfig.crossOriginSession` → `plugins: [crossOriginSession({ cookieDomain })]` (the core
1123
+ * ignores this field of `fixedDataConfig`; `pmd` and `privateMode` apply as on the full tracker)
1124
+ * - raw-error serialization of `error(e, { rawError })` → `plugins: [rawErrors()]`
1125
+ * - the SDK probe lane (`probe(tracker, input)`) → `plugins: [probes()]`
1126
+ */
1127
+ interface TrackerCoreOptions extends Omit<TrackerOptions, "storage" | "cookieDomain"> {
1128
+ /** Optional features, see {@link TrackerPlugin}. Each is installed once, in array order. */
1129
+ plugins?: readonly TrackerPlugin[];
1130
+ }
1131
+ /**
1132
+ * Storage engine a plugin supplies for the tracker's device-level state (device id, device info cache).
1133
+ * @internal
1134
+ */
1135
+ type TrackerStorageEngine = {
1136
+ engine: StorageEngine;
1137
+ /** Reported as the device info storage source. */
1138
+ source: "cookie";
1139
+ };
1140
+ /**
1141
+ * Session reconciliation a plugin adds to the tracker (the cross-origin session).
1142
+ * @internal
1143
+ */
1144
+ interface SessionBridge {
1145
+ /** Resolve this load's session (at boot and on recovery); replaces the local-only resolution. */
1146
+ resolve(): string;
1147
+ /** Seq to allocate in `sessionId` instead of `seq` (above another origin's reservation). */
1148
+ claim(sessionId: string, seq: number, now: number): number;
1149
+ /** `meta.crossOriginSession` of a batch of `sessionId`. */
1150
+ meta(sessionId: string): "adopted" | "own" | undefined;
1151
+ /** The tracker started a new session. */
1152
+ reset(sessionId: string): void;
1153
+ /** The tracker is destroyed. */
1154
+ stop(): void;
1155
+ }
1156
+ /**
1157
+ * Optional tracker feature for {@link CorbadoTrackerCore}, created by a factory function and passed in
1158
+ * {@link TrackerCoreOptions.plugins}: `cookieStorage()`, `crossOriginSession()`, `rawErrors()`, `probes()`.
1159
+ *
1160
+ * @remarks
1161
+ * The hooks are internal; integrations only pass the objects the factories return. A failing plugin
1162
+ * never breaks the tracker or the host page: its error is logged and the tracker continues without it.
1163
+ * The full {@link CorbadoTracker} ({@link init}) installs every feature its options ask for, so its
1164
+ * behaviour does not depend on plugins.
1165
+ */
1166
+ interface TrackerPlugin {
1167
+ /** @internal Storage engine for the device-level state (default: localStorage). */
1168
+ readonly storage?: (logger: Logger) => TrackerStorageEngine | undefined;
1169
+ /** @internal Session reconciliation; called once the tracker's config and storage exist. */
1170
+ readonly session?: (tracker: CorbadoTrackerCore) => SessionBridge | undefined;
1171
+ /** @internal Raw-error serializer behind `error(e, { rawError })` of the typed operations. */
1172
+ readonly rawErrors?: RawErrorSerializer;
1173
+ /** @internal Runs at the end of the constructor, once the queue exists. */
1174
+ readonly setup?: (tracker: CorbadoTrackerCore) => void;
1175
+ }
1176
+ /** @internal Serializer of the `rawError` option of operation step errors. */
1177
+ type RawErrorSerializer = (value: unknown, options?: SerializeRawErrorOptions) => RawErrorEnvelope | undefined;
1178
+ /**
1179
+ * The part of the tracker every integration runs: sessions, sequencing, the event queue, device info,
1180
+ * flows, subflow steps, low events, telemetry, experiments and data policy. Created by {@link initCore}.
1181
+ *
1182
+ * @remarks
1183
+ * Optional features are standalone functions that take the tracker (typed operations such as
1184
+ * `passkeyLoginFullOperation(tracker, config)`, `setUser(tracker, user)`, `resetSession(tracker)`) or
1185
+ * plugins passed at construction ({@link TrackerCoreOptions.plugins}), so a bundle only contains what it
1186
+ * imports. {@link CorbadoTracker} ({@link init}) extends this class with every feature as a method.
1187
+ *
1188
+ * **Constructor**
1189
+ * - If `apiBaseUrl` is non-empty and missing `http://` or `https://`: logs via `logger.critical` (does not throw).
1190
+ * - If `apiBaseUrl` is non-empty and ends with `/`: logs via `logger.critical` (does not throw).
1191
+ * - Session bootstrap (`resolveSessionId`): on failure logs `Failed to get session id` and continues with an empty session id (does not throw).
1192
+ * - A plugin hook that throws: logs `Failed to install tracker plugin` and continues without it (does not throw).
1193
+ *
1194
+ * **Typed tracking helpers** (`flowStarted`, `flowDecided`, and the other public methods that call `track`)
1195
+ * - Error handling for queued events is defined on {@link CorbadoTrackerCore.track}.
1196
+ */
1197
+ declare class CorbadoTrackerCore {
1198
+ private options;
1199
+ private logger;
1200
+ private queue;
1201
+ private sessionId;
1202
+ private storage;
1203
+ private sessionStorage;
1204
+ /** Dedicated localStorage engine for reliability state (config cache, outbox, continuity session, seq). */
1205
+ private persistentStorage;
1206
+ /** Seq/continuity Web Lock name; project-scoped together with the storage keys it guards. */
1207
+ private readonly seqLockName;
1208
+ /** Current resolved policy. Continuity and persistence stay enabled once activated within a document. */
1209
+ private config;
1210
+ private readonly configManager?;
1211
+ private readonly configOverrides;
1212
+ /** Resolved `fixedDataConfig`; undefined when not given (server-driven data switches). */
1213
+ private readonly fixedData?;
1214
+ private deviceInfoManager;
1215
+ private deviceCollector;
1216
+ /**
1217
+ * Cached per-tab id stamped onto every event's meta (see {@link EventMeta.tabId}). Resolved
1218
+ * lazily from the collector's sessionStorage-backed id; stable for the whole page lifetime.
1219
+ */
1220
+ private eventTabId?;
1221
+ private seq;
1222
+ /**
1223
+ * When the continuity record's `lastActiveAt` was last persisted. Throttles that write inside the
1224
+ * seq critical section (see {@link SESSION_ACTIVITY_WRITE_INTERVAL_MS}). 0 = not written yet on
1225
+ * this load, so the first allocation always persists.
1226
+ */
1227
+ private lastActivityWriteAt;
1228
+ /** Persistent experiment assignments (experiment key → variant), attached to every produced event. */
1229
+ private experiments;
1230
+ /**
1231
+ * Persistent data policy code, stamped into every batch's `meta.dataPolicy` once set. Never
1232
+ * cleared (only overwritten): it survives reloads, session rotation, resetSession and destroy.
1233
+ */
1234
+ private dataPolicy?;
1235
+ /** Self-instrumentation state: re-entrancy guard, readiness, per-load dedupe, and pre-queue buffer. */
1236
+ private telemetryReporting;
1237
+ private telemetryReady;
1238
+ private readonly reportedTelemetryKeys;
1239
+ private pendingSelfTelemetry;
1240
+ private windowObserver?;
1241
+ private passwordManagerSampler?;
1242
+ /** Session reconciliation of a plugin (the cross-origin session); undefined when none is installed. */
1243
+ private bridge?;
1244
+ /** Raw-error serializer of a plugin; undefined = operation step errors drop `rawError`. */
1245
+ private rawErrors?;
1246
+ /** @internal Shared passive page observation and per-operation context registration. */
1247
+ getWindowObserver(): SharedWindowObserver;
1248
+ /**
1249
+ * @param options - Tracker options; `options.plugins` selects the optional features.
1250
+ * @param plugins - Plugins installed before `options.plugins` (used by {@link CorbadoTracker}).
1251
+ */
1252
+ constructor(options: TrackerCoreOptions, plugins?: readonly TrackerPlugin[]);
1253
+ /** Runs `install` per plugin; a missing or throwing plugin is logged and skipped (never throws). */
1254
+ private eachPlugin;
1255
+ /**
1256
+ * Whether this tracker is the full {@link CorbadoTracker} (created by {@link init} or its constructor).
1257
+ * @internal
1258
+ */
1259
+ isFullTracker(): this is CorbadoTracker;
1260
+ /** Apply init overrides on every refresh; continuity and persistence only activate within a document. */
1261
+ private handleConfig;
1262
+ /**
1263
+ * Returns the logger used by this tracker.
1264
+ * @internal
1265
+ */
1266
+ getLogger(): Logger;
1267
+ private applicationTag;
1268
+ /**
1269
+ * Register several experiment assignments at once (experiment key → variant). Additive: existing
1270
+ * assignments for other keys are kept. See {@link CorbadoTracker.setExperiment}.
1271
+ *
1272
+ * Never throws: invalid input is ignored with a debug log.
1273
+ */
1274
+ setExperiments(assignments: Record<string, string>): void;
1275
+ /** Returns a copy of the currently active experiment assignments. */
1276
+ getExperiments(): Record<string, string>;
1277
+ /**
1278
+ * Returns the currently active public SDK configuration, including live updates.
1279
+ *
1280
+ * @returns A frozen snapshot, created fresh on every call.
1281
+ */
1282
+ /** @internal Project-scoped localStorage used by operation helpers (e.g. email-link continuity). */
1283
+ getPersistentStorage(): StorageEngine | undefined;
1284
+ getSdkConfig(): ObserveSdkConfigSnapshot;
1285
+ /**
1286
+ * Set the data policy code for this tracker (e.g. `setDataPolicy(1)` once the user agreed to
1287
+ * extended processing; `setDataPolicy(0)` to return to the project default). Codes are
1288
+ * project-scoped non-negative integers (0..255) selecting a policy configured in Corbado; they
1289
+ * carry no ordering.
1290
+ *
1291
+ * The code is persisted (localStorage, project-scoped) and sent as `meta.dataPolicy` on every
1292
+ * subsequent batch, across reloads and session rotation. It is never cleared, only overwritten.
1293
+ * The server records the latest code it receives for a session (last write wins). Invalid codes
1294
+ * are ignored with a debug log; never throws.
1295
+ */
1296
+ setDataPolicy(code: number): void;
1297
+ /** Returns the current data policy code, or undefined when none has ever been set. */
1298
+ getDataPolicy(): number | undefined;
1299
+ private static isValidDataPolicy;
1300
+ private loadPersistedDataPolicy;
1301
+ private persistDataPolicy;
1302
+ private static isValidExperimentKey;
1303
+ private static isValidExperimentVariant;
1304
+ private loadPersistedExperiments;
1305
+ private persistExperiments;
1306
+ /**
1307
+ * Resolves the experiments to attach to one event: the persistent assignments with any per-call
1308
+ * override merged on top. Returns undefined when there are none (so the field is omitted).
1309
+ */
1310
+ private resolveExperiments;
1311
+ private isTrackingBlocked;
1312
+ /**
1313
+ * Resolve the session of this load: locally ({@link resolveSessionId}), or through the session bridge
1314
+ * of a plugin (cross-origin session) when one is installed. Used at boot and by the recovery in
1315
+ * `getSessionId`.
1316
+ */
1317
+ private resolveSession;
1318
+ private resolveSessionId;
1319
+ /**
1320
+ * Resolve the session id from localStorage so it survives reloads and is shared across tabs of the
1321
+ * same browser. Rotates after `config.sessionInactivityMs` of inactivity (server-controlled,
1322
+ * evaluated at boot), resetting the seq counter.
1323
+ *
1324
+ * Inactivity rotation happens at boot only, here and on the per-tab path {@link resolveSessionId}
1325
+ * takes without continuity. Boot is chosen on an assumption, not a guarantee: that a load
1326
+ * re-announces its flow, so the fresh session id gets a classifiable flow. That holds where a
1327
+ * flow is opened per load. Where one is opened once and carried across loads it does not, and a
1328
+ * boot rotation splits that flow — such a project needs a window long enough to span the journey.
1329
+ * Mid-page the assumption is not even available: nothing re-announces between two tracked events,
1330
+ * so rotating there would leave the started flow unfinished in the old session and the remaining
1331
+ * events without a flow start in the new one — one gap counted as a drop-off, one completion
1332
+ * counted as nothing. `nextSeq` therefore never rotates on inactivity, on either path.
1333
+ */
1334
+ private getContinuitySessionId;
1335
+ /**
1336
+ * Persist the continuity record and remember when, so the throttled refresh in the seq critical
1337
+ * section measures from the last write that actually happened — whoever made it.
1338
+ */
1339
+ private persistContinuitySession;
1340
+ /**
1341
+ * Read the per-tab session record. A bare string is the format that predates dating: it carries no
1342
+ * `lastActiveAt`, so its window can only start on the load that reads it. That load rewrites it in
1343
+ * the dated shape, so a tab converts once and ages normally from then on, and the case drains as
1344
+ * the rollout replaces the bundles that write it.
1345
+ */
1346
+ private readPerTabSession;
1347
+ /**
1348
+ * Persist the per-tab record and remember when, sharing the throttle bookkeeping with the
1349
+ * continuity record — a load resolves its session on one path or the other, never both.
1350
+ *
1351
+ * An explicit timeout override or server config stamps the window. Otherwise carry forward what
1352
+ * the tab already knows, so a defaults boot does not replace a previously configured threshold.
1353
+ */
1354
+ private persistPerTabSession;
1355
+ /** Explicit init timeout wins; otherwise retain the window a prior configured load recorded. */
1356
+ private perTabInactivityMs;
1357
+ /**
1358
+ * Return the next sequence number. With session continuity the counter is persisted so ordering
1359
+ * survives reloads/redirects; the read-increment-write runs under a cross-tab Web Lock
1360
+ * ({@link SEQ_LOCK_NAME}) so two tabs sharing the session cannot allocate the same seq (where Web
1361
+ * Locks are unavailable or exceed the configured timeout it degrades to the historical best-effort merge).
1362
+ * Lock grants are FIFO, so seq order matches `track()` call order within a tab. Tracking also keeps the
1363
+ * continuity session's `lastActiveAt` fresh (throttled, see {@link SESSION_ACTIVITY_WRITE_INTERVAL_MS}),
1364
+ * so the window the NEXT boot evaluates measures real user
1365
+ * inactivity instead of time-since-page-load (a long-lived active tab must not rotate the session
1366
+ * on the next reload). It never rotates the session itself: the inactivity window is evaluated at
1367
+ * boot only ({@link getContinuitySessionId} documents why). Consequence: while a page is never
1368
+ * reloaded — foreground idle, bfcache restore, long-lived SPA tab — a session can outlive
1369
+ * `sessionInactivityMs`. That inflates flow durations but keeps flow counts correct, which is the
1370
+ * better half of the trade. An empty store while this load already has a session id means
1371
+ * persistence is failing (or was cleared); the in-memory id is reused then — never re-minted — so
1372
+ * a broken store degrades to one session per page load instead of one session per event.
1373
+ */
1374
+ private nextSeq;
1375
+ private resolveTrackingSourcePath;
1376
+ /**
1377
+ * Per-tab id for event meta, cached after the first successful resolution: the id is
1378
+ * sessionStorage-backed and stable for the whole page lifetime.
1379
+ */
1380
+ private resolveEventTabId;
1381
+ /** @internal */
1382
+ trackSubflowStarted(subflowType: SubflowType, data: Record<string, any>, options?: StepOptions, eventId?: string): void;
1383
+ /** @internal */
1384
+ trackSubflowTrigger(subflowType: SubflowType, data: Record<string, any>, options?: StepOptions): void;
1385
+ /** @internal */
1386
+ trackSubflowStepStarted(subflowType: SubflowType, stepName: string, data: Record<string, any>, options?: StepOptions, ignoreAsInteraction?: boolean): void;
1387
+ /** @internal */
1388
+ trackSubflowStepFinished(subflowType: SubflowType, stepName: string, data: Record<string, any>, options?: StepOptions): void;
1389
+ /** @internal */
1390
+ trackSubflowStepError(subflowType: SubflowType, stepName: string, data: Record<string, any>, options?: StepOptions): void;
1391
+ /**
1392
+ * Error situations:
1393
+ * - Blocked user agent (see `isBlockedUserAgent`): skip with a debug log and return
1394
+ * - Any error before the event is enqueued (e.g. `JSON.stringify` in debug logging, `queue.enqueue`): log `Failed to process event "<name>" before enqueue`
1395
+ *
1396
+ * @internal
1397
+ */
1398
+ track(name: AuthEventName, data: Record<string, any>, userReference?: UserReference, tags?: Record<string, string>, contexts?: Record<string, any>, explicitTimestamp?: number, experiments?: Record<string, string>, capture?: {
1399
+ id?: string;
1400
+ subflowStartEventId?: string;
1401
+ sessionId?: string;
1402
+ initiator?: StepOptions["initiator"];
1403
+ }): Promise<void>;
1404
+ /**
1405
+ * Track when an authentication flow (or flow selection screen) becomes visible.
1406
+ *
1407
+ * @remarks
1408
+ * Call this once when the user first enters an auth touchpoint (for example account login,
1409
+ * checkout login, or account recovery). If users can choose between multiple flows
1410
+ * (such as login vs signup), pass `flowNames` and optionally `defaultFlowName`.
1411
+ *
1412
+ * The returned handle can attach identity after completion with `await flow.enrich({ userId })`.
1413
+ * Enrichment requires a backend supporting explicit event targeting.
1414
+ *
1415
+ * @param data - Flow metadata, including one flow (`flowName`) or multiple candidates (`flowNames`).
1416
+ * @param tags - Optional key-value tags for filtering and segmentation.
1417
+ * @param experiments - Optional per-call experiment overrides.
1418
+ * @param contexts - Optional structured event context (e.g. technical metadata that is not an
1419
+ * analytical dimension). Written to the event's `contexts` field verbatim.
1420
+ * @param options - Optional `explicitTimestamp` (epoch ms) when the flow became visible earlier than
1421
+ * this call, e.g. because an integration confirms a screen only after it stayed up for a while.
1422
+ *
1423
+ * @example
1424
+ * ```typescript
1425
+ * tracker.flowStarted({
1426
+ * flowNames: ["login", "signup"],
1427
+ * defaultFlowName: "login",
1428
+ * touchpoint: "account",
1429
+ * });
1430
+ * ```
1431
+ */
1432
+ flowStarted(data: FlowStarted | MultiFlowStarted, tags?: Record<string, string>, experiments?: Record<string, string>, contexts?: Record<string, unknown>, options?: Pick<StepOptions, "explicitTimestamp">): FlowHandle;
1433
+ /**
1434
+ * Track when the user commits to a specific flow.
1435
+ *
1436
+ * @remarks
1437
+ * Use this after presenting alternatives and once you know which path the user takes
1438
+ * (for example when identifier checks route to login vs signup).
1439
+ *
1440
+ * @param data - Selected flow name.
1441
+ * @param tags - Optional key-value tags for filtering and segmentation.
1442
+ *
1443
+ * @example
1444
+ * ```typescript
1445
+ * tracker.flowDecided({flowName: "signup"});
1446
+ * ```
1447
+ */
1448
+ flowDecided(data: FlowDecided, tags?: Record<string, string>, experiments?: Record<string, string>): void;
1449
+ /**
1450
+ * Track when a flow successfully completes.
1451
+ *
1452
+ * @remarks
1453
+ * Fire this when the user has finished the target flow end-to-end, such as completed login,
1454
+ * signup, or recovery. Record identity with `setUser()` while the flow is active,
1455
+ * or enrich it after completion through the handle returned by `flowStarted()` or by this call.
1456
+ *
1457
+ * The returned handle targets the flow this event finished, so identity learned only after
1458
+ * completion — for example from a profile request that follows account creation — can be
1459
+ * attached with `await finished.enrich({ userId })` even on a page that never saw the flow start.
1460
+ * Enrichment requires a backend supporting explicit flow-event targeting.
1461
+ *
1462
+ * Legacy identity fields in `data` remain supported but are deprecated.
1463
+ *
1464
+ * @param data - Finished flow name, optional explicit outcome, and deprecated user reference fields.
1465
+ * @param tags - Optional key-value tags for filtering and segmentation.
1466
+ *
1467
+ * @example
1468
+ * ```typescript
1469
+ * const finished = tracker.flowFinished({ flowName: "signup" });
1470
+ * const userId = await hashUserId(createdAccountId);
1471
+ * await finished.enrich({ userId });
1472
+ * ```
1473
+ */
1474
+ flowFinished(data: FlowFinished, tags?: Record<string, string>, experiments?: Record<string, string>): FlowHandle;
1475
+ /** Emits `flow_enriched` against an explicit target, in the session that emitted the target. */
1476
+ private flowHandle;
1477
+ /**
1478
+ * Track when an in-progress flow is reset and restarted.
1479
+ *
1480
+ * @remarks
1481
+ * Use this when users abandon the current path and return to the beginning of the same flow,
1482
+ * for example after switching account/identifier and reopening the first step.
1483
+ *
1484
+ * @param data - Flow name being reset.
1485
+ * @param tags - Optional key-value tags for filtering and segmentation.
1486
+ *
1487
+ * @example
1488
+ * ```typescript
1489
+ * tracker.flowReset({flowName: "login"});
1490
+ * ```
1491
+ */
1492
+ flowReset(data: FlowReset | MultiFlowReset, tags?: Record<string, string>, experiments?: Record<string, string>): void;
1493
+ /**
1494
+ * Track when a flow is considered finished because another flow finished it implicitly.
1495
+ *
1496
+ * @remarks
1497
+ * Use this for automatic completions where no separate explicit finish action happens in the
1498
+ * current flow. Set `flowName` to the auto-finished flow and `finishedByFlowName` to the flow
1499
+ * that caused it. Record identity with `setUser()` while the intended flow is still
1500
+ * current, before it is auto-finished.
1501
+ *
1502
+ * Legacy identity fields in `data` remain supported but are deprecated.
1503
+ *
1504
+ * @param data - Auto-finished flow, finishing flow, and deprecated user reference fields.
1505
+ * @param tags - Optional key-value tags for filtering and segmentation.
1506
+ *
1507
+ * @example
1508
+ * ```typescript
1509
+ * tracker.flowAutoFinished({
1510
+ * flowName: "signup",
1511
+ * finishedByFlowName: "login",
1512
+ * });
1513
+ * ```
1514
+ */
1515
+ flowAutoFinished(data: FlowAutoFinished, tags?: Record<string, string>, experiments?: Record<string, string>): void;
1516
+ /**
1517
+ * Track when you present authentication method choices to the user.
1518
+ *
1519
+ * @remarks
1520
+ * Use this whenever a decision point is shown with a concrete method set, such as
1521
+ * identifier entry options (`d1`) or post-identifier options (`d3`). Set
1522
+ * `explicitDecisionValue` when the options are re-offered after a user action and you want
1523
+ * to capture what triggered that transition.
1524
+ *
1525
+ * @param data - Decision identifier, offered options, and optional transition reason.
1526
+ * @param tags - Optional key-value tags for filtering and segmentation.
1527
+ * @param experiments - Optional per-call experiment assignments.
1528
+ * @param options - Optional explicit event timestamp.
1529
+ *
1530
+ * @example
1531
+ * ```typescript
1532
+ * tracker.authMethodsDecisionStarted({
1533
+ * decisionName: "d3",
1534
+ * options: ["passkey", "social-google", "password", "reset-flow"],
1535
+ * });
1536
+ * ```
1537
+ */
1538
+ authMethodsDecisionStarted(data: AuthMethodDecisionStarted, tags?: Record<string, string>, experiments?: Record<string, string>, options?: Pick<StepOptions, "explicitTimestamp">): void;
1539
+ authMethodsDecisionFinished(data: AuthMethodDecisionFinished, tags?: Record<string, string>, experiments?: Record<string, string>): void;
1540
+ /**
1541
+ * Enqueue a "low" event (granular DOM/window/visualviewport/PWM signal) for the current session.
1542
+ *
1543
+ * @remarks
1544
+ * Low events are sent in the `lows` array of the events endpoint payload, alongside any
1545
+ * pending typed events. Blocked user agents are skipped silently.
1546
+ *
1547
+ * @internal
1548
+ */
1549
+ enqueueLowEvent(low: LowEvent, capturedSessionId?: string): void;
1550
+ /**
1551
+ * Record a diagnostic telemetry entry (a `level` + free-form `message`) for the current session.
1552
+ *
1553
+ * @remarks
1554
+ * Telemetry is delivered in the `telemetry` array of the events endpoint payload, tied to the same
1555
+ * session, and is never classified as an auth-flow event. By default a telemetry entry piggybacks
1556
+ * the next normal flush (it does not trigger one on its own); this is server-controlled. Collection
1557
+ * can be turned off server-side via the `telemetry` config flag. Blocked user agents are skipped.
1558
+ *
1559
+ * The message is truncated to {@link TELEMETRY_MESSAGE_MAX} characters. Never pass credentials or
1560
+ * PII — telemetry is for diagnostics only. Like all SDK entry points, this never throws.
1561
+ */
1562
+ telemetry(level: TelemetryLevel, message: string): void;
1563
+ /**
1564
+ * Queue hook run right before an event batch is sent: a device info snapshot that no event carried
1565
+ * yet (typically the fast snapshot after a burst of events at page load, or the privateMode update)
1566
+ * rides the first event of this page in the batch that has none. Events of other pages (outbox
1567
+ * replays) are never touched. A snapshot no event can carry goes as the batch's request-level device
1568
+ * info instead (queue option `standaloneDeviceInfo`).
1569
+ *
1570
+ * Error situations:
1571
+ * - Any error: log "Failed to attach device info to batch" and send the batch unchanged
1572
+ */
1573
+ private attachUndeliveredDeviceInfo;
1574
+ /**
1575
+ * Escalate an internal SDK diagnostic to the telemetry stream (self-instrumentation). This is the
1576
+ * sink behind {@link Logger.reportTelemetry}; chosen internal failure sites route here so faults
1577
+ * that are otherwise only visible with `debug: true` become observable in the field.
1578
+ *
1579
+ * @remarks
1580
+ * Bounded and deduped per load (a persistent fault — blocked storage, a downed endpoint — cannot
1581
+ * flood the stream), re-entrancy-guarded so it can never recurse, and it never throws into the
1582
+ * host. Diagnostics raised before the queue exists (early boot) are buffered and replayed once the
1583
+ * queue is ready. Messages must be stable and low-cardinality (no raw error objects / PII).
1584
+ */
1585
+ private reportTelemetry;
1586
+ /**
1587
+ * Synchronously flush any pending events and low events via beacon. Use during page-unload
1588
+ * style teardown where async flushing is unreliable.
1589
+ *
1590
+ * @param reason What triggered the flush; recorded as `meta.flushReason` on the batch. Defaults
1591
+ * to a direct call by the host app.
1592
+ *
1593
+ * @internal
1594
+ */
1595
+ flushKeepalive(reason?: FlushReason): void;
1596
+ /**
1597
+ * Keepalive flush requested by a low-event tracker's `pagehide` teardown. Gated by the
1598
+ * server-controlled trigger switch `tlf` (boot-snapshot, default true = historical behavior):
1599
+ * disabling it server-side makes low-event delivery rely solely on the queue's own triggers.
1600
+ *
1601
+ * @internal
1602
+ */
1603
+ lowEventFlushKeepalive(): void;
1604
+ /**
1605
+ * Flush any pending events and release all resources (timers, event listeners).
1606
+ *
1607
+ * @remarks
1608
+ * After calling destroy, the tracker must not be used. Operation objects
1609
+ * returned by factory methods (e.g. `passwordLoginFullOperation`) that hold
1610
+ * DOM references must be destroyed separately by the caller.
1611
+ * The final flush is gated by the server-controlled trigger switch `td` (default true);
1612
+ * resources are released either way.
1613
+ */
1614
+ destroy(): Promise<void>;
1615
+ /**
1616
+ * Return the Observe session id this tracker is currently reporting under.
1617
+ *
1618
+ * @remarks
1619
+ * Use this to route a server-side event into the same session the browser reports to: read the id,
1620
+ * pass it to your own backend, and let the backend use it as the `sessionID` of its ingest call.
1621
+ * Reading it here is the supported path — the storage layout behind it is an implementation detail
1622
+ * that has already changed once (per-tab `sessionStorage` to the cross-tab continuity record).
1623
+ *
1624
+ * The value is **not stable for the lifetime of the page**. It changes on
1625
+ * {@link CorbadoTracker.resetSession}, when this tab adopts a continuity session another tab
1626
+ * rotated to, and when a failed bootstrap recovers. Read it at the moment you need it; never cache
1627
+ * it across a request.
1628
+ *
1629
+ * `undefined` means no session id could be established at all — an environment without Web Crypto,
1630
+ * where tracking is not working either. Skip the server-side event instead of sending an empty id:
1631
+ * the ingest API requires a UUID and would reject the batch.
1632
+ *
1633
+ * @returns The current session id, or `undefined` if none could be established.
1634
+ *
1635
+ * @example
1636
+ * ```typescript
1637
+ * const sessionId = tracker.getSessionId();
1638
+ * if (sessionId) {
1639
+ * await fetch("/api/checkout", {
1640
+ * method: "POST",
1641
+ * body: JSON.stringify({ ...payload, observeSessionId: sessionId }),
1642
+ * });
1643
+ * }
1644
+ * ```
1645
+ */
1646
+ getSessionId(): string | undefined;
1647
+ }
1648
+
1649
+ /**
1650
+ * Where low events go. `flushKeepalive` is requested on `pagehide` teardown so lows batched after
1651
+ * the queue's own lifecycle flush still get out; operations wire it to the client's
1652
+ * `lowEventFlushKeepalive()`, which is gated by the server-controlled `tlf` trigger switch
1653
+ * (default true = historical behavior, can be disabled remotely).
1654
+ */
1655
+ interface LowEventSink {
1656
+ reserveCaptureSeq?(): number;
1657
+ enqueueLowEvent(low: LowEvent): void;
1658
+ flushKeepalive(): void;
1659
+ registerInputs?(fields: readonly HTMLInputElement[], flush: () => void): () => void;
1660
+ beginCeremony?(initiator?: LowEventInitiator): {
1661
+ settle(tailMs: number): void;
1662
+ destroy(): void;
1663
+ };
1664
+ }
1665
+
1666
+ /** Ceremony context lease on the shared observer. Never installs its own window listeners. */
1667
+ declare class LowEventWindowTracker {
1668
+ private logger;
1669
+ private sink;
1670
+ private lease?;
1671
+ private destroyed;
1672
+ constructor(logger: Logger, sink: LowEventSink);
1673
+ arm(initiator?: LowEventInitiator, conditional?: boolean): void;
1674
+ scheduleDisarm(delayMs: number): void;
1675
+ disarm(): void;
1676
+ destroy(): void;
1677
+ }
1678
+
1679
+ /**
1680
+ * How long window low-event listeners stay armed after a ceremony settles: focus return and
1681
+ * picker dismiss animations land shortly after the WebAuthn promise resolves/rejects.
1682
+ */
1683
+ declare const CEREMONY_LOW_EVENT_TAIL_MS = 1500;
1684
+ /**
1685
+ * Optional diagnostic context for both normal and typed step errors.
1686
+ *
1687
+ * Use `rawError` when a library error contains useful context beyond its classified name,
1688
+ * code and message, such as a nested cause, an error array or a response status.
1689
+ * Serialization requires SDK config `rawErrors: true` (default true). Config refreshes apply
1690
+ * to subsequent errors; diagnostics already queued are unchanged.
1691
+ * It is emitted as a bounded `{ type, value }` envelope in `stepData.rawError` for raw-event
1692
+ * inspection. The envelope type describes the JavaScript value; the library's own fields
1693
+ * stay inside value. See {@link serializeRawError} for serialization limits.
1694
+ *
1695
+ * @remarks
1696
+ * The first argument to `.error()` or `.errorTyped()` supplies the classified diagnostic.
1697
+ * `rawError` does not fill missing classified fields or affect outcomes, error-group assignment
1698
+ * or severity: a code-only typed error remains code-only even if its raw diagnostic has a name
1699
+ * and message. Existing StepOptions such as userReference and explicitTimestamp can accompany
1700
+ * rawError; calls without it behave as before.
1701
+ *
1702
+ * Supply a deliberate diagnostic object without credentials, cookies or personal data.
1703
+ * Arrays retain their structure in rawError; arrays passed directly to `.error()` become a
1704
+ * string message. Keep the original error for application handling; serialization makes a copy.
1705
+ *
1706
+ * @example
1707
+ * ```ts
1708
+ * // Normal error with additional provider context.
1709
+ * passkey.ceremony.error(originalError, { rawError: providerDiagnostic });
1710
+ *
1711
+ * // Typed error with the original error available for inspection.
1712
+ * password.postResponse.errorTyped(
1713
+ * { code: "invalid_password" },
1714
+ * { rawError: originalError },
1715
+ * );
1716
+ *
1717
+ * // A classified code and message plus additional raw context.
1718
+ * password.postResponse.error(
1719
+ * { code: "invalid_password", name: "AuthenticationError", message: "The password was rejected" },
1720
+ * { rawError: providerDiagnostic },
1721
+ * );
1722
+ * ```
1723
+ */
1724
+ type ErrorStepOptions = StepOptions & {
1725
+ /** Explicit opt-in. Serialized with bounded depth and UTF-8 size; stacks are omitted by default and binary contents are summarized. */
1726
+ rawError?: unknown;
1727
+ /** Per-call limits for `rawError` serialization (depth, breadth, string length, cause chain, bytes, stack). See {@link SerializeRawErrorOptions}. */
1728
+ rawErrorLimits?: SerializeRawErrorOptions;
1729
+ };
1730
+ type StepHelper<TStart = {}, TFinished = {}, TTypedError = never> = {
1731
+ start: (data: TStart, options?: StepOptions) => void;
1732
+ finished: (data: TFinished, options?: StepOptions) => void;
1733
+ error: (error: unknown, options?: ErrorStepOptions) => void;
1734
+ } & ([TTypedError] extends [never] ? {} : {
1735
+ errorTyped: (error: TTypedError, options?: ErrorStepOptions) => void;
1736
+ });
1737
+ declare abstract class OperationFull {
1738
+ private tracker;
1739
+ private operationName;
1740
+ private startReference?;
1741
+ private captureSpecType?;
1742
+ private captureSessionId?;
1743
+ private readonly lowFlushers;
1744
+ private readonly lowPrefillCapturers;
1745
+ protected lowEventSink(sourceKind: LowEventSourceKind, fieldRole?: LowEventFieldRole): LowEventSink;
1746
+ protected createLowCollector<T extends {
1747
+ capturePrefill(newCapture?: boolean): void;
1748
+ }>(create: () => T): T | undefined;
1749
+ protected registerLowFlusher(flush: () => void): void;
1750
+ private captureOptions;
1751
+ constructor(tracker: CorbadoTrackerCore, operationName: SubflowType);
1752
+ /** Anchor (subflowStartEventId) of the current start; undefined before the first start. */
1753
+ protected get captureReference(): string | undefined;
1754
+ /** Session the current start was tracked under. */
1755
+ protected get captureSession(): string | undefined;
1756
+ /**
1757
+ * Continue an attempt started elsewhere (e.g. on another page of the same session) without
1758
+ * emitting a subflow_started: later steps and low events carry the given anchor and session.
1759
+ */
1760
+ protected adoptCapture(reference: string, sessionId: string, specType?: string): void;
1761
+ /**
1762
+ * Emits an additional subflow_started; construction already emits the initial start.
1763
+ * `data` supports SubflowTrigger fields (`actor`, `explicitSpecType`, `ignoreAsInteraction`)
1764
+ * plus free-form extras; see SubflowTrigger for programmatic interaction suppression.
1765
+ */
1766
+ subflowStart(data: any, options?: StepOptions): void;
1767
+ /**
1768
+ * Capture values initialized by the application after constructing this operation, without
1769
+ * dispatching DOM input events. Call immediately after initialization, before user editing.
1770
+ * Each field/group emits at most one prefill per subflow start; values are never recorded.
1771
+ */
1772
+ capturePrefill(): void;
1773
+ private captureInputPrefills;
1774
+ /**
1775
+ * @deprecated `subflow_trigger` will be removed in the next major version.
1776
+ */
1777
+ trigger(data: SubflowTrigger, options?: StepOptions): void;
1778
+ customStep<TStart = {}, TFinished = {}>(stepName: string): StepHelper<TStart, TFinished>;
1779
+ protected subflowStepStarted(stepName: string, data: any, options?: StepOptions, ignoreAsInteraction?: boolean): void;
1780
+ protected subflowStepFinished(stepName: string, data: any, options?: StepOptions): void;
1781
+ protected subflowStepError(stepName: string, data: any, options?: ErrorStepOptions): void;
1782
+ /**
1783
+ * Decorate a (ceremony) step so window low-event collection follows its lifecycle: `start` arms
1784
+ * the tracker, `finished`/`error`/`errorTyped` schedule disarming after
1785
+ * {@link CEREMONY_LOW_EVENT_TAIL_MS}. A `start` during the tail (ceremony retry) keeps the
1786
+ * tracker armed.
1787
+ */
1788
+ protected withWindowLowEvents<S extends StepHelper<never, never, never>>(step: S, windowTracker: LowEventWindowTracker): S;
1789
+ protected defineStep<TStart = {}, TFinished = {}, TTypedError = never>(stepName: string, ignoreAsInteractionOnStart?: boolean): StepHelper<TStart, TFinished, TTypedError>;
1790
+ }
1791
+
1792
+ /** Shared configuration for direct key signing and authority registration. */
1793
+ type KeyOperationConfig = {
1794
+ /** Reserved for future variants; no spec types are currently defined. */
1795
+ explicitSpecType?: undefined;
1796
+ };
1797
+ declare class KeySigningOperationFull extends OperationFull {
1798
+ /** Resolve an eligible key and prepare the input for an actual signing attempt. */
1799
+ readonly prepare: StepHelper;
1800
+ /** Sign and assemble the usable signed artifact. Does not include submitting it. */
1801
+ readonly sign: StepHelper;
1802
+ constructor(tracker: CorbadoTrackerCore, config?: KeyOperationConfig);
1803
+ }
1804
+ declare class KeyRegistrationOperationFull extends OperationFull {
1805
+ /** Build the request that will establish the key's authority. */
1806
+ readonly prepare: StepHelper;
1807
+ /** Submit and await acceptance: finish only when the key is authorized and usable. */
1808
+ readonly postResponse: StepHelper;
1809
+ constructor(tracker: CorbadoTrackerCore, config?: KeyOperationConfig);
1810
+ }
1811
+ /**
1812
+ * Create a {@link KeySigningOperationFull} for `tracker`: the standalone form of `CorbadoTracker.keySigningOperationFull()`, for trackers
1813
+ * created by `initCore()` (a bundle that does not import this function does not contain the operation).
1814
+ * Same semantics and documentation as the method.
1815
+ */
1816
+ declare function keySigningOperationFull(tracker: CorbadoTrackerCore, config?: KeyOperationConfig): KeySigningOperationFull;
1817
+ /**
1818
+ * Create a {@link KeyRegistrationOperationFull} for `tracker`: the standalone form of `CorbadoTracker.keyRegistrationOperationFull()`, for trackers
1819
+ * created by `initCore()` (a bundle that does not import this function does not contain the operation).
1820
+ * Same semantics and documentation as the method.
1821
+ */
1822
+ declare function keyRegistrationOperationFull(tracker: CorbadoTrackerCore, config?: KeyOperationConfig): KeyRegistrationOperationFull;
1823
+
1824
+ declare const INPUT_HANDOFF: unique symbol;
1231
1825
  declare const WEBAUTHN_PAYLOAD_HANDOFF: unique symbol;
1232
1826
  declare const WEBAUTHN_ERROR_HANDOFF: unique symbol;
1233
1827
  /**
@@ -1323,7 +1917,7 @@ declare class PasskeyLoginOperationFull extends OperationFull {
1323
1917
  readonly ceremony: HandoffStepHelper<PasskeyLoginCeremonyStart, PasskeyLoginCeremonyFinished>;
1324
1918
  readonly postResponse: HandoffStepHelper<PasskeyLoginPostResponseStart>;
1325
1919
  private lowEventTracker;
1326
- constructor(tracker: CorbadoTracker, config?: PasskeyLoginOperationConfig);
1920
+ constructor(tracker: CorbadoTrackerCore, config?: PasskeyLoginOperationConfig);
1327
1921
  /**
1328
1922
  * @deprecated `subflow_trigger` is not supported for passkey-login and will be removed in the
1329
1923
  * next major version.
@@ -1331,6 +1925,12 @@ declare class PasskeyLoginOperationFull extends OperationFull {
1331
1925
  trigger(data: SubflowTrigger, options?: StepOptions): void;
1332
1926
  destroy(): void;
1333
1927
  }
1928
+ /**
1929
+ * Create a {@link PasskeyLoginOperationFull} for `tracker`: the standalone form of `CorbadoTracker.passkeyLoginFullOperation()`, for trackers
1930
+ * created by `initCore()` (a bundle that does not import this function does not contain the operation).
1931
+ * Same semantics and documentation as the method.
1932
+ */
1933
+ declare function passkeyLoginFullOperation(tracker: CorbadoTrackerCore, config?: PasskeyLoginOperationConfig): PasskeyLoginOperationFull;
1334
1934
 
1335
1935
  type EmailOTPOperationSpecType = "email-otp-login" | "email-otp-enrollment";
1336
1936
  type EmailOTPOperationSendOTPStart = {
@@ -1352,7 +1952,7 @@ declare class EmailOtpOperationFull extends OperationFull {
1352
1952
  readonly send: StepHelper<EmailOTPOperationSendOTPStart>;
1353
1953
  readonly postResponse: StepHelper<EmailOTPOperationPostResponseStart>;
1354
1954
  readonly resend: StepHelper;
1355
- constructor(tracker: CorbadoTracker, config?: EmailOTPOperationConfig);
1955
+ constructor(tracker: CorbadoTrackerCore, config?: EmailOTPOperationConfig);
1356
1956
  /**
1357
1957
  * Rebind the ordered OTP group without starting a new subflow. An empty list detaches it.
1358
1958
  * Also takes opaque {@link SdkInputHandoff}s (additive overload); at runtime they are the input elements.
@@ -1361,6 +1961,13 @@ declare class EmailOtpOperationFull extends OperationFull {
1361
1961
  setInputFields(fields: readonly HTMLInputElement[]): void;
1362
1962
  destroy(): void;
1363
1963
  }
1964
+ /**
1965
+ * Create a {@link EmailOtpOperationFull} for `tracker`: the standalone form of `CorbadoTracker.emailOtpOperationFull()`, for trackers
1966
+ * created by `initCore()` (a bundle that does not import this function does not contain the operation).
1967
+ * Same semantics and documentation as the method.
1968
+ */
1969
+ declare function emailOtpOperationFull(tracker: CorbadoTrackerCore, config?: WithHandoffs<EmailOTPOperationConfig>): EmailOtpOperationFull;
1970
+ declare function emailOtpOperationFull(tracker: CorbadoTrackerCore, config?: EmailOTPOperationConfig): EmailOtpOperationFull;
1364
1971
 
1365
1972
  type SmsOTPOperationSpecType = "sms-otp-login" | "sms-otp-enrollment";
1366
1973
  type SmsOTPOperationPostResponseStart = {
@@ -1377,7 +1984,7 @@ declare class SmsOtpOperationFull extends OperationFull {
1377
1984
  readonly send: StepHelper;
1378
1985
  readonly postResponse: StepHelper<SmsOTPOperationPostResponseStart>;
1379
1986
  readonly resend: StepHelper;
1380
- constructor(tracker: CorbadoTracker, config?: SmsOTPOperationConfig);
1987
+ constructor(tracker: CorbadoTrackerCore, config?: SmsOTPOperationConfig);
1381
1988
  /**
1382
1989
  * Rebind the ordered OTP group without starting a new subflow. An empty list detaches it.
1383
1990
  * Also takes opaque {@link SdkInputHandoff}s (additive overload); at runtime they are the input elements.
@@ -1386,6 +1993,13 @@ declare class SmsOtpOperationFull extends OperationFull {
1386
1993
  setInputFields(fields: readonly HTMLInputElement[]): void;
1387
1994
  destroy(): void;
1388
1995
  }
1996
+ /**
1997
+ * Create a {@link SmsOtpOperationFull} for `tracker`: the standalone form of `CorbadoTracker.smsOtpOperationFull()`, for trackers
1998
+ * created by `initCore()` (a bundle that does not import this function does not contain the operation).
1999
+ * Same semantics and documentation as the method.
2000
+ */
2001
+ declare function smsOtpOperationFull(tracker: CorbadoTrackerCore, config?: WithHandoffs<SmsOTPOperationConfig>): SmsOtpOperationFull;
2002
+ declare function smsOtpOperationFull(tracker: CorbadoTrackerCore, config?: SmsOTPOperationConfig): SmsOtpOperationFull;
1389
2003
 
1390
2004
  type EmailLinkOperationSpecType = "email-link-login" | "email-link-enrollment";
1391
2005
  type EmailLinkOperationSendStart = {
@@ -1424,7 +2038,7 @@ declare class EmailLinkOperationFull extends OperationFull {
1424
2038
  readonly resend: StepHelper;
1425
2039
  /** Transaction ID of this email link; hand it to the page that continues it. */
1426
2040
  readonly transactionId: string;
1427
- constructor(tracker: CorbadoTracker, config?: EmailLinkOperationConfig);
2041
+ constructor(tracker: CorbadoTrackerCore, config?: EmailLinkOperationConfig);
1428
2042
  }
1429
2043
  /**
1430
2044
  * Page 2 of an email-link journey (the link's target): continues the `email-link` subflow started
@@ -1450,7 +2064,7 @@ declare class EmailLinkContinuationOperation extends OperationFull {
1450
2064
  private deferred;
1451
2065
  private readonly onPageHide;
1452
2066
  private removePageHide?;
1453
- constructor(tracker: CorbadoTracker, config?: EmailLinkContinuationConfig);
2067
+ constructor(tracker: CorbadoTrackerCore, config?: EmailLinkContinuationConfig);
1454
2068
  /** Transaction ID of the continued email link, when known. */
1455
2069
  get transactionId(): string | undefined;
1456
2070
  /**
@@ -1469,6 +2083,18 @@ declare class EmailLinkContinuationOperation extends OperationFull {
1469
2083
  /** Defer step calls until the detached start is emitted; mark the continued link on completion. */
1470
2084
  private deferrable;
1471
2085
  }
2086
+ /**
2087
+ * Create a {@link EmailLinkOperationFull} for `tracker`: the standalone form of `CorbadoTracker.emailLinkOperationFull()`, for trackers
2088
+ * created by `initCore()` (a bundle that does not import this function does not contain the operation).
2089
+ * Same semantics and documentation as the method.
2090
+ */
2091
+ declare function emailLinkOperationFull(tracker: CorbadoTrackerCore, config?: EmailLinkOperationConfig): EmailLinkOperationFull;
2092
+ /**
2093
+ * Create a {@link EmailLinkContinuationOperation} for `tracker`: the standalone form of `CorbadoTracker.continueEmailLinkOperation()`, for trackers
2094
+ * created by `initCore()` (a bundle that does not import this function does not contain the operation).
2095
+ * Same semantics and documentation as the method.
2096
+ */
2097
+ declare function continueEmailLinkOperation(tracker: CorbadoTrackerCore, config?: EmailLinkContinuationConfig): EmailLinkContinuationOperation;
1472
2098
 
1473
2099
  /**
1474
2100
  * Passkey-enrollment spec types. Two vocabularies coexist:
@@ -1524,9 +2150,15 @@ declare class PasskeyEnrollmentOperationFull extends OperationFull {
1524
2150
  readonly ceremony: HandoffStepHelper<PasskeyEnrollmentCeremonyStart, PasskeyEnrollmentCeremonyFinished>;
1525
2151
  readonly postResponse: HandoffStepHelper<PasskeyEnrollmentPostResponseStart>;
1526
2152
  private lowEventTracker;
1527
- constructor(tracker: CorbadoTracker, config?: PasskeyEnrollmentOperationConfig);
2153
+ constructor(tracker: CorbadoTrackerCore, config?: PasskeyEnrollmentOperationConfig);
1528
2154
  destroy(): void;
1529
2155
  }
2156
+ /**
2157
+ * Create a {@link PasskeyEnrollmentOperationFull} for `tracker`: the standalone form of `CorbadoTracker.passkeyEnrollmentFullOperation()`, for trackers
2158
+ * created by `initCore()` (a bundle that does not import this function does not contain the operation).
2159
+ * Same semantics and documentation as the method.
2160
+ */
2161
+ declare function passkeyEnrollmentFullOperation(tracker: CorbadoTrackerCore, config?: PasskeyEnrollmentOperationConfig): PasskeyEnrollmentOperationFull;
1530
2162
 
1531
2163
  /** The user dismissed the confirmation dialog without confirming the deletion. */
1532
2164
  type PasskeyDeletionUserConfirmationTypedError = {
@@ -1543,8 +2175,14 @@ declare class PasskeyDeletionOperationFull extends OperationFull {
1543
2175
  readonly userConfirmation: StepHelper<{}, {}, PasskeyDeletionUserConfirmationTypedError>;
1544
2176
  /** The deletion request: finish only when the passkey was actually deleted. */
1545
2177
  readonly deletion: StepHelper<{}, {}, PasskeyDeletionDeletionTypedError>;
1546
- constructor(tracker: CorbadoTracker, _config?: PasskeyDeletionOperationConfig);
2178
+ constructor(tracker: CorbadoTrackerCore, _config?: PasskeyDeletionOperationConfig);
1547
2179
  }
2180
+ /**
2181
+ * Create a {@link PasskeyDeletionOperationFull} for `tracker`: the standalone form of `CorbadoTracker.passkeyDeletionOperationFull()`, for trackers
2182
+ * created by `initCore()` (a bundle that does not import this function does not contain the operation).
2183
+ * Same semantics and documentation as the method.
2184
+ */
2185
+ declare function passkeyDeletionOperationFull(tracker: CorbadoTrackerCore, config?: PasskeyDeletionOperationConfig): PasskeyDeletionOperationFull;
1548
2186
 
1549
2187
  type PasswordLoginTypedError = {
1550
2188
  code: PasswordLoginTypedErrorCode;
@@ -1596,7 +2234,7 @@ declare class PasswordLoginOperationFull extends OperationFull {
1596
2234
  };
1597
2235
  private lowEventTracker?;
1598
2236
  private identifierLowEventTracker?;
1599
- constructor(tracker: CorbadoTracker, config?: PasswordLoginConfig);
2237
+ constructor(tracker: CorbadoTrackerCore, config?: PasswordLoginConfig);
1600
2238
  /**
1601
2239
  * @deprecated `subflow_trigger` is not supported for password-login and will be removed in the
1602
2240
  * next major version.
@@ -1604,6 +2242,13 @@ declare class PasswordLoginOperationFull extends OperationFull {
1604
2242
  trigger(data: SubflowTrigger, options?: StepOptions): void;
1605
2243
  destroy(): void;
1606
2244
  }
2245
+ /**
2246
+ * Create a {@link PasswordLoginOperationFull} for `tracker`: the standalone form of `CorbadoTracker.passwordLoginFullOperation()`, for trackers
2247
+ * created by `initCore()` (a bundle that does not import this function does not contain the operation).
2248
+ * Same semantics and documentation as the method.
2249
+ */
2250
+ declare function passwordLoginFullOperation(tracker: CorbadoTrackerCore, config?: WithHandoffs<PasswordLoginConfig>): PasswordLoginOperationFull;
2251
+ declare function passwordLoginFullOperation(tracker: CorbadoTrackerCore, config?: PasswordLoginConfig): PasswordLoginOperationFull;
1607
2252
 
1608
2253
  type PasswordEnrollmentTypedError = {
1609
2254
  code: PasswordEnrollmentTypedErrorCode;
@@ -1620,9 +2265,16 @@ declare class PasswordEnrollmentOperationFull extends OperationFull {
1620
2265
  readonly clientValidation: StepHelper;
1621
2266
  readonly postResponse: StepHelper<{}, {}, PasswordEnrollmentTypedError>;
1622
2267
  private lowEventTracker?;
1623
- constructor(tracker: CorbadoTracker, config?: PasswordEnrollmentConfig);
2268
+ constructor(tracker: CorbadoTrackerCore, config?: PasswordEnrollmentConfig);
1624
2269
  destroy(): void;
1625
2270
  }
2271
+ /**
2272
+ * Create a {@link PasswordEnrollmentOperationFull} for `tracker`: the standalone form of `CorbadoTracker.passwordEnrollmentFullOperation()`, for trackers
2273
+ * created by `initCore()` (a bundle that does not import this function does not contain the operation).
2274
+ * Same semantics and documentation as the method.
2275
+ */
2276
+ declare function passwordEnrollmentFullOperation(tracker: CorbadoTrackerCore, config?: WithHandoffs<PasswordEnrollmentConfig>): PasswordEnrollmentOperationFull;
2277
+ declare function passwordEnrollmentFullOperation(tracker: CorbadoTrackerCore, config?: PasswordEnrollmentConfig): PasswordEnrollmentOperationFull;
1626
2278
 
1627
2279
  type PasskeyLoginCUITypedError = {
1628
2280
  code: PasskeyLoginCUITypedErrorCode;
@@ -1666,9 +2318,16 @@ declare class OperationFullProvideIdentifierWithCUI extends OperationFull {
1666
2318
  clientValidation: StepHelper;
1667
2319
  postResponse: StepHelper<ProvideIdentifierPostResponseStart>;
1668
2320
  };
1669
- constructor(tracker: CorbadoTracker, config?: OperationFullProvideIdentifierWithCUIConfig);
2321
+ constructor(tracker: CorbadoTrackerCore, config?: OperationFullProvideIdentifierWithCUIConfig);
1670
2322
  destroy(): void;
1671
2323
  }
2324
+ /**
2325
+ * Create a {@link OperationFullProvideIdentifierWithCUI} for `tracker`: the standalone form of `CorbadoTracker.provideIdentifierOperationFull()`, for trackers
2326
+ * created by `initCore()` (a bundle that does not import this function does not contain the operation).
2327
+ * Same semantics and documentation as the method.
2328
+ */
2329
+ declare function provideIdentifierOperationFull(tracker: CorbadoTrackerCore, config?: WithHandoffs<OperationFullProvideIdentifierWithCUIConfig>): OperationFullProvideIdentifierWithCUI;
2330
+ declare function provideIdentifierOperationFull(tracker: CorbadoTrackerCore, config?: OperationFullProvideIdentifierWithCUIConfig): OperationFullProvideIdentifierWithCUI;
1672
2331
 
1673
2332
  type SocialLoginSpecType = "pre-identifier" | "post-identifier";
1674
2333
  /**
@@ -1697,8 +2356,14 @@ type SocialLoginOperationConfig = {
1697
2356
  declare class SocialLoginOperationFull extends OperationFull {
1698
2357
  readonly getRedirectUrl: StepHelper<SocialLoginGetRedirectUrlStart, SocialLoginGetRedirectUrlFinished>;
1699
2358
  readonly exchangeCode: StepHelper<SocialLoginExchangeCodeStart, SocialLoginExchangeCodeFinished>;
1700
- constructor(tracker: CorbadoTracker, config?: SocialLoginOperationConfig);
2359
+ constructor(tracker: CorbadoTrackerCore, config?: SocialLoginOperationConfig);
1701
2360
  }
2361
+ /**
2362
+ * Create a {@link SocialLoginOperationFull} for `tracker`: the standalone form of `CorbadoTracker.socialLoginOperationFull()`, for trackers
2363
+ * created by `initCore()` (a bundle that does not import this function does not contain the operation).
2364
+ * Same semantics and documentation as the method.
2365
+ */
2366
+ declare function socialLoginOperationFull(tracker: CorbadoTrackerCore, config?: SocialLoginOperationConfig): SocialLoginOperationFull;
1702
2367
 
1703
2368
  type SsoLoginSpecType = "pre-identifier" | "post-identifier";
1704
2369
  type SsoLoginGetRedirectUrlStart = {
@@ -1719,8 +2384,14 @@ type SsoLoginOperationConfig = {
1719
2384
  declare class SsoLoginOperationFull extends OperationFull {
1720
2385
  readonly getRedirectUrl: StepHelper<SsoLoginGetRedirectUrlStart, SsoLoginGetRedirectUrlFinished>;
1721
2386
  readonly exchangeCode: StepHelper<SsoLoginExchangeCodeStart, SsoLoginExchangeCodeFinished>;
1722
- constructor(tracker: CorbadoTracker, config?: SsoLoginOperationConfig);
2387
+ constructor(tracker: CorbadoTrackerCore, config?: SsoLoginOperationConfig);
1723
2388
  }
2389
+ /**
2390
+ * Create a {@link SsoLoginOperationFull} for `tracker`: the standalone form of `CorbadoTracker.ssoLoginOperationFull()`, for trackers
2391
+ * created by `initCore()` (a bundle that does not import this function does not contain the operation).
2392
+ * Same semantics and documentation as the method.
2393
+ */
2394
+ declare function ssoLoginOperationFull(tracker: CorbadoTrackerCore, config?: SsoLoginOperationConfig): SsoLoginOperationFull;
1724
2395
 
1725
2396
  type TotpOperationSpecType = "totp-login" | "totp-enrollment";
1726
2397
  type TotpOperationPostResponseStart = {
@@ -1735,7 +2406,7 @@ type TotpOperationConfig = {
1735
2406
  declare class TotpOperationFull extends OperationFull {
1736
2407
  private lowEventTracker?;
1737
2408
  readonly postResponse: StepHelper<TotpOperationPostResponseStart>;
1738
- constructor(tracker: CorbadoTracker, config?: TotpOperationConfig);
2409
+ constructor(tracker: CorbadoTrackerCore, config?: TotpOperationConfig);
1739
2410
  /**
1740
2411
  * Rebind the ordered code input group without starting a new subflow. An empty list detaches it.
1741
2412
  * Also takes opaque {@link SdkInputHandoff}s (additive overload); at runtime they are the input elements.
@@ -1744,6 +2415,13 @@ declare class TotpOperationFull extends OperationFull {
1744
2415
  setInputFields(fields: readonly HTMLInputElement[]): void;
1745
2416
  destroy(): void;
1746
2417
  }
2418
+ /**
2419
+ * Create a {@link TotpOperationFull} for `tracker`: the standalone form of `CorbadoTracker.totpOperationFull()`, for trackers
2420
+ * created by `initCore()` (a bundle that does not import this function does not contain the operation).
2421
+ * Same semantics and documentation as the method.
2422
+ */
2423
+ declare function totpOperationFull(tracker: CorbadoTrackerCore, config?: WithHandoffs<TotpOperationConfig>): TotpOperationFull;
2424
+ declare function totpOperationFull(tracker: CorbadoTrackerCore, config?: TotpOperationConfig): TotpOperationFull;
1747
2425
 
1748
2426
  /** How the confirmation is reached: a QR handoff, an app on the browser's device, or a push to an already-enrolled device. */
1749
2427
  type AppConfirmationOperationSpecType = "qr-code" | "same-device" | "push";
@@ -1763,8 +2441,14 @@ declare class AppConfirmationOperationFull extends OperationFull {
1763
2441
  readonly retry: StepHelper;
1764
2442
  /** Optional separate browser exchange after approval; omit when the final poll already proves acceptance. */
1765
2443
  readonly postResponse: StepHelper;
1766
- constructor(tracker: CorbadoTracker, config?: AppConfirmationOperationConfig);
2444
+ constructor(tracker: CorbadoTrackerCore, config?: AppConfirmationOperationConfig);
1767
2445
  }
2446
+ /**
2447
+ * Create a {@link AppConfirmationOperationFull} for `tracker`: the standalone form of `CorbadoTracker.appConfirmationOperationFull()`, for trackers
2448
+ * created by `initCore()` (a bundle that does not import this function does not contain the operation).
2449
+ * Same semantics and documentation as the method.
2450
+ */
2451
+ declare function appConfirmationOperationFull(tracker: CorbadoTrackerCore, config?: AppConfirmationOperationConfig): AppConfirmationOperationFull;
1768
2452
 
1769
2453
  /**
1770
2454
  * Which captcha widget the integration observed.
@@ -1780,8 +2464,14 @@ declare class CaptchaOperationFull extends OperationFull {
1780
2464
  readonly ceremony: StepHelper;
1781
2465
  /** Submission of the captcha token and the server's verdict on it. */
1782
2466
  readonly postResponse: StepHelper;
1783
- constructor(tracker: CorbadoTracker, config?: CaptchaOperationConfig);
2467
+ constructor(tracker: CorbadoTrackerCore, config?: CaptchaOperationConfig);
1784
2468
  }
2469
+ /**
2470
+ * Create a {@link CaptchaOperationFull} for `tracker`: the standalone form of `CorbadoTracker.captchaOperationFull()`, for trackers
2471
+ * created by `initCore()` (a bundle that does not import this function does not contain the operation).
2472
+ * Same semantics and documentation as the method.
2473
+ */
2474
+ declare function captchaOperationFull(tracker: CorbadoTrackerCore, config?: CaptchaOperationConfig): CaptchaOperationFull;
1785
2475
 
1786
2476
  type FormOperationConfig = {
1787
2477
  /**
@@ -1816,7 +2506,7 @@ declare class FormOperationFull extends OperationFull {
1816
2506
  /** The user leaves the form forward without submitting it. */
1817
2507
  readonly skip: StepHelper;
1818
2508
  private readonly inputBinding?;
1819
- constructor(tracker: CorbadoTracker, config: FormOperationConfig);
2509
+ constructor(tracker: CorbadoTrackerCore, config: FormOperationConfig);
1820
2510
  /**
1821
2511
  * Bind the fields the form shows now, without starting a new subflow. An empty list detaches all.
1822
2512
  * Also takes opaque {@link SdkInputHandoff}s (additive overload); at runtime they are the input elements.
@@ -1825,6 +2515,13 @@ declare class FormOperationFull extends OperationFull {
1825
2515
  setInputFields(fields: readonly HTMLInputElement[]): void;
1826
2516
  destroy(): void;
1827
2517
  }
2518
+ /**
2519
+ * Create a {@link FormOperationFull} for `tracker`: the standalone form of `CorbadoTracker.formOperationFull()`, for trackers
2520
+ * created by `initCore()` (a bundle that does not import this function does not contain the operation).
2521
+ * Same semantics and documentation as the method.
2522
+ */
2523
+ declare function formOperationFull(tracker: CorbadoTrackerCore, config: WithHandoffs<FormOperationConfig>): FormOperationFull;
2524
+ declare function formOperationFull(tracker: CorbadoTrackerCore, config: FormOperationConfig): FormOperationFull;
1828
2525
 
1829
2526
  type TrustedDevicePurpose = "additional-verification" | "mfa-exemption";
1830
2527
  type TrustedDeviceStorage = "cookie" | "indexeddb" | "localstore" | "sessionstore";
@@ -1869,7 +2566,7 @@ declare class TrustedDeviceCheckOperationFull extends OperationFull {
1869
2566
  readonly getOptions: StepHelper<{}, TrustedDeviceCheckStepResult, TrustedDeviceCheckTypedError>;
1870
2567
  readonly ceremony: StepHelper<{}, TrustedDeviceCheckStepResult, TrustedDeviceCheckTypedError>;
1871
2568
  readonly postResponse: StepHelper<{}, TrustedDeviceCheckResult, TrustedDeviceCheckTypedError>;
1872
- constructor(tracker: CorbadoTracker, config: TrustedDeviceCheckConfig);
2569
+ constructor(tracker: CorbadoTrackerCore, config: TrustedDeviceCheckConfig);
1873
2570
  private checkStep;
1874
2571
  }
1875
2572
  /** Finish registration/renewal after host acceptance. Explicit user opt-out reports skipped without creating a binding. */
@@ -1877,8 +2574,20 @@ declare class TrustedDeviceEnrollmentOperationFull extends OperationFull {
1877
2574
  readonly getOptions: StepHelper<{}, {}>;
1878
2575
  readonly ceremony: StepHelper<{}, {}>;
1879
2576
  readonly postResponse: StepHelper<{}, TrustedDeviceEnrollmentResult>;
1880
- constructor(tracker: CorbadoTracker, config: TrustedDeviceOperationConfig);
2577
+ constructor(tracker: CorbadoTrackerCore, config: TrustedDeviceOperationConfig);
1881
2578
  }
2579
+ /**
2580
+ * Create a {@link TrustedDeviceCheckOperationFull} for `tracker`: the standalone form of `CorbadoTracker.trustedDeviceCheckOperationFull()`, for trackers
2581
+ * created by `initCore()` (a bundle that does not import this function does not contain the operation).
2582
+ * Same semantics and documentation as the method.
2583
+ */
2584
+ declare function trustedDeviceCheckOperationFull(tracker: CorbadoTrackerCore, config: TrustedDeviceCheckConfig): TrustedDeviceCheckOperationFull;
2585
+ /**
2586
+ * Create a {@link TrustedDeviceEnrollmentOperationFull} for `tracker`: the standalone form of `CorbadoTracker.trustedDeviceEnrollmentOperationFull()`, for trackers
2587
+ * created by `initCore()` (a bundle that does not import this function does not contain the operation).
2588
+ * Same semantics and documentation as the method.
2589
+ */
2590
+ declare function trustedDeviceEnrollmentOperationFull(tracker: CorbadoTrackerCore, config: TrustedDeviceOperationConfig): TrustedDeviceEnrollmentOperationFull;
1882
2591
 
1883
2592
  type ProvideDataOperationSpecType = "signup" | "login" | "recovery" | "enrollment";
1884
2593
  type ProvideDataOperationStart = {
@@ -1899,283 +2608,51 @@ declare class ProvideDataOperationFull extends OperationFull {
1899
2608
  readonly clientValidation: StepHelper;
1900
2609
  readonly postResponse: StepHelper<ProvideDataOperationPostResponseStart>;
1901
2610
  private lowEventTracker?;
1902
- constructor(tracker: CorbadoTracker, config?: ProvideDataOperationConfig);
2611
+ constructor(tracker: CorbadoTrackerCore, config?: ProvideDataOperationConfig);
1903
2612
  destroy(): void;
1904
2613
  }
2614
+ /**
2615
+ * Create a {@link ProvideDataOperationFull} for `tracker`: the standalone form of `CorbadoTracker.provideDataOperationFull()`, for trackers
2616
+ * created by `initCore()` (a bundle that does not import this function does not contain the operation).
2617
+ * Same semantics and documentation as the method.
2618
+ */
2619
+ declare function provideDataOperationFull(tracker: CorbadoTrackerCore, config?: WithHandoffs<ProvideDataOperationConfig>): ProvideDataOperationFull;
2620
+ declare function provideDataOperationFull(tracker: CorbadoTrackerCore, config?: ProvideDataOperationConfig): ProvideDataOperationFull;
1905
2621
 
1906
- interface TrackerOptions {
1907
- /** All persisted SDK state and cross-tab locks are isolated by this project id. */
1908
- projectId: string;
1909
- apiBaseUrl: string;
1910
- apiEventPath?: string;
1911
- /**
1912
- * Per-field overrides over server config and defaults. A complete policy disables remote fetching.
1913
- * Data-collection switches (`pmd`) are deprecated here: use {@link TrackerOptions.fixedDataConfig}.
1914
- */
1915
- sdkConfig?: SdkReliabilityConfigOverrides;
1916
- /**
1917
- * Opt-in: fix the data-collection switches (password-manager and private-mode detection) instead of
1918
- * taking them from the server config or the cached `cbo_sdk_config_cache`. Batches then carry
1919
- * `meta.fixedData: true`. Omitted (default): unchanged, server-driven behaviour. See {@link FixedDataConfig}.
1920
- */
1921
- fixedDataConfig?: FixedDataConfig;
1922
- /** Config endpoint override for integrations that proxy Observe under a different path. */
1923
- apiConfigPath?: string;
1924
- storage?: "cookie" | "local";
1925
- cookieDomain?: string;
1926
- debug?: boolean;
1927
- logger?: Logger;
1928
- /** Minimum time between attaching cached device info to events. */
1929
- deviceInfoDebounceTime?: number;
1930
- /**
1931
- * @deprecated No effect: device info is collected with built-in deadlines (a fast snapshot within
1932
- * 300 ms, slower fields as a later update within 6000 ms). Still accepted so existing integrations
1933
- * keep compiling. It will be removed in a future release.
1934
- */
1935
- deviceInfoCollectorTimeout?: number;
1936
- defaultTags?: Record<string, string>;
1937
- /**
1938
- * Experiment assignments to seed at init (experiment key → variant). Merged over any persisted
1939
- * assignments and then attached to every event the tracker produces (see {@link CorbadoTracker.setExperiment}).
1940
- */
1941
- experiments?: Record<string, string>;
1942
- /**
1943
- * Data policy code to seed at init: a project-scoped non-negative integer (0..255) selecting a
1944
- * policy configured in Corbado (0 is the project default). Overlays any persisted code and is then
1945
- * sent as `meta.dataPolicy` on every batch (see {@link CorbadoTracker.setDataPolicy}).
1946
- */
1947
- dataPolicy?: number;
1948
- /**
1949
- * Version of the integration that drives the SDK (e.g. an autocapture bundle `"1.1.22"`), sent as
1950
- * `sdk.integrationVersion` on every batch so analyses can cohort sessions by integration version.
1951
- * At most 32 characters of `[0-9A-Za-z.+_-]`; any other value is ignored (logged in debug mode).
1952
- */
1953
- integrationVersion?: string;
1954
- applicationId?: string;
1955
- /**
1956
- * @deprecated The flush interval is server-controlled via the SDK reliability config
1957
- * (`flushIntervalMs`). This option only applies as long as no server config has been received
1958
- * (i.e. before the first config response is cached); once a server config is cached it wins.
1959
- * It will be removed in a future release.
1960
- */
1961
- flushInterval?: number;
1962
- }
1963
- declare class CorbadoTracker {
1964
- private options;
1965
- private logger;
1966
- private queue;
1967
- private sessionId;
1968
- private storage;
1969
- private sessionStorage;
1970
- /** Dedicated localStorage engine for reliability state (config cache, outbox, continuity session, seq). */
1971
- private persistentStorage;
1972
- /** Seq/continuity Web Lock name; project-scoped together with the storage keys it guards. */
1973
- private readonly seqLockName;
1974
- /** Current resolved policy. Continuity and persistence stay enabled once activated within a document. */
1975
- private config;
1976
- private readonly configManager?;
1977
- private readonly configOverrides;
1978
- /** Resolved `fixedDataConfig`; undefined when not given (server-driven data switches). */
1979
- private readonly fixedData?;
1980
- private deviceInfoManager;
1981
- private deviceCollector;
1982
- /**
1983
- * Cached per-tab id stamped onto every event's meta (see {@link EventMeta.tabId}). Resolved
1984
- * lazily from the collector's sessionStorage-backed id; stable for the whole page lifetime.
1985
- */
1986
- private eventTabId?;
1987
- private seq;
1988
- /**
1989
- * When the continuity record's `lastActiveAt` was last persisted. Throttles that write inside the
1990
- * seq critical section (see {@link SESSION_ACTIVITY_WRITE_INTERVAL_MS}). 0 = not written yet on
1991
- * this load, so the first allocation always persists.
1992
- */
1993
- private lastActivityWriteAt;
1994
- /** Persistent experiment assignments (experiment key → variant), attached to every produced event. */
1995
- private experiments;
1996
- /**
1997
- * Persistent data policy code, stamped into every batch's `meta.dataPolicy` once set. Never
1998
- * cleared (only overwritten): it survives reloads, session rotation, resetSession and destroy.
1999
- */
2000
- private dataPolicy?;
2001
- /** Self-instrumentation state: re-entrancy guard, readiness, per-load dedupe, and pre-queue buffer. */
2002
- private telemetryReporting;
2003
- private telemetryReady;
2004
- private readonly reportedTelemetryKeys;
2005
- private pendingSelfTelemetry;
2006
- /** Default probe page id (one per tracker instance) and the probe seq counter per page id. */
2007
- private probePageId?;
2008
- private readonly probeSeqs;
2009
- private windowObserver?;
2010
- private passwordManagerSampler?;
2011
- /** Cross-origin session cookie (`fixedDataConfig.crossOriginSession`); undefined when off. */
2012
- private crossOrigin?;
2013
- /** The session this load took from the cross-origin cookie, if any (`meta.crossOriginSession`). */
2014
- private crossOriginAdoptedId?;
2015
- /** @internal Shared passive page observation and per-operation context registration. */
2016
- getWindowObserver(): SharedWindowObserver;
2622
+ /**
2623
+ * The full tracker created by {@link init}: {@link CorbadoTrackerCore} plus every optional feature as a
2624
+ * method (typed operations, `setUser`, `setFlowTags`, `resetSession`, ...), and the option-driven
2625
+ * features (`storage: "cookie"`, `fixedDataConfig.crossOriginSession`, raw-error serialization, probes)
2626
+ * installed from its options.
2627
+ *
2628
+ * @remarks
2629
+ * Each feature method delegates to the standalone function of the same name (e.g.
2630
+ * `tracker.totpOperationFull(config)` is `totpOperationFull(tracker, config)`), so its behaviour is the
2631
+ * same on both trackers. Integrations that care about bundle size use {@link initCore} and import the
2632
+ * functions they call.
2633
+ */
2634
+ declare class CorbadoTracker extends CorbadoTrackerCore {
2017
2635
  constructor(options: TrackerOptions);
2018
- /** Apply init overrides on every refresh; continuity and persistence only activate within a document. */
2019
- private handleConfig;
2020
- /**
2021
- * Returns the logger used by this tracker.
2022
- * @internal
2023
- */
2024
- getLogger(): Logger;
2025
- private applicationTag;
2026
- /**
2027
- * Register the user's variant for an experiment (e.g. `setExperiment("button_color", "blue")`).
2028
- *
2029
- * @remarks
2030
- * Corbado Observe does not assign variants — your app decides, and this records the assignment so
2031
- * Observe can attribute flows to it. The assignment persists (localStorage) across reloads and
2032
- * `resetSession`, and is attached to every event the tracker produces until you change or clear it.
2033
- * Multiple experiments can be active at once. Set it close to where the variant actually affects the
2034
- * user (or use the per-call `experiments` argument on a tracking method) to avoid over-attributing
2035
- * exposure; call {@link clearExperiment} when it no longer applies (e.g. on logout).
2036
- *
2037
- * Never throws: invalid input is ignored with a debug log.
2038
- */
2039
- setExperiment(key: string, variant: string): void;
2040
- /**
2041
- * Register several experiment assignments at once (experiment key → variant). Additive: existing
2042
- * assignments for other keys are kept. See {@link setExperiment}.
2043
- */
2044
- setExperiments(assignments: Record<string, string>): void;
2045
- /** Remove a single experiment assignment. */
2046
- clearExperiment(key: string): void;
2047
- /** Remove all experiment assignments. */
2048
- clearExperiments(): void;
2049
- /** Returns a copy of the currently active experiment assignments. */
2050
- getExperiments(): Record<string, string>;
2051
- /**
2052
- * Returns the currently active public SDK configuration, including live updates.
2053
- *
2054
- * @returns A frozen snapshot, created fresh on every call.
2055
- */
2056
- /** @internal Project-scoped localStorage used by operation helpers (e.g. email-link continuity). */
2057
- getPersistentStorage(): StorageEngine | undefined;
2058
- getSdkConfig(): ObserveSdkConfigSnapshot;
2059
- /**
2060
- * Set the data policy code for this tracker (e.g. `setDataPolicy(1)` once the user agreed to
2061
- * extended processing; `setDataPolicy(0)` to return to the project default). Codes are
2062
- * project-scoped non-negative integers (0..255) selecting a policy configured in Corbado; they
2063
- * carry no ordering.
2064
- *
2065
- * The code is persisted (localStorage, project-scoped) and sent as `meta.dataPolicy` on every
2066
- * subsequent batch, across reloads and session rotation. It is never cleared, only overwritten.
2067
- * The server records the latest code it receives for a session (last write wins). Invalid codes
2068
- * are ignored with a debug log; never throws.
2069
- */
2070
- setDataPolicy(code: number): void;
2071
- /** Returns the current data policy code, or undefined when none has ever been set. */
2072
- getDataPolicy(): number | undefined;
2073
- private static isValidDataPolicy;
2074
- private loadPersistedDataPolicy;
2075
- private persistDataPolicy;
2076
- private static isValidExperimentKey;
2077
- private static isValidExperimentVariant;
2078
- private loadPersistedExperiments;
2079
- private persistExperiments;
2080
- /**
2081
- * Resolves the experiments to attach to one event: the persistent assignments with any per-call
2082
- * override merged on top. Returns undefined when there are none (so the field is omitted).
2083
- */
2084
- private resolveExperiments;
2085
- private isTrackingBlocked;
2086
- /** The cross-origin session cookie when `fixedDataConfig.crossOriginSession` is set and usable here. */
2087
- private createCrossOriginSession;
2088
- /**
2089
- * Last activity of the local session records BEFORE this load rewrites them (both paths, by id), so the
2090
- * cross-origin boot can tell a session that was active here from one this load just created.
2091
- */
2092
- private readLocalSessionActivity;
2093
- /**
2094
- * Reconcile the session this load resolved locally with the cross-origin cookie before the first event:
2095
- * adopt the cookie's session (and persist it locally, so reloads and same-origin tabs follow) or keep
2096
- * the local one, and continue the seq at or above the cookie's mark. Never throws.
2097
- */
2098
- private bootCrossOriginSession;
2099
- /**
2100
- * Resolve the session of this load: locally ({@link resolveSessionId}), then reconciled with the
2101
- * cross-origin cookie when that option is on. Used at boot and by the recovery in `getSessionId`.
2102
- */
2103
- private resolveSession;
2104
- /** `meta.crossOriginSession` of a batch of `sessionId`; undefined while the option is off on this page. */
2105
- private crossOriginSessionMeta;
2106
- private resolveSessionId;
2636
+ /** @internal */
2637
+ isFullTracker(): this is CorbadoTracker;
2107
2638
  /**
2108
- * Resolve the session id from localStorage so it survives reloads and is shared across tabs of the
2109
- * same browser. Rotates after `config.sessionInactivityMs` of inactivity (server-controlled,
2110
- * evaluated at boot), resetting the seq counter.
2639
+ * Register the user's variant for an experiment (e.g. `setExperiment("button_color", "blue")`).
2111
2640
  *
2112
- * Inactivity rotation happens at boot only, here and on the per-tab path {@link resolveSessionId}
2113
- * takes without continuity. Boot is chosen on an assumption, not a guarantee: that a load
2114
- * re-announces its flow, so the fresh session id gets a classifiable flow. That holds where a
2115
- * flow is opened per load. Where one is opened once and carried across loads it does not, and a
2116
- * boot rotation splits that flow — such a project needs a window long enough to span the journey.
2117
- * Mid-page the assumption is not even available: nothing re-announces between two tracked events,
2118
- * so rotating there would leave the started flow unfinished in the old session and the remaining
2119
- * events without a flow start in the new one — one gap counted as a drop-off, one completion
2120
- * counted as nothing. `nextSeq` therefore never rotates on inactivity, on either path.
2121
- */
2122
- private getContinuitySessionId;
2123
- /**
2124
- * Persist the continuity record and remember when, so the throttled refresh in the seq critical
2125
- * section measures from the last write that actually happened — whoever made it.
2126
- */
2127
- private persistContinuitySession;
2128
- /**
2129
- * Read the per-tab session record. A bare string is the format that predates dating: it carries no
2130
- * `lastActiveAt`, so its window can only start on the load that reads it. That load rewrites it in
2131
- * the dated shape, so a tab converts once and ages normally from then on, and the case drains as
2132
- * the rollout replaces the bundles that write it.
2133
- */
2134
- private readPerTabSession;
2135
- /**
2136
- * Persist the per-tab record and remember when, sharing the throttle bookkeeping with the
2137
- * continuity record — a load resolves its session on one path or the other, never both.
2641
+ * @remarks
2642
+ * Corbado Observe does not assign variants — your app decides, and this records the assignment so
2643
+ * Observe can attribute flows to it. The assignment persists (localStorage) across reloads and
2644
+ * `resetSession`, and is attached to every event the tracker produces until you change or clear it.
2645
+ * Multiple experiments can be active at once. Set it close to where the variant actually affects the
2646
+ * user (or use the per-call `experiments` argument on a tracking method) to avoid over-attributing
2647
+ * exposure; call {@link clearExperiment} when it no longer applies (e.g. on logout).
2138
2648
  *
2139
- * An explicit timeout override or server config stamps the window. Otherwise carry forward what
2140
- * the tab already knows, so a defaults boot does not replace a previously configured threshold.
2141
- */
2142
- private persistPerTabSession;
2143
- /** Explicit init timeout wins; otherwise retain the window a prior configured load recorded. */
2144
- private perTabInactivityMs;
2145
- /**
2146
- * Return the next sequence number. With session continuity the counter is persisted so ordering
2147
- * survives reloads/redirects; the read-increment-write runs under a cross-tab Web Lock
2148
- * ({@link SEQ_LOCK_NAME}) so two tabs sharing the session cannot allocate the same seq (where Web
2149
- * Locks are unavailable or exceed the configured timeout it degrades to the historical best-effort merge).
2150
- * Lock grants are FIFO, so seq order matches `track()` call order within a tab. Tracking also keeps the
2151
- * continuity session's `lastActiveAt` fresh (throttled, see {@link SESSION_ACTIVITY_WRITE_INTERVAL_MS}),
2152
- * so the window the NEXT boot evaluates measures real user
2153
- * inactivity instead of time-since-page-load (a long-lived active tab must not rotate the session
2154
- * on the next reload). It never rotates the session itself: the inactivity window is evaluated at
2155
- * boot only ({@link getContinuitySessionId} documents why). Consequence: while a page is never
2156
- * reloaded — foreground idle, bfcache restore, long-lived SPA tab — a session can outlive
2157
- * `sessionInactivityMs`. That inflates flow durations but keeps flow counts correct, which is the
2158
- * better half of the trade. An empty store while this load already has a session id means
2159
- * persistence is failing (or was cleared); the in-memory id is reused then — never re-minted — so
2160
- * a broken store degrades to one session per page load instead of one session per event.
2161
- */
2162
- private nextSeq;
2163
- private resolveTrackingSourcePath;
2164
- /**
2165
- * Per-tab id for event meta, cached after the first successful resolution: the id is
2166
- * sessionStorage-backed and stable for the whole page lifetime.
2649
+ * Never throws: invalid input is ignored with a debug log.
2167
2650
  */
2168
- private resolveEventTabId;
2169
- /** @internal */
2170
- trackSubflowStarted(subflowType: SubflowType, data: Record<string, any>, options?: StepOptions, eventId?: string): void;
2171
- /** @internal */
2172
- trackSubflowTrigger(subflowType: SubflowType, data: Record<string, any>, options?: StepOptions): void;
2173
- /** @internal */
2174
- trackSubflowStepStarted(subflowType: SubflowType, stepName: string, data: Record<string, any>, options?: StepOptions, ignoreAsInteraction?: boolean): void;
2175
- /** @internal */
2176
- trackSubflowStepFinished(subflowType: SubflowType, stepName: string, data: Record<string, any>, options?: StepOptions): void;
2177
- /** @internal */
2178
- trackSubflowStepError(subflowType: SubflowType, stepName: string, data: Record<string, any>, options?: StepOptions): void;
2651
+ setExperiment(key: string, variant: string): void;
2652
+ /** Remove a single experiment assignment. */
2653
+ clearExperiment(key: string): void;
2654
+ /** Remove all experiment assignments. */
2655
+ clearExperiments(): void;
2179
2656
  /**
2180
2657
  * @remarks
2181
2658
  * @internal
@@ -2183,64 +2660,6 @@ declare class CorbadoTracker {
2183
2660
  * step errors are the intended channel; not part of a normal integration.
2184
2661
  */
2185
2662
  trackSubflowError(subflowType: SubflowType, data: Record<string, any>, options?: StepOptions): void;
2186
- /**
2187
- * Error situations:
2188
- * - Blocked user agent (see `isBlockedUserAgent`): skip with a debug log and return
2189
- * - Any error before the event is enqueued (e.g. `JSON.stringify` in debug logging, `queue.enqueue`): log `Failed to process event "<name>" before enqueue`
2190
- *
2191
- * @internal
2192
- */
2193
- track(name: AuthEventName, data: Record<string, any>, userReference?: UserReference, tags?: Record<string, string>, contexts?: Record<string, any>, explicitTimestamp?: number, experiments?: Record<string, string>, capture?: {
2194
- id?: string;
2195
- subflowStartEventId?: string;
2196
- sessionId?: string;
2197
- initiator?: StepOptions["initiator"];
2198
- }): Promise<void>;
2199
- /**
2200
- * Track when an authentication flow (or flow selection screen) becomes visible.
2201
- *
2202
- * @remarks
2203
- * Call this once when the user first enters an auth touchpoint (for example account login,
2204
- * checkout login, or account recovery). If users can choose between multiple flows
2205
- * (such as login vs signup), pass `flowNames` and optionally `defaultFlowName`.
2206
- *
2207
- * The returned handle can attach identity after completion with `await flow.enrich({ userId })`.
2208
- * Enrichment requires a backend supporting explicit event targeting.
2209
- *
2210
- * @param data - Flow metadata, including one flow (`flowName`) or multiple candidates (`flowNames`).
2211
- * @param tags - Optional key-value tags for filtering and segmentation.
2212
- * @param experiments - Optional per-call experiment overrides.
2213
- * @param contexts - Optional structured event context (e.g. technical metadata that is not an
2214
- * analytical dimension). Written to the event's `contexts` field verbatim.
2215
- * @param options - Optional `explicitTimestamp` (epoch ms) when the flow became visible earlier than
2216
- * this call, e.g. because an integration confirms a screen only after it stayed up for a while.
2217
- *
2218
- * @example
2219
- * ```typescript
2220
- * tracker.flowStarted({
2221
- * flowNames: ["login", "signup"],
2222
- * defaultFlowName: "login",
2223
- * touchpoint: "account",
2224
- * });
2225
- * ```
2226
- */
2227
- flowStarted(data: FlowStarted | MultiFlowStarted, tags?: Record<string, string>, experiments?: Record<string, string>, contexts?: Record<string, unknown>, options?: Pick<StepOptions, "explicitTimestamp">): FlowHandle;
2228
- /**
2229
- * Track when the user commits to a specific flow.
2230
- *
2231
- * @remarks
2232
- * Use this after presenting alternatives and once you know which path the user takes
2233
- * (for example when identifier checks route to login vs signup).
2234
- *
2235
- * @param data - Selected flow name.
2236
- * @param tags - Optional key-value tags for filtering and segmentation.
2237
- *
2238
- * @example
2239
- * ```typescript
2240
- * tracker.flowDecided({flowName: "signup"});
2241
- * ```
2242
- */
2243
- flowDecided(data: FlowDecided, tags?: Record<string, string>, experiments?: Record<string, string>): void;
2244
2663
  /**
2245
2664
  * Track a business/marketing conversion that is not part of an authentication flow.
2246
2665
  *
@@ -2265,73 +2684,6 @@ declare class CorbadoTracker {
2265
2684
  * ```
2266
2685
  */
2267
2686
  conversion(data: Conversion, tags?: Record<string, string>, experiments?: Record<string, string>): void;
2268
- /**
2269
- * Track when a flow successfully completes.
2270
- *
2271
- * @remarks
2272
- * Fire this when the user has finished the target flow end-to-end, such as completed login,
2273
- * signup, or recovery. Record identity with `setUser()` while the flow is active,
2274
- * or enrich it after completion through the handle returned by `flowStarted()` or by this call.
2275
- *
2276
- * The returned handle targets the flow this event finished, so identity learned only after
2277
- * completion — for example from a profile request that follows account creation — can be
2278
- * attached with `await finished.enrich({ userId })` even on a page that never saw the flow start.
2279
- * Enrichment requires a backend supporting explicit flow-event targeting.
2280
- *
2281
- * Legacy identity fields in `data` remain supported but are deprecated.
2282
- *
2283
- * @param data - Finished flow name, optional explicit outcome, and deprecated user reference fields.
2284
- * @param tags - Optional key-value tags for filtering and segmentation.
2285
- *
2286
- * @example
2287
- * ```typescript
2288
- * const finished = tracker.flowFinished({ flowName: "signup" });
2289
- * const userId = await hashUserId(createdAccountId);
2290
- * await finished.enrich({ userId });
2291
- * ```
2292
- */
2293
- flowFinished(data: FlowFinished, tags?: Record<string, string>, experiments?: Record<string, string>): FlowHandle;
2294
- /** Emits `flow_enriched` against an explicit target, in the session that emitted the target. */
2295
- private flowHandle;
2296
- /**
2297
- * Track when an in-progress flow is reset and restarted.
2298
- *
2299
- * @remarks
2300
- * Use this when users abandon the current path and return to the beginning of the same flow,
2301
- * for example after switching account/identifier and reopening the first step.
2302
- *
2303
- * @param data - Flow name being reset.
2304
- * @param tags - Optional key-value tags for filtering and segmentation.
2305
- *
2306
- * @example
2307
- * ```typescript
2308
- * tracker.flowReset({flowName: "login"});
2309
- * ```
2310
- */
2311
- flowReset(data: FlowReset | MultiFlowReset, tags?: Record<string, string>, experiments?: Record<string, string>): void;
2312
- /**
2313
- * Track when a flow is considered finished because another flow finished it implicitly.
2314
- *
2315
- * @remarks
2316
- * Use this for automatic completions where no separate explicit finish action happens in the
2317
- * current flow. Set `flowName` to the auto-finished flow and `finishedByFlowName` to the flow
2318
- * that caused it. Record identity with `setUser()` while the intended flow is still
2319
- * current, before it is auto-finished.
2320
- *
2321
- * Legacy identity fields in `data` remain supported but are deprecated.
2322
- *
2323
- * @param data - Auto-finished flow, finishing flow, and deprecated user reference fields.
2324
- * @param tags - Optional key-value tags for filtering and segmentation.
2325
- *
2326
- * @example
2327
- * ```typescript
2328
- * tracker.flowAutoFinished({
2329
- * flowName: "signup",
2330
- * finishedByFlowName: "login",
2331
- * });
2332
- * ```
2333
- */
2334
- flowAutoFinished(data: FlowAutoFinished, tags?: Record<string, string>, experiments?: Record<string, string>): void;
2335
2687
  /**
2336
2688
  * Record a newly known user reference for the current active flow.
2337
2689
  *
@@ -2384,30 +2736,6 @@ declare class CorbadoTracker {
2384
2736
  * ```
2385
2737
  */
2386
2738
  setFlowTags(tags: Record<string, string>, options?: SetFlowTagsOptions): void;
2387
- /**
2388
- * Track when you present authentication method choices to the user.
2389
- *
2390
- * @remarks
2391
- * Use this whenever a decision point is shown with a concrete method set, such as
2392
- * identifier entry options (`d1`) or post-identifier options (`d3`). Set
2393
- * `explicitDecisionValue` when the options are re-offered after a user action and you want
2394
- * to capture what triggered that transition.
2395
- *
2396
- * @param data - Decision identifier, offered options, and optional transition reason.
2397
- * @param tags - Optional key-value tags for filtering and segmentation.
2398
- * @param experiments - Optional per-call experiment assignments.
2399
- * @param options - Optional explicit event timestamp.
2400
- *
2401
- * @example
2402
- * ```typescript
2403
- * tracker.authMethodsDecisionStarted({
2404
- * decisionName: "d3",
2405
- * options: ["passkey", "social-google", "password", "reset-flow"],
2406
- * });
2407
- * ```
2408
- */
2409
- authMethodsDecisionStarted(data: AuthMethodDecisionStarted, tags?: Record<string, string>, experiments?: Record<string, string>, options?: Pick<StepOptions, "explicitTimestamp">): void;
2410
- authMethodsDecisionFinished(data: AuthMethodDecisionFinished, tags?: Record<string, string>, experiments?: Record<string, string>): void;
2411
2739
  /**
2412
2740
  * @deprecated Use {@link CorbadoTracker.authMethodsDecisionStarted} instead (its `options`
2413
2741
  * already accept free-form strings).
@@ -2415,32 +2743,9 @@ declare class CorbadoTracker {
2415
2743
  authDecisionStarted(data: AuthDecisionStarted, tags?: Record<string, string>, experiments?: Record<string, string>): void;
2416
2744
  /**
2417
2745
  * @deprecated Use {@link CorbadoTracker.authMethodsDecisionFinished} instead (its `options`
2418
- * already accept free-form strings).
2419
- */
2420
- authDecisionFinished(data: AuthDecisionFinished, tags?: Record<string, string>, experiments?: Record<string, string>): void;
2421
- /**
2422
- * Enqueue a "low" event (granular DOM/window/visualviewport/PWM signal) for the current session.
2423
- *
2424
- * @remarks
2425
- * Low events are sent in the `lows` array of the events endpoint payload, alongside any
2426
- * pending typed events. Blocked user agents are skipped silently.
2427
- *
2428
- * @internal
2429
- */
2430
- enqueueLowEvent(low: LowEvent, capturedSessionId?: string): void;
2431
- /**
2432
- * Record a diagnostic telemetry entry (a `level` + free-form `message`) for the current session.
2433
- *
2434
- * @remarks
2435
- * Telemetry is delivered in the `telemetry` array of the events endpoint payload, tied to the same
2436
- * session, and is never classified as an auth-flow event. By default a telemetry entry piggybacks
2437
- * the next normal flush (it does not trigger one on its own); this is server-controlled. Collection
2438
- * can be turned off server-side via the `telemetry` config flag. Blocked user agents are skipped.
2439
- *
2440
- * The message is truncated to {@link TELEMETRY_MESSAGE_MAX} characters. Never pass credentials or
2441
- * PII — telemetry is for diagnostics only. Like all SDK entry points, this never throws.
2746
+ * already accept free-form strings).
2442
2747
  */
2443
- telemetry(level: TelemetryLevel, message: string): void;
2748
+ authDecisionFinished(data: AuthDecisionFinished, tags?: Record<string, string>, experiments?: Record<string, string>): void;
2444
2749
  /**
2445
2750
  * Queue a probe item (diagnostic capture produced by a Corbado autocapture bundle).
2446
2751
  *
@@ -2454,61 +2759,10 @@ declare class CorbadoTracker {
2454
2759
  * @internal
2455
2760
  */
2456
2761
  probe(input: ProbeInput): void;
2457
- private defaultProbePageId;
2458
- private nextProbeSeq;
2459
2762
  /** Convenience wrapper for {@link CorbadoTracker.telemetry} at `info` level. */
2460
2763
  logInfo(message: string): void;
2461
2764
  /** Convenience wrapper for {@link CorbadoTracker.telemetry} at `error` level. */
2462
2765
  logError(message: string): void;
2463
- /**
2464
- * Queue hook run right before an event batch is sent: a device info snapshot that no event carried
2465
- * yet (typically the fast snapshot after a burst of events at page load, or the privateMode update)
2466
- * rides the first event of this page in the batch that has none. Events of other pages (outbox
2467
- * replays) are never touched. A snapshot no event can carry goes as the batch's request-level device
2468
- * info instead (queue option `standaloneDeviceInfo`).
2469
- *
2470
- * Error situations:
2471
- * - Any error: log "Failed to attach device info to batch" and send the batch unchanged
2472
- */
2473
- private attachUndeliveredDeviceInfo;
2474
- /**
2475
- * Escalate an internal SDK diagnostic to the telemetry stream (self-instrumentation). This is the
2476
- * sink behind {@link Logger.reportTelemetry}; chosen internal failure sites route here so faults
2477
- * that are otherwise only visible with `debug: true` become observable in the field.
2478
- *
2479
- * @remarks
2480
- * Bounded and deduped per load (a persistent fault — blocked storage, a downed endpoint — cannot
2481
- * flood the stream), re-entrancy-guarded so it can never recurse, and it never throws into the
2482
- * host. Diagnostics raised before the queue exists (early boot) are buffered and replayed once the
2483
- * queue is ready. Messages must be stable and low-cardinality (no raw error objects / PII).
2484
- */
2485
- private reportTelemetry;
2486
- /**
2487
- * Synchronously flush any pending events and low events via beacon. Use during page-unload
2488
- * style teardown where async flushing is unreliable.
2489
- *
2490
- * @param reason What triggered the flush; recorded as `meta.flushReason` on the batch. Defaults
2491
- * to a direct call by the host app.
2492
- *
2493
- * @internal
2494
- */
2495
- flushKeepalive(reason?: FlushReason): void;
2496
- /**
2497
- * Whether input trackers run the DOM password-manager scan (`pa-1`..`pa-6` lows): only an explicitly
2498
- * set `fixedDataConfig.pmd` decides; without `fixedDataConfig` or with `pmd` omitted it always runs
2499
- * (historical behaviour).
2500
- *
2501
- * @internal
2502
- */
2503
- isPasswordManagerDomScanEnabled(): boolean;
2504
- /**
2505
- * Keepalive flush requested by a low-event tracker's `pagehide` teardown. Gated by the
2506
- * server-controlled trigger switch `tlf` (boot-snapshot, default true = historical behavior):
2507
- * disabling it server-side makes low-event delivery rely solely on the queue's own triggers.
2508
- *
2509
- * @internal
2510
- */
2511
- lowEventFlushKeepalive(): void;
2512
2766
  passkeyLoginFullOperation(config?: PasskeyLoginOperationConfig): PasskeyLoginOperationFull;
2513
2767
  passkeyEnrollmentFullOperation(config?: PasskeyEnrollmentOperationConfig): PasskeyEnrollmentOperationFull;
2514
2768
  /**
@@ -2755,49 +3009,6 @@ declare class CorbadoTracker {
2755
3009
  * ```
2756
3010
  */
2757
3011
  trustedDeviceEnrollmentOperationFull(config: TrustedDeviceOperationConfig): TrustedDeviceEnrollmentOperationFull;
2758
- /**
2759
- * Flush any pending events and release all resources (timers, event listeners).
2760
- *
2761
- * @remarks
2762
- * After calling destroy, the tracker must not be used. Operation objects
2763
- * returned by factory methods (e.g. `passwordLoginFullOperation`) that hold
2764
- * DOM references must be destroyed separately by the caller.
2765
- * The final flush is gated by the server-controlled trigger switch `td` (default true);
2766
- * resources are released either way.
2767
- */
2768
- destroy(): Promise<void>;
2769
- /**
2770
- * Return the Observe session id this tracker is currently reporting under.
2771
- *
2772
- * @remarks
2773
- * Use this to route a server-side event into the same session the browser reports to: read the id,
2774
- * pass it to your own backend, and let the backend use it as the `sessionID` of its ingest call.
2775
- * Reading it here is the supported path — the storage layout behind it is an implementation detail
2776
- * that has already changed once (per-tab `sessionStorage` to the cross-tab continuity record).
2777
- *
2778
- * The value is **not stable for the lifetime of the page**. It changes on
2779
- * {@link CorbadoTracker.resetSession}, when this tab adopts a continuity session another tab
2780
- * rotated to, and when a failed bootstrap recovers. Read it at the moment you need it; never cache
2781
- * it across a request.
2782
- *
2783
- * `undefined` means no session id could be established at all — an environment without Web Crypto,
2784
- * where tracking is not working either. Skip the server-side event instead of sending an empty id:
2785
- * the ingest API requires a UUID and would reject the batch.
2786
- *
2787
- * @returns The current session id, or `undefined` if none could be established.
2788
- *
2789
- * @example
2790
- * ```typescript
2791
- * const sessionId = tracker.getSessionId();
2792
- * if (sessionId) {
2793
- * await fetch("/api/checkout", {
2794
- * method: "POST",
2795
- * body: JSON.stringify({ ...payload, observeSessionId: sessionId }),
2796
- * });
2797
- * }
2798
- * ```
2799
- */
2800
- getSessionId(): string | undefined;
2801
3012
  /**
2802
3013
  * Store an opaque context string with the cross-origin session, for the integration's own use on the
2803
3014
  * next origin (e.g. a journey id and stage). Requires `fixedDataConfig.crossOriginSession`.
@@ -2835,6 +3046,198 @@ declare class CorbadoTracker {
2835
3046
  declare const SDK_NAME = "@corbado/observe";
2836
3047
  declare const SDK_VERSION: string;
2837
3048
 
3049
+ /**
3050
+ * Start a new session for `tracker` (the default tracker when omitted) and return its id.
3051
+ *
3052
+ * @remarks
3053
+ * The seq restarts at 0; experiments and the data policy are kept (they are user-level facts). With the
3054
+ * cross-origin session the shared cookie moves to the new session (without a context string).
3055
+ *
3056
+ * @internal
3057
+ */
3058
+ declare function resetSession(): string | undefined;
3059
+ declare function resetSession(tracker: CorbadoTrackerCore): string;
3060
+ /**
3061
+ * Record a newly known user reference for the current active flow of `tracker` (the default tracker
3062
+ * when omitted). Call after the flow starts and before it finishes; matching has no grace period.
3063
+ *
3064
+ * @remarks
3065
+ * Emits one `flow_enriched` with `match: { flowType: "*", at: "during" }` and `expFol: true` in its data.
3066
+ * The enrichment belongs to the current flow at emission time. Calling after `flowFinished()` cannot
3067
+ * enrich that finished flow. If a parent or another flow is current then, the enrichment belongs to
3068
+ * that flow instead. An empty reference does not clear identity. Cross-environment transaction IDs must
3069
+ * be UUIDs; both environments must report the shared ID while their respective flows are active.
3070
+ *
3071
+ * @example
3072
+ * ```typescript
3073
+ * tracker.flowStarted({ flowName: "login" });
3074
+ * setUser(tracker, { userId: "usr_123", identifier: "max@example.com" });
3075
+ * tracker.flowFinished({ flowName: "login" });
3076
+ * ```
3077
+ */
3078
+ declare function setUser(user: UserReference): void;
3079
+ declare function setUser(tracker: CorbadoTrackerCore, user: UserReference): void;
3080
+ /**
3081
+ * Attach tags to the flow of `tracker` (the default tracker when omitted) that is open right now.
3082
+ *
3083
+ * @remarks
3084
+ * Emits one `flow_enriched` carrying `tags` and no user reference, with data
3085
+ * `{ match: { flowType, at: "during" } }` plus `expCh` / `expFol` when the options set them.
3086
+ *
3087
+ * - The tags land on the innermost flow open at call time (of `flowType` when given; default `"*"`, any type).
3088
+ * - `expandToChildren` (default `true`): child flows of that flow inherit the tags.
3089
+ * - `expandToFollowing` (default `true`): later sibling flows inherit the tags until the next
3090
+ * sibling of the same flow type as the tagged flow.
3091
+ * - Per key the last `setFlowTags()` value wins; it also overrides a same-key tag passed to that
3092
+ * flow's own tracking calls (e.g. `flowStarted()`).
3093
+ * - Call while the target flow is open. An enrichment after the flow's last container event
3094
+ * (for example after `flowFinished()`) matches no flow and is dropped with a
3095
+ * `flow_enriched/no_matching_flow` classification warning.
3096
+ * - Tag keys and values are case-sensitive. Entries with an empty key or a non-string value are
3097
+ * dropped with a warning; nothing is sent when no valid entry remains.
3098
+ *
3099
+ * @example
3100
+ * ```typescript
3101
+ * tracker.flowStarted({ flowName: "login" });
3102
+ * setFlowTags(tracker, { entryPoint: "checkout" });
3103
+ * tracker.flowFinished({ flowName: "login" });
3104
+ * ```
3105
+ */
3106
+ declare function setFlowTags(tags: Record<string, string>, options?: SetFlowTagsOptions): void;
3107
+ declare function setFlowTags(tracker: CorbadoTrackerCore, tags: Record<string, string>, options?: SetFlowTagsOptions): void;
3108
+ /**
3109
+ * Register the user's variant for an experiment on `tracker` (the default tracker when omitted), e.g.
3110
+ * `setExperiment(tracker, "button_color", "blue")`. See `CorbadoTracker.setExperiment`.
3111
+ * Never throws: invalid input is ignored with a debug log.
3112
+ */
3113
+ declare function setExperiment(key: string, variant: string): void;
3114
+ declare function setExperiment(tracker: CorbadoTrackerCore, key: string, variant: string): void;
3115
+ /** Remove a single experiment assignment of `tracker` (the default tracker when omitted). */
3116
+ declare function clearExperiment(key: string): void;
3117
+ declare function clearExperiment(tracker: CorbadoTrackerCore, key: string): void;
3118
+ /** Remove all experiment assignments of `tracker` (the default tracker when omitted). */
3119
+ declare function clearExperiments(tracker?: CorbadoTrackerCore): void;
3120
+ /** Telemetry entry at `info` level on `tracker` (the default tracker when omitted); see `telemetry`. */
3121
+ declare function logInfo(message: string): void;
3122
+ declare function logInfo(tracker: CorbadoTrackerCore, message: string): void;
3123
+ /** Telemetry entry at `error` level on `tracker` (the default tracker when omitted); see `telemetry`. */
3124
+ declare function logError(message: string): void;
3125
+ declare function logError(tracker: CorbadoTrackerCore, message: string): void;
3126
+ /**
3127
+ * Track a business/marketing conversion that is not part of an authentication flow on `tracker`.
3128
+ * Standalone form of `CorbadoTracker.conversion` (same semantics).
3129
+ */
3130
+ declare function conversion(tracker: CorbadoTrackerCore, data: Conversion, tags?: Record<string, string>, experiments?: Record<string, string>): void;
3131
+ /**
3132
+ * @deprecated Use `tracker.authMethodsDecisionStarted` instead (its `options` already accept free-form
3133
+ * strings). Standalone form of `CorbadoTracker.authDecisionStarted`.
3134
+ */
3135
+ declare function authDecisionStarted(tracker: CorbadoTrackerCore, data: AuthDecisionStarted, tags?: Record<string, string>, experiments?: Record<string, string>): void;
3136
+ /**
3137
+ * @deprecated Use `tracker.authMethodsDecisionFinished` instead (its `options` already accept free-form
3138
+ * strings). Standalone form of `CorbadoTracker.authDecisionFinished`.
3139
+ */
3140
+ declare function authDecisionFinished(tracker: CorbadoTrackerCore, data: AuthDecisionFinished, tags?: Record<string, string>, experiments?: Record<string, string>): void;
3141
+ /**
3142
+ * Records an additional error occurrence against the subflow. Carries no outcome semantics — step
3143
+ * errors are the intended channel; not part of a normal integration.
3144
+ * @internal
3145
+ */
3146
+ declare function trackSubflowError(tracker: CorbadoTrackerCore, subflowType: SubflowType, data: Record<string, any>, options?: StepOptions): void;
3147
+
3148
+ type CookieStorageOptions = {
3149
+ /** `Domain` attribute of the cookies (e.g. `example.com` to share them across subdomains). */
3150
+ cookieDomain?: string;
3151
+ };
3152
+ /**
3153
+ * Tracker plugin: keep the device-level state (device id and device info cache) in first-party
3154
+ * cookies instead of localStorage — the equivalent of `storage: "cookie"` / `cookieDomain` of
3155
+ * {@link init}.
3156
+ *
3157
+ * @example
3158
+ * ```ts
3159
+ * const tracker = initCore({ projectId, apiBaseUrl, plugins: [cookieStorage({ cookieDomain: "example.com" })] });
3160
+ * ```
3161
+ */
3162
+ declare function cookieStorage(options?: CookieStorageOptions): TrackerPlugin;
3163
+
3164
+ /**
3165
+ * Tracker plugin: share the session with the other origins of one site through a first-party cookie
3166
+ * (see {@link CrossOriginSessionConfig}) — the equivalent of `fixedDataConfig.crossOriginSession` of
3167
+ * {@link init}. Read and write the integration's context string with {@link setCrossOriginContext} /
3168
+ * {@link getCrossOriginContext}.
3169
+ *
3170
+ * @example
3171
+ * ```ts
3172
+ * const tracker = initCore({ projectId, apiBaseUrl, plugins: [crossOriginSession({ cookieDomain: "example.com" })] });
3173
+ * ```
3174
+ */
3175
+ declare function crossOriginSession(config: CrossOriginSessionConfig): TrackerPlugin;
3176
+ /**
3177
+ * Store an opaque context string with the cross-origin session of `tracker`, for the integration's own
3178
+ * use on the next origin (e.g. a journey id and stage). Requires the {@link crossOriginSession} plugin
3179
+ * (on the full tracker: `fixedDataConfig.crossOriginSession`).
3180
+ *
3181
+ * @remarks
3182
+ * The value travels in the shared cookie only (see {@link CrossOriginSessionConfig}): it is never sent
3183
+ * to Corbado, but the browser sends the cookie with every request to every subdomain of the configured
3184
+ * domain. It belongs to the current session: a tracker that adopts the session reads it with
3185
+ * {@link getCrossOriginContext}, and a new session (inactivity, `resetSession`) starts without it. At
3186
+ * most 128 characters of `A-Z a-z 0-9 . _ ~ -`; never put personal data in it. `null`, `undefined` or
3187
+ * `""` clears it.
3188
+ *
3189
+ * Never throws.
3190
+ *
3191
+ * @returns `true` when the value was accepted and written; `false` when it is invalid or the feature
3192
+ * is off on this page (not configured, cookie blocked, domain mismatch, not HTTPS).
3193
+ */
3194
+ declare function setCrossOriginContext(tracker: CorbadoTrackerCore, context: string | null | undefined): boolean;
3195
+ /**
3196
+ * The context string stored with the current cross-origin session of `tracker` (see
3197
+ * {@link setCrossOriginContext}), or `undefined` when none is set, the session has no context, or the
3198
+ * feature is off on this page. Never throws.
3199
+ */
3200
+ declare function getCrossOriginContext(tracker: CorbadoTrackerCore): string | undefined;
3201
+
3202
+ /**
3203
+ * Tracker plugin: serialize the `rawError` option of operation step errors
3204
+ * (`op.step.error(error, { rawError })`) into `stepData.rawError` (see `serializeRawError`).
3205
+ *
3206
+ * @remarks
3207
+ * Without it a {@link CorbadoTrackerCore} drops `rawError` (the step error itself is still sent), so
3208
+ * the serializer is not part of a bundle that does not import this plugin. The full `CorbadoTracker`
3209
+ * ({@link init}) always installs it. Serialization stays gated by the server config `rawErrors`.
3210
+ *
3211
+ * @example
3212
+ * ```ts
3213
+ * const tracker = initCore({ projectId, apiBaseUrl, plugins: [rawErrors()] });
3214
+ * ```
3215
+ */
3216
+ declare function rawErrors(): TrackerPlugin;
3217
+
3218
+ /**
3219
+ * Tracker plugin: the SDK probe lane (diagnostic captures of Corbado autocapture bundles, sent with
3220
+ * {@link probe}). The full `CorbadoTracker` ({@link init}) always installs it.
3221
+ *
3222
+ * @experimental Internal: used by Corbado autocapture bundles. Not part of the documented API.
3223
+ * @internal
3224
+ */
3225
+ declare function probes(): TrackerPlugin;
3226
+ /**
3227
+ * Queue a probe item (diagnostic capture produced by a Corbado autocapture bundle). Requires the
3228
+ * {@link probes} plugin; without it the item is dropped (debug log).
3229
+ *
3230
+ * @remarks
3231
+ * The SDK fills `id` (uuidv7), `seq` (per `pageId`), `pageId` (default: one random id per tracker
3232
+ * instance) and `ts` (default: now). Items are held in memory only (never the durable outbox) and
3233
+ * ride the regular batches; they are the lowest priority at page unload. Invalid input is dropped.
3234
+ * The payload must already be redacted. Blocked user agents are skipped. Never throws.
3235
+ *
3236
+ * @experimental Internal: used by Corbado autocapture bundles. Not part of the documented API.
3237
+ * @internal
3238
+ */
3239
+ declare function probe(tracker: CorbadoTrackerCore, input: ProbeInput): void;
3240
+
2838
3241
  interface TransportMakeRequestResponse {
2839
3242
  deliveryAccepted?: boolean;
2840
3243
  statusCode?: number;
@@ -2853,21 +3256,11 @@ interface TransportOptions {
2853
3256
  headers?: Record<string, string>;
2854
3257
  }
2855
3258
 
2856
- /** In-memory probe queue caps (oldest items are dropped beyond them). */
2857
- declare const PROBE_QUEUE_MAX_ITEMS = 500;
2858
- declare const PROBE_QUEUE_MAX_BYTES: number;
2859
- /** Per-request probe caps (the server keeps at most 200 probe items per batch). */
2860
- declare const PROBE_BATCH_MAX_ITEMS = 200;
2861
- declare const PROBE_BATCH_MAX_BYTES: number;
2862
- /** Serialized payload cap per probe item (server rule). */
2863
- declare const PROBE_PAYLOAD_MAX_BYTES: number;
2864
3259
  /**
2865
3260
  * Unload request budget shared by the event beacon and the probe beacon that follows it: unload
2866
3261
  * transports share a ~64 KB in-flight budget per page (same limit as the fetch keepalive cap).
2867
3262
  */
2868
3263
  declare const UNLOAD_BUDGET_BYTES = 60000;
2869
- /** Absolute cap of the probe request at pagehide / destroy. */
2870
- declare const UNLOAD_PROBE_MAX_BYTES = 32000;
2871
3264
  /** UTF-8 byte length of a string (no TextEncoder dependency). */
2872
3265
  declare function utf8Length(text: string): number;
2873
3266
  interface QueueOptions {
@@ -2965,15 +3358,10 @@ declare class RequestQueue {
2965
3358
  */
2966
3359
  private telemetryQueue;
2967
3360
  /**
2968
- * Probe items (`tracker.probe()`): in memory only — never the durable outbox — capped by
2969
- * {@link PROBE_QUEUE_MAX_ITEMS} / {@link PROBE_QUEUE_MAX_BYTES}. They arm the flush timer, ride
2970
- * the regular batches (probe-only batches allowed), retry under `config.retry`, and are the lowest
2971
- * priority at unload (a separate request after the event request, within the remaining budget).
3361
+ * Optional probe lane (`probes()` plugin, see {@link ProbeLane}); without one, probe items are dropped
3362
+ * and the flush paths below never see any.
2972
3363
  */
2973
- private probeQueue;
2974
- private probeBytes;
2975
- /** Probe items dropped on this load (caps, permanent rejection, exhausted retries, unload budget). */
2976
- private probesDropped;
3364
+ private lane?;
2977
3365
  private timer;
2978
3366
  private isFlushing;
2979
3367
  private flushingDone?;
@@ -3050,29 +3438,18 @@ declare class RequestQueue {
3050
3438
  */
3051
3439
  enqueueTelemetry(entry: TelemetryEntry): void;
3052
3440
  /**
3053
- * Queue a probe item (in memory only). The payload is snapshotted (serialized once) so later host
3054
- * mutations cannot change it; items over {@link PROBE_PAYLOAD_MAX_BYTES} are dropped, and the
3055
- * oldest items are dropped beyond the queue caps. Arms the normal flush timer.
3441
+ * Queue a probe item (in memory only) on the probe lane (see {@link ProbeLane} for snapshotting and
3442
+ * caps). Arms the normal flush timer. Installed with the lane by the `probes()` plugin
3443
+ * ({@link installProbeLane}; always on the full `CorbadoTracker`): a queue without a lane has neither
3444
+ * this nor {@link droppedProbeCount} at runtime (the type keeps the 1.10 shape), so core-only bundles
3445
+ * carry no probe code. Check for the lane (`probe(tracker, input)` does) before calling.
3056
3446
  *
3057
3447
  * Error situations:
3058
3448
  * - Any error while enqueueing or scheduling the flush timer: log "Failed to enqueue probe"
3059
3449
  */
3060
- enqueueProbe(entry: ProbeEntry, capturedSessionId?: string): void;
3061
- /** Number of probe items dropped on this load (diagnostics / tests). */
3062
- droppedProbeCount(): number;
3063
- private dueProbes;
3064
- /** Oldest-first selection for one session, within an item and byte cap (at least one item when any fits the item cap). */
3065
- private selectProbes;
3066
- private removeProbes;
3067
- private dropProbes;
3068
- /** Same policy as events: 2xx delivered, non-retryable dropped, retryable backed off up to `config.retry.maxAttempts`. */
3069
- private handleProbeSendResult;
3070
- /**
3071
- * Unload / final teardown: one probe-only request for the current session within `budget` bytes,
3072
- * sent after the event request so the events' delivery is unaffected. Leftovers are dropped when
3073
- * `dropRest` (pagehide, destroy); otherwise they stay queued.
3074
- */
3075
- private sendUnloadProbes;
3450
+ enqueueProbe: (entry: ProbeEntry, capturedSessionId?: string) => void;
3451
+ /** Number of probe items dropped on this load (diagnostics / tests); installed with the lane. */
3452
+ droppedProbeCount: () => number;
3076
3453
  private scheduleAfterEnqueue;
3077
3454
  /**
3078
3455
  * Whether this event completes one of the configured priority flow types. Only the two flow
@@ -3175,6 +3552,85 @@ declare class RequestQueue {
3175
3552
  destroy(): void;
3176
3553
  }
3177
3554
 
3555
+ /** In-memory probe queue caps (oldest items are dropped beyond them). */
3556
+ declare const PROBE_QUEUE_MAX_ITEMS = 500;
3557
+ declare const PROBE_QUEUE_MAX_BYTES: number;
3558
+ /** Per-request probe caps (the server keeps at most 200 probe items per batch). */
3559
+ declare const PROBE_BATCH_MAX_ITEMS = 200;
3560
+ declare const PROBE_BATCH_MAX_BYTES: number;
3561
+ /** Serialized payload cap per probe item (server rule). */
3562
+ declare const PROBE_PAYLOAD_MAX_BYTES: number;
3563
+ /** Absolute cap of the probe request at pagehide / destroy. */
3564
+ declare const UNLOAD_PROBE_MAX_BYTES = 32000;
3565
+ /**
3566
+ * Install a probe lane on `queue` together with the queue's probe entry points (`enqueueProbe`,
3567
+ * `droppedProbeCount`): what the `probes()` plugin does. Idempotent: returns the installed lane.
3568
+ * @internal
3569
+ */
3570
+ declare function installProbeLane(queue: RequestQueue): ProbeLane;
3571
+ /**
3572
+ * A queued probe item: in memory only, keeps the session it was captured in, retried like events.
3573
+ * @internal
3574
+ */
3575
+ interface ProbePending {
3576
+ sessionId: string;
3577
+ entry: ProbeEntry;
3578
+ bytes: number;
3579
+ attempts: number;
3580
+ flushAfter: number;
3581
+ }
3582
+ /**
3583
+ * The probe lane of a {@link RequestQueue}: probe items (`probe(tracker, input)`), in memory only —
3584
+ * never the durable outbox — capped by {@link PROBE_QUEUE_MAX_ITEMS} / {@link PROBE_QUEUE_MAX_BYTES}.
3585
+ * They arm the flush timer, ride the regular batches (probe-only batches allowed), retry under
3586
+ * `config.retry`, and are the lowest priority at unload (a separate request after the event request,
3587
+ * within the remaining budget).
3588
+ *
3589
+ * @remarks
3590
+ * Optional: installed by the `probes()` tracker plugin (always on the full `CorbadoTracker`). A queue
3591
+ * without a lane drops probe items, and a bundle that never imports `probes()` contains none of this.
3592
+ * The lane is a package-internal friend of the queue: it reads the queue's delivery state directly.
3593
+ *
3594
+ * @internal
3595
+ */
3596
+ declare class ProbeLane {
3597
+ private readonly queue;
3598
+ /** Queued items, oldest first; read by the queue's flush paths. */
3599
+ items: ProbePending[];
3600
+ private bytes;
3601
+ /** Probe items dropped on this load (caps, permanent rejection, exhausted retries, unload budget). */
3602
+ dropped: number;
3603
+ /** Default probe page id (one per tracker instance) and the probe seq counter per page id. */
3604
+ private pageId?;
3605
+ private readonly seqs;
3606
+ constructor(queue: RequestQueue);
3607
+ /**
3608
+ * Queue a probe item. The payload is snapshotted (serialized once) so later host mutations cannot
3609
+ * change it; items over {@link PROBE_PAYLOAD_MAX_BYTES} are dropped, and the oldest items are dropped
3610
+ * beyond the queue caps. Arms the normal flush timer. Throws on unexpected errors (the queue logs).
3611
+ */
3612
+ enqueue(entry: ProbeEntry, capturedSessionId: string): void;
3613
+ /** The probe part of one regular batch of `sessionId`. */
3614
+ selectBatch(candidates: ProbePending[], sessionId: string): ProbePending[];
3615
+ /** Oldest-first selection for one session, within an item and byte cap (at least one item when any fits the item cap). */
3616
+ private select;
3617
+ private remove;
3618
+ /** Drop `items` (all of them: `drop(lane.items.slice())`), counting them as dropped. */
3619
+ drop(items: ProbePending[]): void;
3620
+ /** Same policy as events: 2xx delivered, non-retryable dropped, retryable backed off up to `config.retry.maxAttempts`. */
3621
+ handleResult(response: TransportMakeRequestResponse, items: ProbePending[], now: number): void;
3622
+ /**
3623
+ * Unload / final teardown: one probe-only request for the current session within `budget` bytes,
3624
+ * sent after the event request so the events' delivery is unaffected. Leftovers are dropped when
3625
+ * `dropRest` (pagehide, destroy); otherwise they stay queued.
3626
+ */
3627
+ sendUnload(budget: number, reason: FlushReason, dropRest: boolean, useBeacon: boolean): void;
3628
+ /** Default page id of probe items without one: one random id per lane (= per tracker instance). */
3629
+ defaultPageId(): string;
3630
+ /** Next probe seq of `pageId` (per-page counters, the oldest forgotten beyond {@link PROBE_PAGE_IDS_MAX}). */
3631
+ nextSeq(pageId: string): number;
3632
+ }
3633
+
3178
3634
  /** Config cache of older SDKs: read as a stale fallback until the first {@link CONFIG_CACHE_STORAGE_KEY} write. */
3179
3635
  declare const CONFIG_STORAGE_KEY = "cbo_sdk_config";
3180
3636
  /** Last-known server config with its source endpoint and freshness, written as one record. */
@@ -3263,17 +3719,11 @@ declare function resolveReliabilityConfig(serverConfig: SdkReliabilityConfig | u
3263
3719
  type ResolvedFixedDataConfig = Required<Omit<FixedDataConfig, "crossOriginSession">> & {
3264
3720
  /** Cross-origin session option as given (domain not yet checked against the page); absent when not set. */
3265
3721
  crossOriginSession?: CrossOriginSessionConfig;
3266
- /**
3267
- * Whether `pmd` was set explicitly (a boolean). Only an explicit `pmd` gates the DOM password-manager
3268
- * scan (`pa-1`..`pa-6`); an omitted `pmd` turns the extension probes off but leaves the scan on.
3269
- */
3270
- pmdExplicit: boolean;
3271
3722
  };
3272
3723
  /**
3273
3724
  * Resolve `init({ fixedDataConfig })`. Returns `undefined` (not fixed: server-driven, today's behaviour)
3274
3725
  * unless the option is an object. A missing or non-boolean `pmd` resolves to `false` (not the built-in
3275
- * default and not `sdkConfig.pmd`: a fixed config collects only what it names) with `pmdExplicit: false`;
3276
- * a missing or non-boolean `privateMode` resolves to on. `crossOriginSession` is kept only with a string
3726
+ * default and not `sdkConfig.pmd`: a fixed config collects only what it names); a missing or non-boolean `privateMode` resolves to on. `crossOriginSession` is kept only with a string
3277
3727
  * `cookieDomain` (checked against the page later). Never throws.
3278
3728
  *
3279
3729
  * @internal
@@ -3432,33 +3882,44 @@ declare function sanitizeAssertionResponse(value: unknown, projectors?: WebAuthn
3432
3882
  * their methods, or construct {@link CorbadoTracker} instances directly without changing the default.
3433
3883
  */
3434
3884
  declare function init(options: TrackerOptions): CorbadoTracker;
3435
- /** Return the default tracker from the most recent {@link init} call. */
3436
- declare function getTracker(): CorbadoTracker | undefined;
3437
- declare function resetSession(): string | undefined;
3438
3885
  /**
3439
- * Session id of the global tracker, or `undefined` when no tracker was initialized or no session
3440
- * could be established. See {@link CorbadoTracker.getSessionId}.
3886
+ * Create a {@link CorbadoTrackerCore} and make it the default for all package-level helpers — the
3887
+ * tree-shakeable counterpart of {@link init} for integrations that care about bundle size.
3888
+ *
3889
+ * @remarks
3890
+ * The core sends exactly what {@link init} sends for the same calls. Optional features are imported:
3891
+ * typed operations and the other tracker features as standalone functions that take the tracker
3892
+ * (`passkeyLoginFullOperation(tracker, config)`, `setUser(tracker, user)`, `resetSession(tracker)`, ...),
3893
+ * option-driven features as plugins (`cookieStorage()`, `crossOriginSession()`, `rawErrors()`,
3894
+ * `probes()`), see {@link TrackerCoreOptions}. Code that is not imported is not in the bundle.
3895
+ *
3896
+ * @example
3897
+ * ```ts
3898
+ * import { initCore, passkeyLoginFullOperation, rawErrors, setUser } from "@corbado/observe";
3899
+ *
3900
+ * const tracker = initCore({ projectId, apiBaseUrl, plugins: [rawErrors()] });
3901
+ * tracker.flowStarted({ flowName: "login" });
3902
+ * const passkey = passkeyLoginFullOperation(tracker, { explicitSpecType: "pre-identifier" });
3903
+ * setUser(tracker, { userId });
3904
+ * ```
3441
3905
  */
3442
- declare function getSessionId(): string | undefined;
3906
+ declare function initCore(options: TrackerCoreOptions): CorbadoTrackerCore;
3443
3907
  /**
3444
- * Record a user reference for the global tracker's current active flow.
3445
- * Call after the flow starts and before it finishes; matching has no grace period.
3446
- * See {@link CorbadoTracker.setUser}.
3908
+ * Return the default tracker from the most recent {@link init} call; `undefined` when there is none
3909
+ * or when the default was created by {@link initCore} (use {@link getTrackerCore} for that).
3447
3910
  */
3448
- declare function setUser(user: UserReference): void;
3911
+ declare function getTracker(): CorbadoTracker | undefined;
3912
+ /** Return the default tracker from the most recent {@link init} or {@link initCore} call. */
3913
+ declare function getTrackerCore(): CorbadoTrackerCore | undefined;
3449
3914
  /**
3450
- * Attach tags to the global tracker's innermost open flow.
3451
- * See {@link CorbadoTracker.setFlowTags}.
3915
+ * Session id of the global tracker, or `undefined` when no tracker was initialized or no session
3916
+ * could be established. See {@link CorbadoTrackerCore.getSessionId}.
3452
3917
  */
3453
- declare function setFlowTags(tags: Record<string, string>, options?: SetFlowTagsOptions): void;
3454
- declare function setExperiment(key: string, variant: string): void;
3918
+ declare function getSessionId(): string | undefined;
3455
3919
  declare function setExperiments(assignments: Record<string, string>): void;
3456
- declare function clearExperiment(key: string): void;
3457
- declare function clearExperiments(): void;
3458
3920
  declare function getExperiments(): Record<string, string>;
3459
3921
  declare function telemetry(level: TelemetryLevel, message: string): void;
3460
- declare function logInfo(message: string): void;
3461
- declare function logError(message: string): void;
3922
+ /** Destroy the default tracker (see {@link CorbadoTrackerCore.destroy}) and clear the default. */
3462
3923
  declare function destroy(): Promise<void>;
3463
3924
 
3464
- export { type AppConfirmationOperationCeremonyTypedError, type AppConfirmationOperationConfig, AppConfirmationOperationFull, type AppConfirmationOperationRetryReason, type AppConfirmationOperationSpecType, type AppConfirmationOperationStart, type AuthDecisionFinished, type AuthDecisionStarted, AuthEventName, type AuthMethodDecisionFinished, type AuthMethodDecisionStarted, type AuthMethodType, type BaseEvent, CEREMONY_LOW_EVENT_TAIL_MS, CONFIG_BOUNDS, CONFIG_CACHE_STORAGE_KEY, CONFIG_REQUEST_HEADER, CONFIG_STORAGE_KEY, type CaptchaOperationConfig, CaptchaOperationFull, type CaptchaOperationSpecType, type ClientCapabilities, type ClientEnvHandleMeta, type ClientEnvHandleMetaSource, type ConfigCacheRecord, type Conversion, CookieStorage, CorbadoTracker, type CreateLoggerOptions, type CrossOriginSessionConfig, type CustomEvent, DEFAULT_DEVICE_INFO_COLLECTOR_TIMEOUT_MS, DEFAULT_FLUSH_INTERVAL_MS, DEFAULT_MAX_ENTRIES, DEFAULT_MAX_SERIALIZED_LENGTH, DEFAULT_RELIABILITY_CONFIG, DEFAULT_SEQ_LOCK_TIMEOUT_MS, DEFAULT_SESSION_INACTIVITY_MS, type DeviceInfo, type DeviceInfoCollectionError, type DeviceInfoDataWeb, type DeviceType, type EmailLinkContinuationConfig, EmailLinkContinuationOperation, type EmailLinkOperationConfig, EmailLinkOperationFull, type EmailLinkOperationPostResponseStart, type EmailLinkOperationSendStart, type EmailLinkOperationSpecType, type EmailOTPOperationConfig, type EmailOTPOperationPostResponseStart, type EmailOTPOperationSendOTPStart, type EmailOTPOperationSpecType, EmailOtpOperationFull, type ErrorStepOptions, type Event, type EventBatch, type EventBatchMeta, type EventMeta, EventStore, type EventType, type FixedDataConfig, type FlowAutoFinished, type FlowDecided, type FlowFinished, type FlowHandle, type FlowReset, type FlowStarted, type FlowType, type FlushReason, type FormOperationConfig, FormOperationFull, type HandoffStepHelper, type JavaScriptHighEntropy, type KeyOperationConfig, KeyRegistrationOperationFull, KeySigningOperationFull, LocalStorage, type Logger, type LowEvent, type LowEventFieldRole, type LowEventInitiator, type LowEventInputEffect, type LowEventSourceKind, type MultiFlowReset, type MultiFlowStarted, NamespacedStorage, type NormalizedError, OUTBOX_LOCK_NAME, OUTBOX_STORAGE_KEY, type ObserveSdkConfigSnapshot, OperationFull, OperationFullProvideIdentifierWithCUI, type OperationFullProvideIdentifierWithCUIConfig, type OutboxEntry, PROBE_BATCH_MAX_BYTES, PROBE_BATCH_MAX_ITEMS, PROBE_PAYLOAD_MAX_BYTES, PROBE_QUEUE_MAX_BYTES, PROBE_QUEUE_MAX_ITEMS, type PasskeyDeletionDeletionTypedError, type PasskeyDeletionOperationConfig, PasskeyDeletionOperationFull, type PasskeyDeletionUserConfirmationTypedError, type PasskeyEnrollmentCeremonyFinished, type PasskeyEnrollmentCeremonyStart, type PasskeyEnrollmentGetOptionsFinished, type PasskeyEnrollmentGetOptionsStart, type PasskeyEnrollmentOperationConfig, PasskeyEnrollmentOperationFull, type PasskeyEnrollmentPostResponseStart, type PasskeyLoginCUIGetOptionsFinished, type PasskeyLoginCUIGetOptionsStart, type PasskeyLoginCUISpecType, type PasskeyLoginCeremonyFinished, type PasskeyLoginCeremonyStart, type PasskeyLoginClientError, type PasskeyLoginFinish, type PasskeyLoginGetOptionsFinished, type PasskeyLoginGetOptionsStart, type PasskeyLoginOperationConfig, PasskeyLoginOperationFull, type PasskeyLoginPostResponseStart, type PasskeyLoginStartable, type PasskeyLoginSubmitted, type PasskeyOperationEnrollmentExplicitSpecType, type PasskeyOperationLoginExplicitSpecType, type PasswordEnrollmentConfig, PasswordEnrollmentOperationFull, type PasswordEnrollmentTypedError, type PasswordLoginCUICeremonyStart, type PasswordLoginCUIGetOptionsFinished, type PasswordLoginCUIGetOptionsStart, type PasswordLoginCUISpecType, type PasswordLoginCUITypedError, type PasswordLoginConfig, type PasswordLoginExplicitSpecType, PasswordLoginOperationFull, type PasswordLoginTypedError, type PasswordManagerExtension, type PasswordManagerExtensionName, type PredefinedEvent, type ProbeContext, type ProbeEntry, type ProbeInput, type ProvideDataOperationConfig, ProvideDataOperationFull, type ProvideDataOperationPostResponseStart, type ProvideDataOperationSpecType, type ProvideDataOperationStart, type ProvideIdentifierError, type ProvideIdentifierFinish, type ProvideIdentifierPostResponseStart, type ProvideIdentifierSpecType, type ProvideIdentifierStart, type QueueOptions, RAW_ERROR_BOUNDS, READER_EXPOSURES, type RawErrorEnvelope, type ReaderDataConfigKey, type ReaderExposure, type ReaderField, type ReaderMeta, type ReaderOrigin, type ReaderTransform, RequestQueue, type ResolvedFixedDataConfig, SDK_NAME, SDK_VERSION, type SdkInfo, type SdkInputHandoff, type SdkReliabilityConfig, type SdkReliabilityConfigOverrides, type SdkRetryConfig, type SdkWebAuthnError, type SdkWebAuthnPayload, type SerializeRawErrorOptions, SessionStorage, type SetFlowTagsOptions, type SmsOTPOperationConfig, type SmsOTPOperationPostResponseStart, type SmsOTPOperationSpecType, SmsOtpOperationFull, type SocialLoginEntry, type SocialLoginExchangeCodeFinished, type SocialLoginExchangeCodeStart, type SocialLoginGetRedirectUrlFinished, type SocialLoginGetRedirectUrlStart, type SocialLoginOperationConfig, SocialLoginOperationFull, type SocialLoginProviderType, type SocialLoginSpecType, type SourcePathQueryMode, type SsoLoginExchangeCodeFinished, type SsoLoginExchangeCodeStart, type SsoLoginGetRedirectUrlFinished, type SsoLoginGetRedirectUrlStart, type SsoLoginOperationConfig, SsoLoginOperationFull, type SsoLoginSpecType, type StandaloneDeviceInfoSource, type StepHelper, type StepIdentifier, type StepOptions, type StorageEngine, type SubflowTrigger, type SubflowType, type TelemetryEntry, type TelemetryLevel, type TelemetrySink, type TotpOperationConfig, TotpOperationFull, type TotpOperationPostResponseStart, type TotpOperationSpecType, type TrackerOptions, type Transport, type TransportMakeRequestResponse, type TransportOptions, type TrustedDeviceBindingMetadata, type TrustedDeviceCheckConfig, TrustedDeviceCheckOperationFull, type TrustedDeviceCheckResult, type TrustedDeviceCheckStepResult, type TrustedDeviceCheckTypedError, TrustedDeviceEnrollmentOperationFull, type TrustedDeviceEnrollmentResult, type TrustedDeviceOperationConfig, type TrustedDevicePurpose, type TrustedDeviceStorage, UNLOAD_BUDGET_BYTES, UNLOAD_PROBE_MAX_BYTES, type UserReference, type WebAuthnIdentifierProjector, type WebAuthnIdentifierProjectors, type WithHandoffs, cacheConfigRecord, clearExperiment, clearExperiments, createLogger, destroy, detectPasswordManagerExtensions, getExperiments, getSessionId, getTracker, init, loadCachedConfig, loadConfigRecord, logError, logInfo, namespacedKey, parseReliabilityConfig, resetSession, resolveFixedDataConfig, resolveRawErrorLimits, resolveReliabilityConfig, sanitizeAssertionResponse, sanitizeCreationOptions, sanitizeCreationResponse, sanitizeRequestOptions, serializeRawError, setExperiment, setExperiments, setFlowTags, setUser, telemetry, utf8Length };
3925
+ export { type AppConfirmationOperationCeremonyTypedError, type AppConfirmationOperationConfig, AppConfirmationOperationFull, type AppConfirmationOperationRetryReason, type AppConfirmationOperationSpecType, type AppConfirmationOperationStart, type AuthDecisionFinished, type AuthDecisionStarted, AuthEventName, type AuthMethodDecisionFinished, type AuthMethodDecisionStarted, type AuthMethodType, type BaseEvent, CEREMONY_LOW_EVENT_TAIL_MS, CONFIG_BOUNDS, CONFIG_CACHE_STORAGE_KEY, CONFIG_REQUEST_HEADER, CONFIG_STORAGE_KEY, type CaptchaOperationConfig, CaptchaOperationFull, type CaptchaOperationSpecType, type ClientCapabilities, type ClientEnvHandleMeta, type ClientEnvHandleMetaSource, type ConfigCacheRecord, type Conversion, CookieStorage, type CookieStorageOptions, CorbadoTracker, CorbadoTrackerCore, type CreateLoggerOptions, type CrossOriginSessionConfig, type CustomEvent, DEFAULT_DEVICE_INFO_COLLECTOR_TIMEOUT_MS, DEFAULT_FLUSH_INTERVAL_MS, DEFAULT_MAX_ENTRIES, DEFAULT_MAX_SERIALIZED_LENGTH, DEFAULT_RELIABILITY_CONFIG, DEFAULT_SEQ_LOCK_TIMEOUT_MS, DEFAULT_SESSION_INACTIVITY_MS, type DeviceInfo, type DeviceInfoCollectionError, type DeviceInfoDataWeb, type DeviceType, type EmailLinkContinuationConfig, EmailLinkContinuationOperation, type EmailLinkOperationConfig, EmailLinkOperationFull, type EmailLinkOperationPostResponseStart, type EmailLinkOperationSendStart, type EmailLinkOperationSpecType, type EmailOTPOperationConfig, type EmailOTPOperationPostResponseStart, type EmailOTPOperationSendOTPStart, type EmailOTPOperationSpecType, EmailOtpOperationFull, type ErrorStepOptions, type Event, type EventBatch, type EventBatchMeta, type EventMeta, EventStore, type EventType, type FixedDataConfig, type FlowAutoFinished, type FlowDecided, type FlowFinished, type FlowHandle, type FlowReset, type FlowStarted, type FlowType, type FlushReason, type FormOperationConfig, FormOperationFull, type HandoffStepHelper, type JavaScriptHighEntropy, type KeyOperationConfig, KeyRegistrationOperationFull, KeySigningOperationFull, LocalStorage, type Logger, type LowEvent, type LowEventFieldRole, type LowEventInitiator, type LowEventInputEffect, type LowEventSourceKind, type MultiFlowReset, type MultiFlowStarted, NamespacedStorage, type NormalizedError, OUTBOX_LOCK_NAME, OUTBOX_STORAGE_KEY, type ObserveSdkConfigSnapshot, OperationFull, OperationFullProvideIdentifierWithCUI, type OperationFullProvideIdentifierWithCUIConfig, type OutboxEntry, PROBE_BATCH_MAX_BYTES, PROBE_BATCH_MAX_ITEMS, PROBE_PAYLOAD_MAX_BYTES, PROBE_QUEUE_MAX_BYTES, PROBE_QUEUE_MAX_ITEMS, type PasskeyDeletionDeletionTypedError, type PasskeyDeletionOperationConfig, PasskeyDeletionOperationFull, type PasskeyDeletionUserConfirmationTypedError, type PasskeyEnrollmentCeremonyFinished, type PasskeyEnrollmentCeremonyStart, type PasskeyEnrollmentGetOptionsFinished, type PasskeyEnrollmentGetOptionsStart, type PasskeyEnrollmentOperationConfig, PasskeyEnrollmentOperationFull, type PasskeyEnrollmentPostResponseStart, type PasskeyLoginCUIGetOptionsFinished, type PasskeyLoginCUIGetOptionsStart, type PasskeyLoginCUISpecType, type PasskeyLoginCeremonyFinished, type PasskeyLoginCeremonyStart, type PasskeyLoginClientError, type PasskeyLoginFinish, type PasskeyLoginGetOptionsFinished, type PasskeyLoginGetOptionsStart, type PasskeyLoginOperationConfig, PasskeyLoginOperationFull, type PasskeyLoginPostResponseStart, type PasskeyLoginStartable, type PasskeyLoginSubmitted, type PasskeyOperationEnrollmentExplicitSpecType, type PasskeyOperationLoginExplicitSpecType, type PasswordEnrollmentConfig, PasswordEnrollmentOperationFull, type PasswordEnrollmentTypedError, type PasswordLoginCUICeremonyStart, type PasswordLoginCUIGetOptionsFinished, type PasswordLoginCUIGetOptionsStart, type PasswordLoginCUISpecType, type PasswordLoginCUITypedError, type PasswordLoginConfig, type PasswordLoginExplicitSpecType, PasswordLoginOperationFull, type PasswordLoginTypedError, type PasswordManagerExtension, type PasswordManagerExtensionName, type PredefinedEvent, type ProbeContext, type ProbeEntry, type ProbeInput, ProbeLane, type ProbePending, type ProvideDataOperationConfig, ProvideDataOperationFull, type ProvideDataOperationPostResponseStart, type ProvideDataOperationSpecType, type ProvideDataOperationStart, type ProvideIdentifierError, type ProvideIdentifierFinish, type ProvideIdentifierPostResponseStart, type ProvideIdentifierSpecType, type ProvideIdentifierStart, type QueueOptions, RAW_ERROR_BOUNDS, READER_EXPOSURES, type RawErrorEnvelope, type RawErrorSerializer, type ReaderDataConfigKey, type ReaderExposure, type ReaderField, type ReaderMeta, type ReaderOrigin, type ReaderTransform, RequestQueue, type ResolvedFixedDataConfig, SDK_NAME, SDK_VERSION, type SdkInfo, type SdkInputHandoff, type SdkReliabilityConfig, type SdkReliabilityConfigOverrides, type SdkRetryConfig, type SdkWebAuthnError, type SdkWebAuthnPayload, type SerializeRawErrorOptions, type SessionBridge, SessionStorage, type SetFlowTagsOptions, type SmsOTPOperationConfig, type SmsOTPOperationPostResponseStart, type SmsOTPOperationSpecType, SmsOtpOperationFull, type SocialLoginEntry, type SocialLoginExchangeCodeFinished, type SocialLoginExchangeCodeStart, type SocialLoginGetRedirectUrlFinished, type SocialLoginGetRedirectUrlStart, type SocialLoginOperationConfig, SocialLoginOperationFull, type SocialLoginProviderType, type SocialLoginSpecType, type SourcePathQueryMode, type SsoLoginExchangeCodeFinished, type SsoLoginExchangeCodeStart, type SsoLoginGetRedirectUrlFinished, type SsoLoginGetRedirectUrlStart, type SsoLoginOperationConfig, SsoLoginOperationFull, type SsoLoginSpecType, type StandaloneDeviceInfoSource, type StepHelper, type StepIdentifier, type StepOptions, type StorageEngine, type SubflowTrigger, type SubflowType, type TelemetryEntry, type TelemetryLevel, type TelemetrySink, type TotpOperationConfig, TotpOperationFull, type TotpOperationPostResponseStart, type TotpOperationSpecType, type TrackerCoreOptions, type TrackerOptions, type TrackerPlugin, type TrackerStorageEngine, type Transport, type TransportMakeRequestResponse, type TransportOptions, type TrustedDeviceBindingMetadata, type TrustedDeviceCheckConfig, TrustedDeviceCheckOperationFull, type TrustedDeviceCheckResult, type TrustedDeviceCheckStepResult, type TrustedDeviceCheckTypedError, TrustedDeviceEnrollmentOperationFull, type TrustedDeviceEnrollmentResult, type TrustedDeviceOperationConfig, type TrustedDevicePurpose, type TrustedDeviceStorage, UNLOAD_BUDGET_BYTES, UNLOAD_PROBE_MAX_BYTES, type UserReference, type WebAuthnIdentifierProjector, type WebAuthnIdentifierProjectors, type WithHandoffs, appConfirmationOperationFull, authDecisionFinished, authDecisionStarted, cacheConfigRecord, captchaOperationFull, clearExperiment, clearExperiments, continueEmailLinkOperation, conversion, cookieStorage, createLogger, crossOriginSession, destroy, detectPasswordManagerExtensions, emailLinkOperationFull, emailOtpOperationFull, formOperationFull, getCrossOriginContext, getExperiments, getSessionId, getTracker, getTrackerCore, init, initCore, installProbeLane, keyRegistrationOperationFull, keySigningOperationFull, loadCachedConfig, loadConfigRecord, logError, logInfo, namespacedKey, parseReliabilityConfig, passkeyDeletionOperationFull, passkeyEnrollmentFullOperation, passkeyLoginFullOperation, passwordEnrollmentFullOperation, passwordLoginFullOperation, probe, probes, provideDataOperationFull, provideIdentifierOperationFull, rawErrors, resetSession, resolveFixedDataConfig, resolveRawErrorLimits, resolveReliabilityConfig, sanitizeAssertionResponse, sanitizeCreationOptions, sanitizeCreationResponse, sanitizeRequestOptions, serializeRawError, setCrossOriginContext, setExperiment, setExperiments, setFlowTags, setUser, smsOtpOperationFull, socialLoginOperationFull, ssoLoginOperationFull, telemetry, totpOperationFull, trackSubflowError, trustedDeviceCheckOperationFull, trustedDeviceEnrollmentOperationFull, utf8Length };