@corbado/observe 0.13.0 → 0.14.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.
- package/dist/cdn/script.global.js +1 -1
- package/dist/index.d.mts +125 -53
- package/dist/index.d.ts +125 -53
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -24,6 +24,8 @@ declare enum AuthEventName {
|
|
|
24
24
|
SubflowError = "subflow_error",
|
|
25
25
|
SubflowStarted = "subflow_started",
|
|
26
26
|
SubflowFinished = "subflow_finished",
|
|
27
|
+
/** Client-side flow enrichment (the server accepts `session_enriched` as a legacy alias). */
|
|
28
|
+
FlowEnriched = "flow_enriched",
|
|
27
29
|
Conversion = "conversion"
|
|
28
30
|
}
|
|
29
31
|
interface BaseEvent {
|
|
@@ -51,6 +53,15 @@ interface BaseEvent {
|
|
|
51
53
|
type UserReference = {
|
|
52
54
|
userId?: string;
|
|
53
55
|
identifier?: string;
|
|
56
|
+
/** Shared UUID used to link sessions across environments. */
|
|
57
|
+
crossEnvironmentTransactionID?: string;
|
|
58
|
+
};
|
|
59
|
+
type LegacyUserReference = {
|
|
60
|
+
/** @deprecated Use tracker.setUser() within the active flow instead. */
|
|
61
|
+
userId?: string;
|
|
62
|
+
/** @deprecated Use tracker.setUser() within the active flow instead. */
|
|
63
|
+
identifier?: string;
|
|
64
|
+
/** @deprecated Use tracker.setUser() within the active flow instead. */
|
|
54
65
|
crossEnvironmentTransactionID?: string;
|
|
55
66
|
};
|
|
56
67
|
/**
|
|
@@ -83,11 +94,11 @@ type Conversion = {
|
|
|
83
94
|
name: string;
|
|
84
95
|
/** Where the conversion happened, e.g. `"checkout"` or `"product-page"`. */
|
|
85
96
|
touchpoint?: string;
|
|
86
|
-
} &
|
|
97
|
+
} & LegacyUserReference;
|
|
87
98
|
type FlowFinished = {
|
|
88
99
|
flowName: FlowType;
|
|
89
100
|
explicitOutcome?: "skipped" | "visible-auto-skip" | "invisible";
|
|
90
|
-
} &
|
|
101
|
+
} & LegacyUserReference;
|
|
91
102
|
type FlowReset = {
|
|
92
103
|
flowName?: FlowType;
|
|
93
104
|
};
|
|
@@ -97,7 +108,7 @@ type MultiFlowReset = {
|
|
|
97
108
|
type FlowAutoFinished = {
|
|
98
109
|
flowName: FlowType;
|
|
99
110
|
finishedByFlowName: FlowType;
|
|
100
|
-
} &
|
|
111
|
+
} & LegacyUserReference;
|
|
101
112
|
type AuthMethodDecisionStarted = {
|
|
102
113
|
decisionName: string;
|
|
103
114
|
options: (AuthMethodType | (string & {}))[];
|
|
@@ -105,15 +116,16 @@ type AuthMethodDecisionStarted = {
|
|
|
105
116
|
};
|
|
106
117
|
type AuthMethodDecisionFinished = {
|
|
107
118
|
decisionName: string;
|
|
108
|
-
|
|
119
|
+
/** Optional — when omitted, the backend completes the open decision of the same name using its declared options (classifier follow-up). */
|
|
120
|
+
options?: (AuthMethodType | (string & {}))[];
|
|
109
121
|
explicitDecisionValue?: string;
|
|
110
122
|
};
|
|
111
123
|
type ProvideIdentifierStart = {};
|
|
112
|
-
type ProvideIdentifierError =
|
|
124
|
+
type ProvideIdentifierError = LegacyUserReference & {
|
|
113
125
|
errorCode?: string;
|
|
114
126
|
error?: any;
|
|
115
127
|
};
|
|
116
|
-
type ProvideIdentifierFinish =
|
|
128
|
+
type ProvideIdentifierFinish = LegacyUserReference & {
|
|
117
129
|
identifierPrefillingCreated?: boolean;
|
|
118
130
|
};
|
|
119
131
|
type PasskeyLoginClientError = {
|
|
@@ -125,7 +137,7 @@ type PasskeyLoginStartable = {
|
|
|
125
137
|
type PasskeyLoginSubmitted = {
|
|
126
138
|
assertionResponse: string;
|
|
127
139
|
};
|
|
128
|
-
type PasskeyLoginFinish =
|
|
140
|
+
type PasskeyLoginFinish = LegacyUserReference & {};
|
|
129
141
|
type AuthDecisionStarted = {
|
|
130
142
|
decisionName: string;
|
|
131
143
|
options: string[];
|
|
@@ -136,6 +148,7 @@ type AuthDecisionFinished = {
|
|
|
136
148
|
explicitDecisionValue?: string;
|
|
137
149
|
};
|
|
138
150
|
type StepOptions = {
|
|
151
|
+
/** @deprecated Use tracker.setUser() within the active flow instead. */
|
|
139
152
|
userReference?: UserReference;
|
|
140
153
|
explicitTimestamp?: number;
|
|
141
154
|
/** Per-call experiment override (experiment key → variant), merged over the persistent assignments. */
|
|
@@ -496,11 +509,14 @@ declare abstract class OperationFull {
|
|
|
496
509
|
private operationName;
|
|
497
510
|
constructor(tracker: CorbadoTracker, operationName: SubflowType);
|
|
498
511
|
/**
|
|
499
|
-
* Emits subflow_started
|
|
500
|
-
* `explicitSpecType`, `ignoreAsInteraction`)
|
|
501
|
-
*
|
|
512
|
+
* Emits an additional subflow_started; construction already emits the initial start.
|
|
513
|
+
* `data` supports SubflowTrigger fields (`actor`, `explicitSpecType`, `ignoreAsInteraction`)
|
|
514
|
+
* plus free-form extras; see SubflowTrigger for programmatic interaction suppression.
|
|
502
515
|
*/
|
|
503
516
|
subflowStart(data: any, options?: StepOptions): void;
|
|
517
|
+
/**
|
|
518
|
+
* @deprecated `subflow_trigger` will be removed in the next major version.
|
|
519
|
+
*/
|
|
504
520
|
trigger(data: SubflowTrigger, options?: StepOptions): void;
|
|
505
521
|
customStep<TStart = {}, TFinished = {}>(stepName: string): StepHelper<TStart, TFinished>;
|
|
506
522
|
protected subflowStepStarted(stepName: string, data: any, options?: StepOptions, ignoreAsInteraction?: boolean): void;
|
|
@@ -554,12 +570,16 @@ type PasskeyLoginPostResponseStart = {
|
|
|
554
570
|
*/
|
|
555
571
|
assertionResponse?: string;
|
|
556
572
|
};
|
|
573
|
+
type PasskeyLoginOperationConfig = {
|
|
574
|
+
/** The classifier drops the attempt if no spec type arrives on any of its events — supply it here or on a step's start data as soon as known. */
|
|
575
|
+
explicitSpecType?: PasskeyOperationLoginExplicitSpecType;
|
|
576
|
+
};
|
|
557
577
|
declare class PasskeyLoginOperationFull extends OperationFull {
|
|
558
578
|
readonly getOptions: StepHelper<PasskeyLoginGetOptionsStart, PasskeyLoginGetOptionsFinished>;
|
|
559
579
|
readonly ceremony: StepHelper<PasskeyLoginCeremonyStart, PasskeyLoginCeremonyFinished>;
|
|
560
580
|
readonly postResponse: StepHelper<PasskeyLoginPostResponseStart>;
|
|
561
581
|
private lowEventTracker;
|
|
562
|
-
constructor(tracker: CorbadoTracker);
|
|
582
|
+
constructor(tracker: CorbadoTracker, config?: PasskeyLoginOperationConfig);
|
|
563
583
|
/**
|
|
564
584
|
* @deprecated `subflow_trigger` is not supported for passkey-login and will be removed in the
|
|
565
585
|
* next major version.
|
|
@@ -605,11 +625,15 @@ type EmailLinkOperationSendStart = {
|
|
|
605
625
|
type EmailLinkOperationPostResponseStart = {
|
|
606
626
|
explicitSpecType?: EmailLinkOperationSpecType;
|
|
607
627
|
};
|
|
628
|
+
type EmailLinkOperationConfig = {
|
|
629
|
+
/** The classifier drops the attempt if no spec type arrives on any of its events — supply it here or on a step's start data as soon as known. */
|
|
630
|
+
explicitSpecType?: EmailLinkOperationSpecType;
|
|
631
|
+
};
|
|
608
632
|
declare class EmailLinkOperationFull extends OperationFull {
|
|
609
633
|
readonly send: StepHelper<EmailLinkOperationSendStart>;
|
|
610
634
|
readonly postResponse: StepHelper<EmailLinkOperationPostResponseStart>;
|
|
611
635
|
readonly resend: StepHelper;
|
|
612
|
-
constructor(tracker: CorbadoTracker);
|
|
636
|
+
constructor(tracker: CorbadoTracker, config?: EmailLinkOperationConfig);
|
|
613
637
|
}
|
|
614
638
|
|
|
615
639
|
/**
|
|
@@ -651,6 +675,7 @@ type PasskeyEnrollmentPostResponseStart = {
|
|
|
651
675
|
attestationResponse?: string;
|
|
652
676
|
};
|
|
653
677
|
type PasskeyEnrollmentOperationConfig = {
|
|
678
|
+
/** The classifier drops the attempt if no spec type arrives on any of its events — supply it here or on a step's start data as soon as known. */
|
|
654
679
|
explicitSpecType?: PasskeyOperationEnrollmentExplicitSpecType;
|
|
655
680
|
/**
|
|
656
681
|
* Marks the auto-emitted `subflow_started` as not user-driven (see SubflowTrigger.ignoreAsInteraction).
|
|
@@ -694,14 +719,11 @@ type PasswordLoginCUIGetOptionsFinished = {
|
|
|
694
719
|
type PasswordLoginCUICeremonyStart = {
|
|
695
720
|
explicitSpecType?: PasswordLoginCUISpecType;
|
|
696
721
|
};
|
|
697
|
-
type
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
explicitSpecType: "password-with-identifier";
|
|
703
|
-
/** The password input field. */
|
|
704
|
-
inputHtmlField: HTMLInputElement;
|
|
722
|
+
type PasswordLoginExplicitSpecType = "password-known-identifier" | "password-with-identifier";
|
|
723
|
+
type PasswordLoginConfig = {
|
|
724
|
+
explicitSpecType?: PasswordLoginExplicitSpecType;
|
|
725
|
+
/** The password input field. When set, low-event input tracking is attached to it. */
|
|
726
|
+
inputHtmlField?: HTMLInputElement;
|
|
705
727
|
/**
|
|
706
728
|
* The identifier (e.g. email) input field. Accepted but not tracked yet — low-event
|
|
707
729
|
* tracking for a second field lands together with per-field attribution.
|
|
@@ -722,7 +744,7 @@ declare class PasswordLoginOperationFull extends OperationFull {
|
|
|
722
744
|
postResponse: StepHelper;
|
|
723
745
|
};
|
|
724
746
|
private lowEventTracker?;
|
|
725
|
-
constructor(tracker: CorbadoTracker,
|
|
747
|
+
constructor(tracker: CorbadoTracker, config?: PasswordLoginConfig);
|
|
726
748
|
/**
|
|
727
749
|
* @deprecated `subflow_trigger` is not supported for password-login and will be removed in the
|
|
728
750
|
* next major version.
|
|
@@ -736,15 +758,17 @@ type PasswordEnrollmentTypedError = {
|
|
|
736
758
|
};
|
|
737
759
|
type PasswordEnrollmentTypedErrorCode = "requirements_not_fulfilled";
|
|
738
760
|
type PasswordEnrollmentExplicitSpecType = "password-set" | "password-reset";
|
|
739
|
-
type
|
|
761
|
+
type PasswordEnrollmentConfig = {
|
|
762
|
+
/** The classifier drops the attempt if no spec type arrives on any of its events — supply it here or on a step's start data as soon as known. */
|
|
740
763
|
explicitSpecType?: PasswordEnrollmentExplicitSpecType;
|
|
764
|
+
/** The password input field. When set, low-event input tracking is attached to it. */
|
|
741
765
|
inputHtmlField?: HTMLInputElement;
|
|
742
766
|
};
|
|
743
767
|
declare class PasswordEnrollmentOperationFull extends OperationFull {
|
|
744
768
|
readonly clientValidation: StepHelper;
|
|
745
769
|
readonly postResponse: StepHelper<{}, {}, PasswordEnrollmentTypedError>;
|
|
746
770
|
private lowEventTracker?;
|
|
747
|
-
constructor(tracker: CorbadoTracker,
|
|
771
|
+
constructor(tracker: CorbadoTracker, config?: PasswordEnrollmentConfig);
|
|
748
772
|
destroy(): void;
|
|
749
773
|
}
|
|
750
774
|
|
|
@@ -768,16 +792,15 @@ type PasskeyLoginCUIGetOptionsFinished = {
|
|
|
768
792
|
assertionOptions: string;
|
|
769
793
|
};
|
|
770
794
|
type OperationFullProvideIdentifierWithCUIConfig = {
|
|
795
|
+
/** When set, low event collection is enabled for the input field. */
|
|
771
796
|
inputHtmlField?: HTMLInputElement;
|
|
772
797
|
explicitSpecType?: ProvideIdentifierSpecType;
|
|
773
798
|
};
|
|
774
|
-
declare class OperationFullProvideIdentifierWithCUI {
|
|
775
|
-
private tracker;
|
|
799
|
+
declare class OperationFullProvideIdentifierWithCUI extends OperationFull {
|
|
776
800
|
private lowEventTracker?;
|
|
777
801
|
readonly cui: {
|
|
778
802
|
/**
|
|
779
|
-
* @deprecated `subflow_trigger`
|
|
780
|
-
* will be removed in the next major version.
|
|
803
|
+
* @deprecated `subflow_trigger` will be removed in the next major version.
|
|
781
804
|
*/
|
|
782
805
|
trigger: (data: SubflowTrigger, options?: StepOptions) => void;
|
|
783
806
|
getOptions: StepHelper<PasskeyLoginCUIGetOptionsStart, PasskeyLoginCUIGetOptionsFinished>;
|
|
@@ -786,32 +809,34 @@ declare class OperationFullProvideIdentifierWithCUI {
|
|
|
786
809
|
};
|
|
787
810
|
readonly provideIdentifier: {
|
|
788
811
|
/**
|
|
789
|
-
* @deprecated `subflow_trigger`
|
|
790
|
-
* in the next major version.
|
|
812
|
+
* @deprecated `subflow_trigger` will be removed in the next major version.
|
|
791
813
|
*/
|
|
792
814
|
trigger: (data: SubflowTrigger, options?: StepOptions) => void;
|
|
793
815
|
clientValidation: StepHelper;
|
|
794
816
|
postResponse: StepHelper<ProvideIdentifierPostResponseStart>;
|
|
795
817
|
};
|
|
796
818
|
constructor(tracker: CorbadoTracker, config?: OperationFullProvideIdentifierWithCUIConfig);
|
|
797
|
-
private createStep;
|
|
798
819
|
destroy(): void;
|
|
799
820
|
}
|
|
800
821
|
|
|
801
822
|
type SocialLoginSpecType = "pre-identifier" | "post-identifier";
|
|
802
823
|
type SocialLoginGetRedirectUrlStart = {
|
|
803
824
|
provider?: SocialLoginProviderType;
|
|
804
|
-
explicitSpecType
|
|
825
|
+
explicitSpecType?: SocialLoginSpecType;
|
|
805
826
|
};
|
|
806
827
|
type SocialLoginGetRedirectUrlFinished = {};
|
|
807
828
|
type SocialLoginExchangeCodeStart = {
|
|
808
829
|
provider?: SocialLoginProviderType;
|
|
809
830
|
};
|
|
810
831
|
type SocialLoginExchangeCodeFinished = {};
|
|
832
|
+
type SocialLoginOperationConfig = {
|
|
833
|
+
/** The classifier drops the attempt if no spec type arrives on any of its events — supply it here or on a step's start data as soon as known. */
|
|
834
|
+
explicitSpecType?: SocialLoginSpecType;
|
|
835
|
+
};
|
|
811
836
|
declare class SocialLoginOperationFull extends OperationFull {
|
|
812
837
|
readonly getRedirectUrl: StepHelper<SocialLoginGetRedirectUrlStart, SocialLoginGetRedirectUrlFinished>;
|
|
813
838
|
readonly exchangeCode: StepHelper<SocialLoginExchangeCodeStart, SocialLoginExchangeCodeFinished>;
|
|
814
|
-
constructor(tracker: CorbadoTracker);
|
|
839
|
+
constructor(tracker: CorbadoTracker, config?: SocialLoginOperationConfig);
|
|
815
840
|
}
|
|
816
841
|
|
|
817
842
|
type AppConfirmationOperationSpecType = "qr-code";
|
|
@@ -823,11 +848,14 @@ type AppConfirmationOperationCeremonyTypedError = {
|
|
|
823
848
|
};
|
|
824
849
|
type AppConfirmationOperationCeremonyTypedErrorCode = "declined" | "expired";
|
|
825
850
|
type AppConfirmationOperationRetryReason = AppConfirmationOperationCeremonyTypedErrorCode | "technical-error" | "manual";
|
|
851
|
+
type AppConfirmationOperationConfig = {
|
|
852
|
+
explicitSpecType?: AppConfirmationOperationSpecType;
|
|
853
|
+
};
|
|
826
854
|
declare class AppConfirmationOperationFull extends OperationFull {
|
|
827
855
|
readonly ceremony: StepHelper<{}, {}, AppConfirmationOperationCeremonyTypedError>;
|
|
828
856
|
readonly retry: StepHelper;
|
|
829
857
|
readonly postResponse: StepHelper;
|
|
830
|
-
constructor(tracker: CorbadoTracker,
|
|
858
|
+
constructor(tracker: CorbadoTracker, config?: AppConfirmationOperationConfig);
|
|
831
859
|
}
|
|
832
860
|
|
|
833
861
|
/**
|
|
@@ -851,6 +879,7 @@ type ProvideDataOperationSpecType = "signup" | "login" | "recovery" | "enrollmen
|
|
|
851
879
|
type ProvideDataOperationStart = {
|
|
852
880
|
/** Stable name of the data field collected by this subflow, when known. */
|
|
853
881
|
fieldName?: string;
|
|
882
|
+
/** The classifier drops the attempt if no spec type arrives on any of its events — supply it here or on a step's start data as soon as known. */
|
|
854
883
|
explicitSpecType?: ProvideDataOperationSpecType;
|
|
855
884
|
};
|
|
856
885
|
type ProvideDataOperationConfig = ProvideDataOperationStart & {
|
|
@@ -1064,7 +1093,11 @@ declare class CorbadoTracker {
|
|
|
1064
1093
|
trackSubflowStepStarted(subflowType: SubflowType, stepName: string, data: Record<string, any>, options?: StepOptions, ignoreAsInteraction?: boolean): void;
|
|
1065
1094
|
trackSubflowStepFinished(subflowType: SubflowType, stepName: string, data: Record<string, any>, options?: StepOptions): void;
|
|
1066
1095
|
trackSubflowStepError(subflowType: SubflowType, stepName: string, data: Record<string, any>, options?: StepOptions): void;
|
|
1067
|
-
|
|
1096
|
+
/**
|
|
1097
|
+
* @remarks
|
|
1098
|
+
* Records an additional error occurrence against the subflow. Carries no outcome semantics —
|
|
1099
|
+
* step errors are the intended channel; not part of a normal integration.
|
|
1100
|
+
*/
|
|
1068
1101
|
trackSubflowError(subflowType: SubflowType, data: Record<string, any>, options?: StepOptions): void;
|
|
1069
1102
|
/**
|
|
1070
1103
|
* Error situations:
|
|
@@ -1121,10 +1154,12 @@ declare class CorbadoTracker {
|
|
|
1121
1154
|
* Use this for outcomes you care about beyond auth, such as a completed purchase,
|
|
1122
1155
|
* a started subscription, or a newsletter signup. Provide a stable `name` for the
|
|
1123
1156
|
* conversion and (optionally) the `touchpoint` where it happened so it can be
|
|
1124
|
-
* segmented in the same way as flows.
|
|
1125
|
-
*
|
|
1157
|
+
* segmented in the same way as flows. Record identity separately with `setUser()`
|
|
1158
|
+
* while the relevant flow is still active.
|
|
1126
1159
|
*
|
|
1127
|
-
*
|
|
1160
|
+
* Legacy identity fields in `data` remain supported but are deprecated.
|
|
1161
|
+
*
|
|
1162
|
+
* @param data - Conversion name, optional touchpoint, and deprecated user reference fields.
|
|
1128
1163
|
* @param tags - Optional key-value tags for filtering and segmentation.
|
|
1129
1164
|
*
|
|
1130
1165
|
* @example
|
|
@@ -1132,7 +1167,6 @@ declare class CorbadoTracker {
|
|
|
1132
1167
|
* tracker.conversion({
|
|
1133
1168
|
* name: "purchase",
|
|
1134
1169
|
* touchpoint: "checkout",
|
|
1135
|
-
* userId: "usr_123",
|
|
1136
1170
|
* });
|
|
1137
1171
|
* ```
|
|
1138
1172
|
*/
|
|
@@ -1142,18 +1176,18 @@ declare class CorbadoTracker {
|
|
|
1142
1176
|
*
|
|
1143
1177
|
* @remarks
|
|
1144
1178
|
* Fire this when the user has finished the target flow end-to-end, such as completed login,
|
|
1145
|
-
* signup, or recovery.
|
|
1146
|
-
*
|
|
1179
|
+
* signup, or recovery. Record identity separately with `setUser()` while the flow
|
|
1180
|
+
* is still active, before calling `flowFinished()`.
|
|
1181
|
+
*
|
|
1182
|
+
* Legacy identity fields in `data` remain supported but are deprecated.
|
|
1147
1183
|
*
|
|
1148
|
-
* @param data - Finished flow name
|
|
1184
|
+
* @param data - Finished flow name, optional explicit outcome, and deprecated user reference fields.
|
|
1149
1185
|
* @param tags - Optional key-value tags for filtering and segmentation.
|
|
1150
1186
|
*
|
|
1151
1187
|
* @example
|
|
1152
1188
|
* ```typescript
|
|
1153
1189
|
* tracker.flowFinished({
|
|
1154
1190
|
* flowName: "login",
|
|
1155
|
-
* userId: "usr_123",
|
|
1156
|
-
* identifier: "max@example.com",
|
|
1157
1191
|
* });
|
|
1158
1192
|
* ```
|
|
1159
1193
|
*/
|
|
@@ -1180,9 +1214,12 @@ declare class CorbadoTracker {
|
|
|
1180
1214
|
* @remarks
|
|
1181
1215
|
* Use this for automatic completions where no separate explicit finish action happens in the
|
|
1182
1216
|
* current flow. Set `flowName` to the auto-finished flow and `finishedByFlowName` to the flow
|
|
1183
|
-
* that caused it.
|
|
1217
|
+
* that caused it. Record identity with `setUser()` while the intended flow is still
|
|
1218
|
+
* current, before it is auto-finished.
|
|
1219
|
+
*
|
|
1220
|
+
* Legacy identity fields in `data` remain supported but are deprecated.
|
|
1184
1221
|
*
|
|
1185
|
-
* @param data - Auto-finished flow, finishing flow, and
|
|
1222
|
+
* @param data - Auto-finished flow, finishing flow, and deprecated user reference fields.
|
|
1186
1223
|
* @param tags - Optional key-value tags for filtering and segmentation.
|
|
1187
1224
|
*
|
|
1188
1225
|
* @example
|
|
@@ -1190,11 +1227,32 @@ declare class CorbadoTracker {
|
|
|
1190
1227
|
* tracker.flowAutoFinished({
|
|
1191
1228
|
* flowName: "signup",
|
|
1192
1229
|
* finishedByFlowName: "login",
|
|
1193
|
-
* userId: "usr_123",
|
|
1194
1230
|
* });
|
|
1195
1231
|
* ```
|
|
1196
1232
|
*/
|
|
1197
1233
|
flowAutoFinished(data: FlowAutoFinished, tags?: Record<string, string>, experiments?: Record<string, string>): void;
|
|
1234
|
+
/**
|
|
1235
|
+
* Record a newly known user reference for the current active flow.
|
|
1236
|
+
*
|
|
1237
|
+
* @remarks
|
|
1238
|
+
* Emits one `flow_enriched` with `match: { flowType: "*", at: "during" }` and `expFol: true` in its data.
|
|
1239
|
+
* Call only after the flow starts and before it finishes. The enrichment belongs
|
|
1240
|
+
* to the current flow at emission time.
|
|
1241
|
+
* Calling after `flowFinished()` cannot enrich that finished flow. If a parent or another
|
|
1242
|
+
* flow is current then, the enrichment belongs to that flow instead.
|
|
1243
|
+
* An empty reference does not clear identity. Cross-environment transaction IDs must be UUIDs;
|
|
1244
|
+
* both environments must report the shared ID while their respective flows are active.
|
|
1245
|
+
*
|
|
1246
|
+
* @param user - User ID, identifier, and/or cross-environment transaction UUID.
|
|
1247
|
+
*
|
|
1248
|
+
* @example
|
|
1249
|
+
* ```typescript
|
|
1250
|
+
* tracker.flowStarted({ flowName: "login" });
|
|
1251
|
+
* tracker.setUser({ userId: "usr_123", identifier: "max@example.com" });
|
|
1252
|
+
* tracker.flowFinished({ flowName: "login" });
|
|
1253
|
+
* ```
|
|
1254
|
+
*/
|
|
1255
|
+
setUser(user: UserReference): void;
|
|
1198
1256
|
/**
|
|
1199
1257
|
* Track when you present authentication method choices to the user.
|
|
1200
1258
|
*
|
|
@@ -1219,7 +1277,15 @@ declare class CorbadoTracker {
|
|
|
1219
1277
|
*/
|
|
1220
1278
|
authMethodsDecisionStarted(data: AuthMethodDecisionStarted, tags?: Record<string, string>, experiments?: Record<string, string>, options?: Pick<StepOptions, "explicitTimestamp">): void;
|
|
1221
1279
|
authMethodsDecisionFinished(data: AuthMethodDecisionFinished, tags?: Record<string, string>, experiments?: Record<string, string>): void;
|
|
1280
|
+
/**
|
|
1281
|
+
* @deprecated Use {@link CorbadoTracker.authMethodsDecisionStarted} instead (its `options`
|
|
1282
|
+
* already accept free-form strings).
|
|
1283
|
+
*/
|
|
1222
1284
|
authDecisionStarted(data: AuthDecisionStarted, tags?: Record<string, string>, experiments?: Record<string, string>): void;
|
|
1285
|
+
/**
|
|
1286
|
+
* @deprecated Use {@link CorbadoTracker.authMethodsDecisionFinished} instead (its `options`
|
|
1287
|
+
* already accept free-form strings).
|
|
1288
|
+
*/
|
|
1223
1289
|
authDecisionFinished(data: AuthDecisionFinished, tags?: Record<string, string>, experiments?: Record<string, string>): void;
|
|
1224
1290
|
/**
|
|
1225
1291
|
* Enqueue a "low" event (granular DOM/window/visualviewport/PWM signal) for the current session.
|
|
@@ -1278,17 +1344,17 @@ declare class CorbadoTracker {
|
|
|
1278
1344
|
* @internal
|
|
1279
1345
|
*/
|
|
1280
1346
|
lowEventFlushKeepalive(): void;
|
|
1281
|
-
passkeyLoginFullOperation(): PasskeyLoginOperationFull;
|
|
1347
|
+
passkeyLoginFullOperation(config?: PasskeyLoginOperationConfig): PasskeyLoginOperationFull;
|
|
1282
1348
|
passkeyEnrollmentFullOperation(config?: PasskeyEnrollmentOperationConfig): PasskeyEnrollmentOperationFull;
|
|
1283
|
-
passwordLoginFullOperation(autoTrackConfig?:
|
|
1284
|
-
passwordEnrollmentFullOperation(autoTrackConfig?:
|
|
1285
|
-
emailLinkOperationFull(): EmailLinkOperationFull;
|
|
1349
|
+
passwordLoginFullOperation(autoTrackConfig?: PasswordLoginConfig): PasswordLoginOperationFull;
|
|
1350
|
+
passwordEnrollmentFullOperation(autoTrackConfig?: PasswordEnrollmentConfig): PasswordEnrollmentOperationFull;
|
|
1351
|
+
emailLinkOperationFull(config?: EmailLinkOperationConfig): EmailLinkOperationFull;
|
|
1286
1352
|
emailOtpOperationFull(config?: EmailOTPOperationConfig): EmailOtpOperationFull;
|
|
1287
1353
|
smsOtpOperationFull(config?: SmsOTPOperationConfig): SmsOtpOperationFull;
|
|
1288
1354
|
provideIdentifierOperationFull(config?: OperationFullProvideIdentifierWithCUIConfig): OperationFullProvideIdentifierWithCUI;
|
|
1289
1355
|
provideDataOperationFull(config?: ProvideDataOperationConfig): ProvideDataOperationFull;
|
|
1290
|
-
socialLoginOperationFull(): SocialLoginOperationFull;
|
|
1291
|
-
appConfirmationOperationFull(
|
|
1356
|
+
socialLoginOperationFull(config?: SocialLoginOperationConfig): SocialLoginOperationFull;
|
|
1357
|
+
appConfirmationOperationFull(config?: AppConfirmationOperationConfig): AppConfirmationOperationFull;
|
|
1292
1358
|
captchaOperationFull(config?: CaptchaOperationConfig): CaptchaOperationFull;
|
|
1293
1359
|
/**
|
|
1294
1360
|
* Flush any pending events and release all resources (timers, event listeners).
|
|
@@ -1842,6 +1908,12 @@ declare function resetSession(): string | undefined;
|
|
|
1842
1908
|
* could be established. See {@link CorbadoTracker.getSessionId}.
|
|
1843
1909
|
*/
|
|
1844
1910
|
declare function getSessionId(): string | undefined;
|
|
1911
|
+
/**
|
|
1912
|
+
* Record a user reference for the global tracker's current active flow.
|
|
1913
|
+
* Call after the flow starts and before it finishes; matching has no grace period.
|
|
1914
|
+
* See {@link CorbadoTracker.setUser}.
|
|
1915
|
+
*/
|
|
1916
|
+
declare function setUser(user: UserReference): void;
|
|
1845
1917
|
declare function setExperiment(key: string, variant: string): void;
|
|
1846
1918
|
declare function setExperiments(assignments: Record<string, string>): void;
|
|
1847
1919
|
declare function clearExperiment(key: string): void;
|
|
@@ -1852,4 +1924,4 @@ declare function logInfo(message: string): void;
|
|
|
1852
1924
|
declare function logError(message: string): void;
|
|
1853
1925
|
declare function destroy(): Promise<void>;
|
|
1854
1926
|
|
|
1855
|
-
export { type AppConfirmationOperationCeremonyTypedError, 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_REQUEST_HEADER, CONFIG_STORAGE_KEY, type CaptchaOperationConfig, CaptchaOperationFull, type CaptchaOperationSpecType, type ClientCapabilities, type ClientEnvHandleMeta, type ClientEnvHandleMetaSource, type Conversion, CookieStorage, CorbadoTracker, type CreateLoggerOptions, 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, EmailLinkOperationFull, type EmailLinkOperationPostResponseStart, type EmailLinkOperationSendStart, type EmailLinkOperationSpecType, type EmailOTPOperationConfig, type EmailOTPOperationPostResponseStart, type EmailOTPOperationSendOTPStart, type EmailOTPOperationSpecType, EmailOtpOperationFull, type Event, type EventBatch, type EventBatchMeta, type EventMeta, EventStore, type EventType, type FlowAutoFinished, type FlowDecided, type FlowFinished, type FlowReset, type FlowStarted, type FlowType, type FlushReason, type JavaScriptHighEntropy, LocalStorage, type Logger, type LowEvent, type MultiFlowReset, type MultiFlowStarted, NamespacedStorage, type NormalizedError, OUTBOX_LOCK_NAME, OUTBOX_STORAGE_KEY, type ObserveSdkConfigSnapshot, OperationFull, OperationFullProvideIdentifierWithCUI, type OperationFullProvideIdentifierWithCUIConfig, type OutboxEntry, 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, PasskeyLoginOperationFull, type PasskeyLoginPostResponseStart, type PasskeyLoginStartable, type PasskeyLoginSubmitted, type PasskeyOperationEnrollmentExplicitSpecType, type PasskeyOperationLoginExplicitSpecType, type
|
|
1927
|
+
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_REQUEST_HEADER, CONFIG_STORAGE_KEY, type CaptchaOperationConfig, CaptchaOperationFull, type CaptchaOperationSpecType, type ClientCapabilities, type ClientEnvHandleMeta, type ClientEnvHandleMetaSource, type Conversion, CookieStorage, CorbadoTracker, type CreateLoggerOptions, 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 EmailLinkOperationConfig, EmailLinkOperationFull, type EmailLinkOperationPostResponseStart, type EmailLinkOperationSendStart, type EmailLinkOperationSpecType, type EmailOTPOperationConfig, type EmailOTPOperationPostResponseStart, type EmailOTPOperationSendOTPStart, type EmailOTPOperationSpecType, EmailOtpOperationFull, type Event, type EventBatch, type EventBatchMeta, type EventMeta, EventStore, type EventType, type FlowAutoFinished, type FlowDecided, type FlowFinished, type FlowReset, type FlowStarted, type FlowType, type FlushReason, type JavaScriptHighEntropy, LocalStorage, type Logger, type LowEvent, type MultiFlowReset, type MultiFlowStarted, NamespacedStorage, type NormalizedError, OUTBOX_LOCK_NAME, OUTBOX_STORAGE_KEY, type ObserveSdkConfigSnapshot, OperationFull, OperationFullProvideIdentifierWithCUI, type OperationFullProvideIdentifierWithCUIConfig, type OutboxEntry, 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 PredefinedEvent, type ProvideDataOperationConfig, ProvideDataOperationFull, type ProvideDataOperationPostResponseStart, type ProvideDataOperationSpecType, type ProvideDataOperationStart, type ProvideIdentifierError, type ProvideIdentifierFinish, type ProvideIdentifierPostResponseStart, type ProvideIdentifierSpecType, type ProvideIdentifierStart, type QueueOptions, RequestQueue, SDK_NAME, SDK_VERSION, type SdkInfo, type SdkReliabilityConfig, type SdkRetryConfig, SessionStorage, type SmsOTPOperationConfig, type SmsOTPOperationPostResponseStart, type SmsOTPOperationSpecType, SmsOtpOperationFull, type SocialLoginExchangeCodeFinished, type SocialLoginExchangeCodeStart, type SocialLoginGetRedirectUrlFinished, type SocialLoginGetRedirectUrlStart, type SocialLoginOperationConfig, SocialLoginOperationFull, type SocialLoginProviderType, type SocialLoginSpecType, type StepHelper, type StepOptions, type StorageEngine, type SubflowTrigger, type SubflowType, type TelemetryEntry, type TelemetryLevel, type TelemetrySink, type TrackerOptions, type Transport, type TransportMakeRequestResponse, type TransportOptions, type UserReference, cacheConfig, clearExperiment, clearExperiments, createLogger, destroy, getExperiments, getSessionId, getTracker, init, loadCachedConfig, logError, logInfo, namespacedKey, parseReliabilityConfig, resetSession, setExperiment, setExperiments, setUser, telemetry };
|