@corbado/observe 1.1.2 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -5,9 +5,17 @@ interface SdkInfo {
5
5
  type EventType = "predefined" | "custom" | "error" | "identify";
6
6
  type AuthMethodType = "identifier-email"
7
7
  /** Neutral "enter an identifier" choice; the identifier kind is the provide-identifier spec type. */
8
- | "identifier" | "passkey-login-known-identifier" | "passkey-login-no-identifier" | "passkey-login-cui" | "passkey-login-immediate" | "passkey-enrollment" | "password-login" | "password-login-known-identifier" | "password-login-with-identifier" | "password-enrollment" | "email-otp" | "email-otp-login" | "email-otp-enrollment" | "email-link" | "email-link-login" | "email-link-enrollment" | "sms-otp" | "sms-otp-login" | "sms-otp-enrollment" | "social-google" | "social-apple" | "social-facebook" | "social-other" | "reset-flow" | "provide-data";
9
- type SubflowType = "key-signing" | "key-registration" | "trusted-device-check" | "trusted-device-enrollment" | "passkey-enrollment" | "passkey-login" | "email-otp" | "email-link" | "social-login" | "sms-otp" | "provide-identifier" | "provide-data" | "password-login" | "password-enrollment" | "totp" | "app-confirmation" | "captcha";
8
+ | "identifier" | "passkey-login-known-identifier" | "passkey-login-no-identifier" | "passkey-login-cui" | "passkey-login-immediate" | "passkey-enrollment" | "password-login" | "password-login-known-identifier" | "password-login-with-identifier" | "password-enrollment" | "email-otp" | "email-otp-login" | "email-otp-enrollment" | "email-link" | "email-link-login" | "email-link-enrollment" | "sms-otp" | "sms-otp-login" | "sms-otp-enrollment" | "social-google" | "social-apple" | "social-facebook" | "social-other" | "sso-login" | "reset-flow" | "provide-data";
9
+ type SubflowType = "key-signing" | "key-registration" | "trusted-device-check" | "trusted-device-enrollment" | "passkey-enrollment" | "passkey-login" | "email-otp" | "email-link" | "social-login" | "sso-login" | "sms-otp" | "provide-identifier" | "provide-data" | "password-login" | "password-enrollment" | "totp" | "app-confirmation" | "captcha";
10
10
  type FlowType = "login" | "signup" | "recovery" | "enrollment" | (string & {});
11
+ type SetFlowTagsOptions = {
12
+ /** Flow type to tag; defaults to `"*"` (the innermost open flow of any type). */
13
+ flowType?: FlowType;
14
+ /** Whether child flows inherit the tags (default `true`). */
15
+ expandToChildren?: boolean;
16
+ /** Whether following sibling flows inherit the tags (default `true`). */
17
+ expandToFollowing?: boolean;
18
+ };
11
19
  type SocialLoginProviderType = "google" | "apple" | "facebook" | "github" | "microsoft" | "line" | "kakao" | "singpass" | "other";
12
20
  declare enum AuthEventName {
13
21
  FlowStarted = "flow_started",
@@ -1296,6 +1304,28 @@ declare class SocialLoginOperationFull extends OperationFull {
1296
1304
  constructor(tracker: CorbadoTracker, config?: SocialLoginOperationConfig);
1297
1305
  }
1298
1306
 
1307
+ type SsoLoginSpecType = "pre-identifier" | "post-identifier";
1308
+ type SsoLoginGetRedirectUrlStart = {
1309
+ explicitSpecType?: SsoLoginSpecType;
1310
+ };
1311
+ type SsoLoginGetRedirectUrlFinished = {};
1312
+ type SsoLoginExchangeCodeStart = {};
1313
+ type SsoLoginExchangeCodeFinished = {};
1314
+ type SsoLoginOperationConfig = {
1315
+ /** 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. */
1316
+ explicitSpecType?: SsoLoginSpecType;
1317
+ /** The organization's claimed email domain only (e.g. `example.com`), never a full address. Max 253 characters. */
1318
+ organizationDomain?: string;
1319
+ /** `"system"` when the application routed to SSO without a user choice, e.g. by the email domain. */
1320
+ actor?: "user" | "system";
1321
+ };
1322
+ /** Enterprise SSO (SAML/OIDC) via the organization's identity provider; kept apart from user-chosen social login. */
1323
+ declare class SsoLoginOperationFull extends OperationFull {
1324
+ readonly getRedirectUrl: StepHelper<SsoLoginGetRedirectUrlStart, SsoLoginGetRedirectUrlFinished>;
1325
+ readonly exchangeCode: StepHelper<SsoLoginExchangeCodeStart, SsoLoginExchangeCodeFinished>;
1326
+ constructor(tracker: CorbadoTracker, config?: SsoLoginOperationConfig);
1327
+ }
1328
+
1299
1329
  /** How the confirmation is reached: a QR handoff or an app on the browser's device. */
1300
1330
  type AppConfirmationOperationSpecType = "qr-code" | "same-device";
1301
1331
  type AppConfirmationOperationStart = {
@@ -1816,6 +1846,36 @@ declare class CorbadoTracker {
1816
1846
  * ```
1817
1847
  */
1818
1848
  setUser(user: UserReference): void;
1849
+ /**
1850
+ * Attach tags to the flow that is open right now.
1851
+ *
1852
+ * @remarks
1853
+ * Emits one `flow_enriched` carrying `tags` and no user reference, with data
1854
+ * `{ match: { flowType, at: "during" } }` plus `expCh` / `expFol` when the options set them.
1855
+ *
1856
+ * - The tags land on the innermost flow open at call time (of `flowType` when given; default `"*"`, any type).
1857
+ * - `expandToChildren` (default `true`): child flows of that flow inherit the tags.
1858
+ * - `expandToFollowing` (default `true`): later sibling flows inherit the tags until the next
1859
+ * sibling of the same flow type as the tagged flow.
1860
+ * - Per key the last `setFlowTags()` value wins; it also overrides a same-key tag passed to that
1861
+ * flow's own tracking calls (e.g. `flowStarted()`).
1862
+ * - Call while the target flow is open. An enrichment after the flow's last container event
1863
+ * (for example after `flowFinished()`) matches no flow and is dropped with a
1864
+ * `flow_enriched/no_matching_flow` classification warning.
1865
+ * - Tag keys and values are case-sensitive. Entries with an empty key or a non-string value are
1866
+ * dropped with a warning; nothing is sent when no valid entry remains.
1867
+ *
1868
+ * @param tags - Key-value tags for filtering and segmentation.
1869
+ * @param options - Target flow type and tag expansion; omitted flags default to `true`.
1870
+ *
1871
+ * @example
1872
+ * ```typescript
1873
+ * tracker.flowStarted({ flowName: "login" });
1874
+ * tracker.setFlowTags({ entryPoint: "checkout" });
1875
+ * tracker.flowFinished({ flowName: "login" });
1876
+ * ```
1877
+ */
1878
+ setFlowTags(tags: Record<string, string>, options?: SetFlowTagsOptions): void;
1819
1879
  /**
1820
1880
  * Track when you present authentication method choices to the user.
1821
1881
  *
@@ -1923,6 +1983,29 @@ declare class CorbadoTracker {
1923
1983
  provideIdentifierOperationFull(config?: OperationFullProvideIdentifierWithCUIConfig): OperationFullProvideIdentifierWithCUI;
1924
1984
  provideDataOperationFull(config?: ProvideDataOperationConfig): ProvideDataOperationFull;
1925
1985
  socialLoginOperationFull(config?: SocialLoginOperationConfig): SocialLoginOperationFull;
1986
+ /**
1987
+ * Track enterprise SSO (SAML/OIDC) through the organization's identity provider.
1988
+ *
1989
+ * @param config - Optional spec type, organization email domain and actor.
1990
+ * @remarks
1991
+ * Use for policy-routed SSO, kept apart from user-chosen social login. Set `actor: "system"` when
1992
+ * the application routed to SSO without a user choice, e.g. by the email domain. Report only the
1993
+ * organization's domain, never a full address.
1994
+ * @example
1995
+ * ```ts
1996
+ * const sso = tracker.ssoLoginOperationFull({
1997
+ * explicitSpecType: "post-identifier",
1998
+ * organizationDomain: "example.com",
1999
+ * actor: "system",
2000
+ * });
2001
+ * sso.getRedirectUrl.start({});
2002
+ * sso.getRedirectUrl.finished({});
2003
+ * // After the identity provider redirects back:
2004
+ * sso.exchangeCode.start({});
2005
+ * sso.exchangeCode.finished({});
2006
+ * ```
2007
+ */
2008
+ ssoLoginOperationFull(config?: SsoLoginOperationConfig): SsoLoginOperationFull;
1926
2009
  appConfirmationOperationFull(config?: AppConfirmationOperationConfig): AppConfirmationOperationFull;
1927
2010
  /**
1928
2011
  * Track direct key signing outside WebAuthn through prepare and sign.
@@ -2517,6 +2600,11 @@ declare function getSessionId(): string | undefined;
2517
2600
  * See {@link CorbadoTracker.setUser}.
2518
2601
  */
2519
2602
  declare function setUser(user: UserReference): void;
2603
+ /**
2604
+ * Attach tags to the global tracker's innermost open flow.
2605
+ * See {@link CorbadoTracker.setFlowTags}.
2606
+ */
2607
+ declare function setFlowTags(tags: Record<string, string>, options?: SetFlowTagsOptions): void;
2520
2608
  declare function setExperiment(key: string, variant: string): void;
2521
2609
  declare function setExperiments(assignments: Record<string, string>): void;
2522
2610
  declare function clearExperiment(key: string): void;
@@ -2527,4 +2615,4 @@ declare function logInfo(message: string): void;
2527
2615
  declare function logError(message: string): void;
2528
2616
  declare function destroy(): Promise<void>;
2529
2617
 
2530
- 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 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 FlowAutoFinished, type FlowDecided, type FlowFinished, type FlowHandle, type FlowReset, type FlowStarted, type FlowType, type FlushReason, 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, 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, RAW_ERROR_BOUNDS, type RawErrorEnvelope, RequestQueue, SDK_NAME, SDK_VERSION, type SdkInfo, type SdkReliabilityConfig, type SdkReliabilityConfigOverrides, type SdkRetryConfig, type SerializeRawErrorOptions, SessionStorage, type SmsOTPOperationConfig, type SmsOTPOperationPostResponseStart, type SmsOTPOperationSpecType, SmsOtpOperationFull, type SocialLoginExchangeCodeFinished, type SocialLoginExchangeCodeStart, type SocialLoginGetRedirectUrlFinished, type SocialLoginGetRedirectUrlStart, type SocialLoginOperationConfig, SocialLoginOperationFull, type SocialLoginProviderType, type SocialLoginSpecType, type SourcePathQueryMode, 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 TrustedDeviceBindingMetadata, type TrustedDeviceCheckConfig, TrustedDeviceCheckOperationFull, type TrustedDeviceCheckResult, type TrustedDeviceCheckStepResult, type TrustedDeviceCheckTypedError, TrustedDeviceEnrollmentOperationFull, type TrustedDeviceEnrollmentResult, type TrustedDeviceOperationConfig, type TrustedDevicePurpose, type TrustedDeviceStorage, type UserReference, cacheConfig, clearExperiment, clearExperiments, createLogger, destroy, getExperiments, getSessionId, getTracker, init, loadCachedConfig, logError, logInfo, namespacedKey, parseReliabilityConfig, resetSession, resolveRawErrorLimits, resolveReliabilityConfig, sanitizeAssertionResponse, sanitizeCreationOptions, sanitizeCreationResponse, sanitizeRequestOptions, serializeRawError, setExperiment, setExperiments, setUser, telemetry };
2618
+ 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 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 FlowAutoFinished, type FlowDecided, type FlowFinished, type FlowHandle, type FlowReset, type FlowStarted, type FlowType, type FlushReason, 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, 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, RAW_ERROR_BOUNDS, type RawErrorEnvelope, RequestQueue, SDK_NAME, SDK_VERSION, type SdkInfo, type SdkReliabilityConfig, type SdkReliabilityConfigOverrides, type SdkRetryConfig, type SerializeRawErrorOptions, SessionStorage, type SetFlowTagsOptions, type SmsOTPOperationConfig, type SmsOTPOperationPostResponseStart, type SmsOTPOperationSpecType, SmsOtpOperationFull, 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 StepHelper, type StepOptions, type StorageEngine, type SubflowTrigger, type SubflowType, type TelemetryEntry, type TelemetryLevel, type TelemetrySink, 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, type UserReference, cacheConfig, clearExperiment, clearExperiments, createLogger, destroy, getExperiments, getSessionId, getTracker, init, loadCachedConfig, logError, logInfo, namespacedKey, parseReliabilityConfig, resetSession, resolveRawErrorLimits, resolveReliabilityConfig, sanitizeAssertionResponse, sanitizeCreationOptions, sanitizeCreationResponse, sanitizeRequestOptions, serializeRawError, setExperiment, setExperiments, setFlowTags, setUser, telemetry };
package/dist/index.d.ts CHANGED
@@ -5,9 +5,17 @@ interface SdkInfo {
5
5
  type EventType = "predefined" | "custom" | "error" | "identify";
6
6
  type AuthMethodType = "identifier-email"
7
7
  /** Neutral "enter an identifier" choice; the identifier kind is the provide-identifier spec type. */
8
- | "identifier" | "passkey-login-known-identifier" | "passkey-login-no-identifier" | "passkey-login-cui" | "passkey-login-immediate" | "passkey-enrollment" | "password-login" | "password-login-known-identifier" | "password-login-with-identifier" | "password-enrollment" | "email-otp" | "email-otp-login" | "email-otp-enrollment" | "email-link" | "email-link-login" | "email-link-enrollment" | "sms-otp" | "sms-otp-login" | "sms-otp-enrollment" | "social-google" | "social-apple" | "social-facebook" | "social-other" | "reset-flow" | "provide-data";
9
- type SubflowType = "key-signing" | "key-registration" | "trusted-device-check" | "trusted-device-enrollment" | "passkey-enrollment" | "passkey-login" | "email-otp" | "email-link" | "social-login" | "sms-otp" | "provide-identifier" | "provide-data" | "password-login" | "password-enrollment" | "totp" | "app-confirmation" | "captcha";
8
+ | "identifier" | "passkey-login-known-identifier" | "passkey-login-no-identifier" | "passkey-login-cui" | "passkey-login-immediate" | "passkey-enrollment" | "password-login" | "password-login-known-identifier" | "password-login-with-identifier" | "password-enrollment" | "email-otp" | "email-otp-login" | "email-otp-enrollment" | "email-link" | "email-link-login" | "email-link-enrollment" | "sms-otp" | "sms-otp-login" | "sms-otp-enrollment" | "social-google" | "social-apple" | "social-facebook" | "social-other" | "sso-login" | "reset-flow" | "provide-data";
9
+ type SubflowType = "key-signing" | "key-registration" | "trusted-device-check" | "trusted-device-enrollment" | "passkey-enrollment" | "passkey-login" | "email-otp" | "email-link" | "social-login" | "sso-login" | "sms-otp" | "provide-identifier" | "provide-data" | "password-login" | "password-enrollment" | "totp" | "app-confirmation" | "captcha";
10
10
  type FlowType = "login" | "signup" | "recovery" | "enrollment" | (string & {});
11
+ type SetFlowTagsOptions = {
12
+ /** Flow type to tag; defaults to `"*"` (the innermost open flow of any type). */
13
+ flowType?: FlowType;
14
+ /** Whether child flows inherit the tags (default `true`). */
15
+ expandToChildren?: boolean;
16
+ /** Whether following sibling flows inherit the tags (default `true`). */
17
+ expandToFollowing?: boolean;
18
+ };
11
19
  type SocialLoginProviderType = "google" | "apple" | "facebook" | "github" | "microsoft" | "line" | "kakao" | "singpass" | "other";
12
20
  declare enum AuthEventName {
13
21
  FlowStarted = "flow_started",
@@ -1296,6 +1304,28 @@ declare class SocialLoginOperationFull extends OperationFull {
1296
1304
  constructor(tracker: CorbadoTracker, config?: SocialLoginOperationConfig);
1297
1305
  }
1298
1306
 
1307
+ type SsoLoginSpecType = "pre-identifier" | "post-identifier";
1308
+ type SsoLoginGetRedirectUrlStart = {
1309
+ explicitSpecType?: SsoLoginSpecType;
1310
+ };
1311
+ type SsoLoginGetRedirectUrlFinished = {};
1312
+ type SsoLoginExchangeCodeStart = {};
1313
+ type SsoLoginExchangeCodeFinished = {};
1314
+ type SsoLoginOperationConfig = {
1315
+ /** 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. */
1316
+ explicitSpecType?: SsoLoginSpecType;
1317
+ /** The organization's claimed email domain only (e.g. `example.com`), never a full address. Max 253 characters. */
1318
+ organizationDomain?: string;
1319
+ /** `"system"` when the application routed to SSO without a user choice, e.g. by the email domain. */
1320
+ actor?: "user" | "system";
1321
+ };
1322
+ /** Enterprise SSO (SAML/OIDC) via the organization's identity provider; kept apart from user-chosen social login. */
1323
+ declare class SsoLoginOperationFull extends OperationFull {
1324
+ readonly getRedirectUrl: StepHelper<SsoLoginGetRedirectUrlStart, SsoLoginGetRedirectUrlFinished>;
1325
+ readonly exchangeCode: StepHelper<SsoLoginExchangeCodeStart, SsoLoginExchangeCodeFinished>;
1326
+ constructor(tracker: CorbadoTracker, config?: SsoLoginOperationConfig);
1327
+ }
1328
+
1299
1329
  /** How the confirmation is reached: a QR handoff or an app on the browser's device. */
1300
1330
  type AppConfirmationOperationSpecType = "qr-code" | "same-device";
1301
1331
  type AppConfirmationOperationStart = {
@@ -1816,6 +1846,36 @@ declare class CorbadoTracker {
1816
1846
  * ```
1817
1847
  */
1818
1848
  setUser(user: UserReference): void;
1849
+ /**
1850
+ * Attach tags to the flow that is open right now.
1851
+ *
1852
+ * @remarks
1853
+ * Emits one `flow_enriched` carrying `tags` and no user reference, with data
1854
+ * `{ match: { flowType, at: "during" } }` plus `expCh` / `expFol` when the options set them.
1855
+ *
1856
+ * - The tags land on the innermost flow open at call time (of `flowType` when given; default `"*"`, any type).
1857
+ * - `expandToChildren` (default `true`): child flows of that flow inherit the tags.
1858
+ * - `expandToFollowing` (default `true`): later sibling flows inherit the tags until the next
1859
+ * sibling of the same flow type as the tagged flow.
1860
+ * - Per key the last `setFlowTags()` value wins; it also overrides a same-key tag passed to that
1861
+ * flow's own tracking calls (e.g. `flowStarted()`).
1862
+ * - Call while the target flow is open. An enrichment after the flow's last container event
1863
+ * (for example after `flowFinished()`) matches no flow and is dropped with a
1864
+ * `flow_enriched/no_matching_flow` classification warning.
1865
+ * - Tag keys and values are case-sensitive. Entries with an empty key or a non-string value are
1866
+ * dropped with a warning; nothing is sent when no valid entry remains.
1867
+ *
1868
+ * @param tags - Key-value tags for filtering and segmentation.
1869
+ * @param options - Target flow type and tag expansion; omitted flags default to `true`.
1870
+ *
1871
+ * @example
1872
+ * ```typescript
1873
+ * tracker.flowStarted({ flowName: "login" });
1874
+ * tracker.setFlowTags({ entryPoint: "checkout" });
1875
+ * tracker.flowFinished({ flowName: "login" });
1876
+ * ```
1877
+ */
1878
+ setFlowTags(tags: Record<string, string>, options?: SetFlowTagsOptions): void;
1819
1879
  /**
1820
1880
  * Track when you present authentication method choices to the user.
1821
1881
  *
@@ -1923,6 +1983,29 @@ declare class CorbadoTracker {
1923
1983
  provideIdentifierOperationFull(config?: OperationFullProvideIdentifierWithCUIConfig): OperationFullProvideIdentifierWithCUI;
1924
1984
  provideDataOperationFull(config?: ProvideDataOperationConfig): ProvideDataOperationFull;
1925
1985
  socialLoginOperationFull(config?: SocialLoginOperationConfig): SocialLoginOperationFull;
1986
+ /**
1987
+ * Track enterprise SSO (SAML/OIDC) through the organization's identity provider.
1988
+ *
1989
+ * @param config - Optional spec type, organization email domain and actor.
1990
+ * @remarks
1991
+ * Use for policy-routed SSO, kept apart from user-chosen social login. Set `actor: "system"` when
1992
+ * the application routed to SSO without a user choice, e.g. by the email domain. Report only the
1993
+ * organization's domain, never a full address.
1994
+ * @example
1995
+ * ```ts
1996
+ * const sso = tracker.ssoLoginOperationFull({
1997
+ * explicitSpecType: "post-identifier",
1998
+ * organizationDomain: "example.com",
1999
+ * actor: "system",
2000
+ * });
2001
+ * sso.getRedirectUrl.start({});
2002
+ * sso.getRedirectUrl.finished({});
2003
+ * // After the identity provider redirects back:
2004
+ * sso.exchangeCode.start({});
2005
+ * sso.exchangeCode.finished({});
2006
+ * ```
2007
+ */
2008
+ ssoLoginOperationFull(config?: SsoLoginOperationConfig): SsoLoginOperationFull;
1926
2009
  appConfirmationOperationFull(config?: AppConfirmationOperationConfig): AppConfirmationOperationFull;
1927
2010
  /**
1928
2011
  * Track direct key signing outside WebAuthn through prepare and sign.
@@ -2517,6 +2600,11 @@ declare function getSessionId(): string | undefined;
2517
2600
  * See {@link CorbadoTracker.setUser}.
2518
2601
  */
2519
2602
  declare function setUser(user: UserReference): void;
2603
+ /**
2604
+ * Attach tags to the global tracker's innermost open flow.
2605
+ * See {@link CorbadoTracker.setFlowTags}.
2606
+ */
2607
+ declare function setFlowTags(tags: Record<string, string>, options?: SetFlowTagsOptions): void;
2520
2608
  declare function setExperiment(key: string, variant: string): void;
2521
2609
  declare function setExperiments(assignments: Record<string, string>): void;
2522
2610
  declare function clearExperiment(key: string): void;
@@ -2527,4 +2615,4 @@ declare function logInfo(message: string): void;
2527
2615
  declare function logError(message: string): void;
2528
2616
  declare function destroy(): Promise<void>;
2529
2617
 
2530
- 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 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 FlowAutoFinished, type FlowDecided, type FlowFinished, type FlowHandle, type FlowReset, type FlowStarted, type FlowType, type FlushReason, 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, 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, RAW_ERROR_BOUNDS, type RawErrorEnvelope, RequestQueue, SDK_NAME, SDK_VERSION, type SdkInfo, type SdkReliabilityConfig, type SdkReliabilityConfigOverrides, type SdkRetryConfig, type SerializeRawErrorOptions, SessionStorage, type SmsOTPOperationConfig, type SmsOTPOperationPostResponseStart, type SmsOTPOperationSpecType, SmsOtpOperationFull, type SocialLoginExchangeCodeFinished, type SocialLoginExchangeCodeStart, type SocialLoginGetRedirectUrlFinished, type SocialLoginGetRedirectUrlStart, type SocialLoginOperationConfig, SocialLoginOperationFull, type SocialLoginProviderType, type SocialLoginSpecType, type SourcePathQueryMode, 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 TrustedDeviceBindingMetadata, type TrustedDeviceCheckConfig, TrustedDeviceCheckOperationFull, type TrustedDeviceCheckResult, type TrustedDeviceCheckStepResult, type TrustedDeviceCheckTypedError, TrustedDeviceEnrollmentOperationFull, type TrustedDeviceEnrollmentResult, type TrustedDeviceOperationConfig, type TrustedDevicePurpose, type TrustedDeviceStorage, type UserReference, cacheConfig, clearExperiment, clearExperiments, createLogger, destroy, getExperiments, getSessionId, getTracker, init, loadCachedConfig, logError, logInfo, namespacedKey, parseReliabilityConfig, resetSession, resolveRawErrorLimits, resolveReliabilityConfig, sanitizeAssertionResponse, sanitizeCreationOptions, sanitizeCreationResponse, sanitizeRequestOptions, serializeRawError, setExperiment, setExperiments, setUser, telemetry };
2618
+ 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 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 FlowAutoFinished, type FlowDecided, type FlowFinished, type FlowHandle, type FlowReset, type FlowStarted, type FlowType, type FlushReason, 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, 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, RAW_ERROR_BOUNDS, type RawErrorEnvelope, RequestQueue, SDK_NAME, SDK_VERSION, type SdkInfo, type SdkReliabilityConfig, type SdkReliabilityConfigOverrides, type SdkRetryConfig, type SerializeRawErrorOptions, SessionStorage, type SetFlowTagsOptions, type SmsOTPOperationConfig, type SmsOTPOperationPostResponseStart, type SmsOTPOperationSpecType, SmsOtpOperationFull, 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 StepHelper, type StepOptions, type StorageEngine, type SubflowTrigger, type SubflowType, type TelemetryEntry, type TelemetryLevel, type TelemetrySink, 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, type UserReference, cacheConfig, clearExperiment, clearExperiments, createLogger, destroy, getExperiments, getSessionId, getTracker, init, loadCachedConfig, logError, logInfo, namespacedKey, parseReliabilityConfig, resetSession, resolveRawErrorLimits, resolveReliabilityConfig, sanitizeAssertionResponse, sanitizeCreationOptions, sanitizeCreationResponse, sanitizeRequestOptions, serializeRawError, setExperiment, setExperiments, setFlowTags, setUser, telemetry };