@corbado/observe 0.16.3 → 0.16.5
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 +4 -4
- package/dist/index.d.mts +139 -62
- package/dist/index.d.ts +139 -62
- package/dist/index.js +4 -4
- package/dist/index.mjs +4 -4
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -6,7 +6,7 @@ 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
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 = "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";
|
|
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";
|
|
10
10
|
type FlowType = "login" | "signup" | "recovery" | "enrollment" | (string & {});
|
|
11
11
|
type SocialLoginProviderType = "google" | "apple" | "facebook" | "github" | "microsoft" | "other";
|
|
12
12
|
declare enum AuthEventName {
|
|
@@ -58,6 +58,14 @@ type UserReference = {
|
|
|
58
58
|
/** Shared UUID used to link sessions across environments. */
|
|
59
59
|
crossEnvironmentTransactionID?: string;
|
|
60
60
|
};
|
|
61
|
+
/** A stable reference to all flows opened by one flow_started event. */
|
|
62
|
+
interface FlowHandle {
|
|
63
|
+
/** Attach identity to this journey, including after it finishes or the tracker session changes.
|
|
64
|
+
* Resolves when tracking/enqueue completes, not when server delivery is acknowledged.
|
|
65
|
+
* The tracker must remain alive; this method does not revive a destroyed tracker.
|
|
66
|
+
*/
|
|
67
|
+
enrich(user: UserReference): Promise<void>;
|
|
68
|
+
}
|
|
61
69
|
type LegacyUserReference = {
|
|
62
70
|
/** @deprecated Use tracker.setUser() within the active flow instead. */
|
|
63
71
|
userId?: string;
|
|
@@ -449,63 +457,6 @@ type SdkReliabilityConfigOverrides = Partial<Omit<SdkReliabilityConfig, "retry">
|
|
|
449
457
|
retry?: Partial<SdkRetryConfig>;
|
|
450
458
|
};
|
|
451
459
|
|
|
452
|
-
/** Sink that escalates a diagnostic message to the telemetry stream. */
|
|
453
|
-
type TelemetrySink = (level: TelemetryLevel, message: string) => void;
|
|
454
|
-
interface Logger {
|
|
455
|
-
debug(message: string, ...args: unknown[]): void;
|
|
456
|
-
info(message: string, ...args: unknown[]): void;
|
|
457
|
-
warn(message: string, ...args: unknown[]): void;
|
|
458
|
-
error(message: string, ...args: unknown[]): void;
|
|
459
|
-
critical(message: string, ...args: unknown[]): void;
|
|
460
|
-
/**
|
|
461
|
-
* Escalate a diagnostic message to the telemetry stream, if a sink is attached (no-op otherwise).
|
|
462
|
-
* Unlike the level methods, telemetry is delivered to the backend regardless of the `debug` flag.
|
|
463
|
-
* Optional so an integrator-provided custom logger stays valid without implementing it.
|
|
464
|
-
*/
|
|
465
|
-
reportTelemetry?(level: TelemetryLevel, message: string): void;
|
|
466
|
-
/** Attach (or clear) the telemetry sink. Called once by the tracker after the queue exists. */
|
|
467
|
-
setTelemetrySink?(sink: TelemetrySink | undefined): void;
|
|
468
|
-
}
|
|
469
|
-
interface CreateLoggerOptions {
|
|
470
|
-
debug: boolean;
|
|
471
|
-
}
|
|
472
|
-
declare function createLogger(options: CreateLoggerOptions): Logger;
|
|
473
|
-
|
|
474
|
-
type WindowCaptureContext = Pick<LowEvent, "subflowStartEventId" | "fieldRole" | "initiator"> & {
|
|
475
|
-
sessionId?: string;
|
|
476
|
-
};
|
|
477
|
-
/** One passive observer per tracker. Field/ceremony collectors register context, not DOM listeners. */
|
|
478
|
-
declare class SharedWindowObserver {
|
|
479
|
-
private logger;
|
|
480
|
-
private enqueue;
|
|
481
|
-
private flushKeepalive;
|
|
482
|
-
private inputs;
|
|
483
|
-
private ceremonies;
|
|
484
|
-
private removers;
|
|
485
|
-
private lastBlur?;
|
|
486
|
-
private bracket?;
|
|
487
|
-
private unrelatedPointerAt;
|
|
488
|
-
private destroyed;
|
|
489
|
-
private viewportContext;
|
|
490
|
-
private resize;
|
|
491
|
-
private scroll;
|
|
492
|
-
constructor(logger: Logger, enqueue: (low: LowEvent, sessionId?: string) => void, flushKeepalive: () => void);
|
|
493
|
-
registerInputs(fields: readonly HTMLInputElement[], context: () => WindowCaptureContext, flush: () => void): () => void;
|
|
494
|
-
beginCeremony(context: WindowCaptureContext): {
|
|
495
|
-
settle: (tailMs: number) => void;
|
|
496
|
-
destroy: () => void;
|
|
497
|
-
};
|
|
498
|
-
private context;
|
|
499
|
-
private findInput;
|
|
500
|
-
/** Flush all registered input batches before a high-level lifecycle boundary. */
|
|
501
|
-
flushInputs(): void;
|
|
502
|
-
private emit;
|
|
503
|
-
private listen;
|
|
504
|
-
private extendViewport;
|
|
505
|
-
private observeNavigation;
|
|
506
|
-
destroy(): void;
|
|
507
|
-
}
|
|
508
|
-
|
|
509
460
|
/**
|
|
510
461
|
* Where low events go. `flushKeepalive` is requested on `pagehide` teardown so lows batched after
|
|
511
462
|
* the queue's own lifecycle flush still get out; operations wire it to the client's
|
|
@@ -616,6 +567,28 @@ declare function resolveRawErrorLimits(options?: SerializeRawErrorOptions): Limi
|
|
|
616
567
|
*/
|
|
617
568
|
declare function serializeRawError(value: unknown, options?: SerializeRawErrorOptions): RawErrorEnvelope | undefined;
|
|
618
569
|
|
|
570
|
+
/** Sink that escalates a diagnostic message to the telemetry stream. */
|
|
571
|
+
type TelemetrySink = (level: TelemetryLevel, message: string) => void;
|
|
572
|
+
interface Logger {
|
|
573
|
+
debug(message: string, ...args: unknown[]): void;
|
|
574
|
+
info(message: string, ...args: unknown[]): void;
|
|
575
|
+
warn(message: string, ...args: unknown[]): void;
|
|
576
|
+
error(message: string, ...args: unknown[]): void;
|
|
577
|
+
critical(message: string, ...args: unknown[]): void;
|
|
578
|
+
/**
|
|
579
|
+
* Escalate a diagnostic message to the telemetry stream, if a sink is attached (no-op otherwise).
|
|
580
|
+
* Unlike the level methods, telemetry is delivered to the backend regardless of the `debug` flag.
|
|
581
|
+
* Optional so an integrator-provided custom logger stays valid without implementing it.
|
|
582
|
+
*/
|
|
583
|
+
reportTelemetry?(level: TelemetryLevel, message: string): void;
|
|
584
|
+
/** Attach (or clear) the telemetry sink. Called once by the tracker after the queue exists. */
|
|
585
|
+
setTelemetrySink?(sink: TelemetrySink | undefined): void;
|
|
586
|
+
}
|
|
587
|
+
interface CreateLoggerOptions {
|
|
588
|
+
debug: boolean;
|
|
589
|
+
}
|
|
590
|
+
declare function createLogger(options: CreateLoggerOptions): Logger;
|
|
591
|
+
|
|
619
592
|
/** Ceremony context lease on the shared observer. Never installs its own window listeners. */
|
|
620
593
|
declare class LowEventWindowTracker {
|
|
621
594
|
private logger;
|
|
@@ -733,6 +706,61 @@ declare abstract class OperationFull {
|
|
|
733
706
|
protected defineStep<TStart = {}, TFinished = {}, TTypedError = never>(stepName: string, ignoreAsInteractionOnStart?: boolean): StepHelper<TStart, TFinished, TTypedError>;
|
|
734
707
|
}
|
|
735
708
|
|
|
709
|
+
/** Shared configuration for direct key signing and authority registration. */
|
|
710
|
+
type KeyOperationConfig = {
|
|
711
|
+
/** Reserved for future variants; no spec types are currently defined. */
|
|
712
|
+
explicitSpecType?: undefined;
|
|
713
|
+
};
|
|
714
|
+
declare class KeySigningOperationFull extends OperationFull {
|
|
715
|
+
/** Resolve an eligible key and prepare the input for an actual signing attempt. */
|
|
716
|
+
readonly prepare: StepHelper;
|
|
717
|
+
/** Sign and assemble the usable signed artifact. Does not include submitting it. */
|
|
718
|
+
readonly sign: StepHelper;
|
|
719
|
+
constructor(tracker: CorbadoTracker, config?: KeyOperationConfig);
|
|
720
|
+
}
|
|
721
|
+
declare class KeyRegistrationOperationFull extends OperationFull {
|
|
722
|
+
/** Build the request that will establish the key's authority. */
|
|
723
|
+
readonly prepare: StepHelper;
|
|
724
|
+
/** Submit and await acceptance: finish only when the key is authorized and usable. */
|
|
725
|
+
readonly postResponse: StepHelper;
|
|
726
|
+
constructor(tracker: CorbadoTracker, config?: KeyOperationConfig);
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
type WindowCaptureContext = Pick<LowEvent, "subflowStartEventId" | "fieldRole" | "initiator"> & {
|
|
730
|
+
sessionId?: string;
|
|
731
|
+
};
|
|
732
|
+
/** One passive observer per tracker. Field/ceremony collectors register context, not DOM listeners. */
|
|
733
|
+
declare class SharedWindowObserver {
|
|
734
|
+
private logger;
|
|
735
|
+
private enqueue;
|
|
736
|
+
private flushKeepalive;
|
|
737
|
+
private inputs;
|
|
738
|
+
private ceremonies;
|
|
739
|
+
private removers;
|
|
740
|
+
private lastBlur?;
|
|
741
|
+
private bracket?;
|
|
742
|
+
private unrelatedPointerAt;
|
|
743
|
+
private destroyed;
|
|
744
|
+
private viewportContext;
|
|
745
|
+
private resize;
|
|
746
|
+
private scroll;
|
|
747
|
+
constructor(logger: Logger, enqueue: (low: LowEvent, sessionId?: string) => void, flushKeepalive: () => void);
|
|
748
|
+
registerInputs(fields: readonly HTMLInputElement[], context: () => WindowCaptureContext, flush: () => void): () => void;
|
|
749
|
+
beginCeremony(context: WindowCaptureContext): {
|
|
750
|
+
settle: (tailMs: number) => void;
|
|
751
|
+
destroy: () => void;
|
|
752
|
+
};
|
|
753
|
+
private context;
|
|
754
|
+
private findInput;
|
|
755
|
+
/** Flush all registered input batches before a high-level lifecycle boundary. */
|
|
756
|
+
flushInputs(): void;
|
|
757
|
+
private emit;
|
|
758
|
+
private listen;
|
|
759
|
+
private extendViewport;
|
|
760
|
+
private observeNavigation;
|
|
761
|
+
destroy(): void;
|
|
762
|
+
}
|
|
763
|
+
|
|
736
764
|
type PasskeyOperationLoginExplicitSpecType = "passkey-cui" | "passkey-known-identifier" | "passkey-no-identifier"
|
|
737
765
|
/**
|
|
738
766
|
* The `-auto` variants are the same two ceremonies started by the integration rather than by a
|
|
@@ -1398,6 +1426,9 @@ declare class CorbadoTracker {
|
|
|
1398
1426
|
* checkout login, or account recovery). If users can choose between multiple flows
|
|
1399
1427
|
* (such as login vs signup), pass `flowNames` and optionally `defaultFlowName`.
|
|
1400
1428
|
*
|
|
1429
|
+
* The returned handle can attach identity after completion with `await flow.enrich({ userId })`.
|
|
1430
|
+
* Enrichment requires a backend supporting explicit start-event targeting.
|
|
1431
|
+
*
|
|
1401
1432
|
* @param data - Flow metadata, including one flow (`flowName`) or multiple candidates (`flowNames`).
|
|
1402
1433
|
* @param tags - Optional key-value tags for filtering and segmentation.
|
|
1403
1434
|
* @param experiments - Optional per-call experiment overrides.
|
|
@@ -1413,7 +1444,7 @@ declare class CorbadoTracker {
|
|
|
1413
1444
|
* });
|
|
1414
1445
|
* ```
|
|
1415
1446
|
*/
|
|
1416
|
-
flowStarted(data: FlowStarted | MultiFlowStarted, tags?: Record<string, string>, experiments?: Record<string, string>, contexts?: Record<string, unknown>):
|
|
1447
|
+
flowStarted(data: FlowStarted | MultiFlowStarted, tags?: Record<string, string>, experiments?: Record<string, string>, contexts?: Record<string, unknown>): FlowHandle;
|
|
1417
1448
|
/**
|
|
1418
1449
|
* Track when the user commits to a specific flow.
|
|
1419
1450
|
*
|
|
@@ -1459,8 +1490,8 @@ declare class CorbadoTracker {
|
|
|
1459
1490
|
*
|
|
1460
1491
|
* @remarks
|
|
1461
1492
|
* Fire this when the user has finished the target flow end-to-end, such as completed login,
|
|
1462
|
-
* signup, or recovery. Record identity
|
|
1463
|
-
*
|
|
1493
|
+
* signup, or recovery. Record identity with `setUser()` while the flow is active,
|
|
1494
|
+
* or use the handle returned by `flowStarted()` to enrich it after completion.
|
|
1464
1495
|
*
|
|
1465
1496
|
* Legacy identity fields in `data` remain supported but are deprecated.
|
|
1466
1497
|
*
|
|
@@ -1638,6 +1669,52 @@ declare class CorbadoTracker {
|
|
|
1638
1669
|
provideDataOperationFull(config?: ProvideDataOperationConfig): ProvideDataOperationFull;
|
|
1639
1670
|
socialLoginOperationFull(config?: SocialLoginOperationConfig): SocialLoginOperationFull;
|
|
1640
1671
|
appConfirmationOperationFull(config?: AppConfirmationOperationConfig): AppConfirmationOperationFull;
|
|
1672
|
+
/**
|
|
1673
|
+
* Track direct key signing outside WebAuthn through prepare and sign.
|
|
1674
|
+
*
|
|
1675
|
+
* @param config - Optional configuration; explicitSpecType may only be undefined for now.
|
|
1676
|
+
* @remarks
|
|
1677
|
+
* Start prepare when resolving the eligible key and input for an actual attempt, not background
|
|
1678
|
+
* prefetch. Although system-driven, that work is meaningful interaction for classification.
|
|
1679
|
+
* Construction alone does not establish interaction. Finish sign only when the usable signed
|
|
1680
|
+
* artifact is ready, including assembly. Submission is outside this operation. Report failures
|
|
1681
|
+
* on the affected step using error(error). Never include key material, signatures or proofs.
|
|
1682
|
+
* WebAuthn assertions continue to use passkeyLoginFullOperation.
|
|
1683
|
+
* @example
|
|
1684
|
+
* ```ts
|
|
1685
|
+
* const signing = tracker.keySigningOperationFull();
|
|
1686
|
+
* signing.prepare.start({});
|
|
1687
|
+
* // Resolve an eligible key and prepare the signing input.
|
|
1688
|
+
* signing.prepare.finished({});
|
|
1689
|
+
* signing.sign.start({});
|
|
1690
|
+
* // Sign and assemble the artifact returned to the caller.
|
|
1691
|
+
* signing.sign.finished({});
|
|
1692
|
+
* ```
|
|
1693
|
+
*/
|
|
1694
|
+
keySigningOperationFull(config?: KeyOperationConfig): KeySigningOperationFull;
|
|
1695
|
+
/**
|
|
1696
|
+
* Track establishing a key's authority through prepare and postResponse.
|
|
1697
|
+
*
|
|
1698
|
+
* @param config - Optional configuration; explicitSpecType may only be undefined for now.
|
|
1699
|
+
* @remarks
|
|
1700
|
+
* Start prepare when building an actual registration request, not background prefetch.
|
|
1701
|
+
* This system-driven work is meaningful interaction; construction alone is not.
|
|
1702
|
+
* postResponse covers submission and acceptance. Finish only when the key is authorized and
|
|
1703
|
+
* usable, not merely when submission returns. Report rejection, transport, execution or timeout
|
|
1704
|
+
* errors on the affected step using error(error). Never include key material or proofs.
|
|
1705
|
+
* Credential creation and any authorizing WebAuthn assertion are separate operations.
|
|
1706
|
+
* @example
|
|
1707
|
+
* ```ts
|
|
1708
|
+
* const registration = tracker.keyRegistrationOperationFull();
|
|
1709
|
+
* registration.prepare.start({});
|
|
1710
|
+
* // Build the registration request.
|
|
1711
|
+
* registration.prepare.finished({});
|
|
1712
|
+
* registration.postResponse.start({});
|
|
1713
|
+
* // Submit and await evidence that the authority is usable.
|
|
1714
|
+
* registration.postResponse.finished({});
|
|
1715
|
+
* ```
|
|
1716
|
+
*/
|
|
1717
|
+
keyRegistrationOperationFull(config?: KeyOperationConfig): KeyRegistrationOperationFull;
|
|
1641
1718
|
captchaOperationFull(config?: CaptchaOperationConfig): CaptchaOperationFull;
|
|
1642
1719
|
/**
|
|
1643
1720
|
* Track a device-trust check through getOptions, ceremony and postResponse.
|
|
@@ -2284,4 +2361,4 @@ declare function logInfo(message: string): void;
|
|
|
2284
2361
|
declare function logError(message: string): void;
|
|
2285
2362
|
declare function destroy(): Promise<void>;
|
|
2286
2363
|
|
|
2287
|
-
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 ErrorStepOptions, 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 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 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 };
|
|
2364
|
+
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 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 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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ 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
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 = "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";
|
|
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";
|
|
10
10
|
type FlowType = "login" | "signup" | "recovery" | "enrollment" | (string & {});
|
|
11
11
|
type SocialLoginProviderType = "google" | "apple" | "facebook" | "github" | "microsoft" | "other";
|
|
12
12
|
declare enum AuthEventName {
|
|
@@ -58,6 +58,14 @@ type UserReference = {
|
|
|
58
58
|
/** Shared UUID used to link sessions across environments. */
|
|
59
59
|
crossEnvironmentTransactionID?: string;
|
|
60
60
|
};
|
|
61
|
+
/** A stable reference to all flows opened by one flow_started event. */
|
|
62
|
+
interface FlowHandle {
|
|
63
|
+
/** Attach identity to this journey, including after it finishes or the tracker session changes.
|
|
64
|
+
* Resolves when tracking/enqueue completes, not when server delivery is acknowledged.
|
|
65
|
+
* The tracker must remain alive; this method does not revive a destroyed tracker.
|
|
66
|
+
*/
|
|
67
|
+
enrich(user: UserReference): Promise<void>;
|
|
68
|
+
}
|
|
61
69
|
type LegacyUserReference = {
|
|
62
70
|
/** @deprecated Use tracker.setUser() within the active flow instead. */
|
|
63
71
|
userId?: string;
|
|
@@ -449,63 +457,6 @@ type SdkReliabilityConfigOverrides = Partial<Omit<SdkReliabilityConfig, "retry">
|
|
|
449
457
|
retry?: Partial<SdkRetryConfig>;
|
|
450
458
|
};
|
|
451
459
|
|
|
452
|
-
/** Sink that escalates a diagnostic message to the telemetry stream. */
|
|
453
|
-
type TelemetrySink = (level: TelemetryLevel, message: string) => void;
|
|
454
|
-
interface Logger {
|
|
455
|
-
debug(message: string, ...args: unknown[]): void;
|
|
456
|
-
info(message: string, ...args: unknown[]): void;
|
|
457
|
-
warn(message: string, ...args: unknown[]): void;
|
|
458
|
-
error(message: string, ...args: unknown[]): void;
|
|
459
|
-
critical(message: string, ...args: unknown[]): void;
|
|
460
|
-
/**
|
|
461
|
-
* Escalate a diagnostic message to the telemetry stream, if a sink is attached (no-op otherwise).
|
|
462
|
-
* Unlike the level methods, telemetry is delivered to the backend regardless of the `debug` flag.
|
|
463
|
-
* Optional so an integrator-provided custom logger stays valid without implementing it.
|
|
464
|
-
*/
|
|
465
|
-
reportTelemetry?(level: TelemetryLevel, message: string): void;
|
|
466
|
-
/** Attach (or clear) the telemetry sink. Called once by the tracker after the queue exists. */
|
|
467
|
-
setTelemetrySink?(sink: TelemetrySink | undefined): void;
|
|
468
|
-
}
|
|
469
|
-
interface CreateLoggerOptions {
|
|
470
|
-
debug: boolean;
|
|
471
|
-
}
|
|
472
|
-
declare function createLogger(options: CreateLoggerOptions): Logger;
|
|
473
|
-
|
|
474
|
-
type WindowCaptureContext = Pick<LowEvent, "subflowStartEventId" | "fieldRole" | "initiator"> & {
|
|
475
|
-
sessionId?: string;
|
|
476
|
-
};
|
|
477
|
-
/** One passive observer per tracker. Field/ceremony collectors register context, not DOM listeners. */
|
|
478
|
-
declare class SharedWindowObserver {
|
|
479
|
-
private logger;
|
|
480
|
-
private enqueue;
|
|
481
|
-
private flushKeepalive;
|
|
482
|
-
private inputs;
|
|
483
|
-
private ceremonies;
|
|
484
|
-
private removers;
|
|
485
|
-
private lastBlur?;
|
|
486
|
-
private bracket?;
|
|
487
|
-
private unrelatedPointerAt;
|
|
488
|
-
private destroyed;
|
|
489
|
-
private viewportContext;
|
|
490
|
-
private resize;
|
|
491
|
-
private scroll;
|
|
492
|
-
constructor(logger: Logger, enqueue: (low: LowEvent, sessionId?: string) => void, flushKeepalive: () => void);
|
|
493
|
-
registerInputs(fields: readonly HTMLInputElement[], context: () => WindowCaptureContext, flush: () => void): () => void;
|
|
494
|
-
beginCeremony(context: WindowCaptureContext): {
|
|
495
|
-
settle: (tailMs: number) => void;
|
|
496
|
-
destroy: () => void;
|
|
497
|
-
};
|
|
498
|
-
private context;
|
|
499
|
-
private findInput;
|
|
500
|
-
/** Flush all registered input batches before a high-level lifecycle boundary. */
|
|
501
|
-
flushInputs(): void;
|
|
502
|
-
private emit;
|
|
503
|
-
private listen;
|
|
504
|
-
private extendViewport;
|
|
505
|
-
private observeNavigation;
|
|
506
|
-
destroy(): void;
|
|
507
|
-
}
|
|
508
|
-
|
|
509
460
|
/**
|
|
510
461
|
* Where low events go. `flushKeepalive` is requested on `pagehide` teardown so lows batched after
|
|
511
462
|
* the queue's own lifecycle flush still get out; operations wire it to the client's
|
|
@@ -616,6 +567,28 @@ declare function resolveRawErrorLimits(options?: SerializeRawErrorOptions): Limi
|
|
|
616
567
|
*/
|
|
617
568
|
declare function serializeRawError(value: unknown, options?: SerializeRawErrorOptions): RawErrorEnvelope | undefined;
|
|
618
569
|
|
|
570
|
+
/** Sink that escalates a diagnostic message to the telemetry stream. */
|
|
571
|
+
type TelemetrySink = (level: TelemetryLevel, message: string) => void;
|
|
572
|
+
interface Logger {
|
|
573
|
+
debug(message: string, ...args: unknown[]): void;
|
|
574
|
+
info(message: string, ...args: unknown[]): void;
|
|
575
|
+
warn(message: string, ...args: unknown[]): void;
|
|
576
|
+
error(message: string, ...args: unknown[]): void;
|
|
577
|
+
critical(message: string, ...args: unknown[]): void;
|
|
578
|
+
/**
|
|
579
|
+
* Escalate a diagnostic message to the telemetry stream, if a sink is attached (no-op otherwise).
|
|
580
|
+
* Unlike the level methods, telemetry is delivered to the backend regardless of the `debug` flag.
|
|
581
|
+
* Optional so an integrator-provided custom logger stays valid without implementing it.
|
|
582
|
+
*/
|
|
583
|
+
reportTelemetry?(level: TelemetryLevel, message: string): void;
|
|
584
|
+
/** Attach (or clear) the telemetry sink. Called once by the tracker after the queue exists. */
|
|
585
|
+
setTelemetrySink?(sink: TelemetrySink | undefined): void;
|
|
586
|
+
}
|
|
587
|
+
interface CreateLoggerOptions {
|
|
588
|
+
debug: boolean;
|
|
589
|
+
}
|
|
590
|
+
declare function createLogger(options: CreateLoggerOptions): Logger;
|
|
591
|
+
|
|
619
592
|
/** Ceremony context lease on the shared observer. Never installs its own window listeners. */
|
|
620
593
|
declare class LowEventWindowTracker {
|
|
621
594
|
private logger;
|
|
@@ -733,6 +706,61 @@ declare abstract class OperationFull {
|
|
|
733
706
|
protected defineStep<TStart = {}, TFinished = {}, TTypedError = never>(stepName: string, ignoreAsInteractionOnStart?: boolean): StepHelper<TStart, TFinished, TTypedError>;
|
|
734
707
|
}
|
|
735
708
|
|
|
709
|
+
/** Shared configuration for direct key signing and authority registration. */
|
|
710
|
+
type KeyOperationConfig = {
|
|
711
|
+
/** Reserved for future variants; no spec types are currently defined. */
|
|
712
|
+
explicitSpecType?: undefined;
|
|
713
|
+
};
|
|
714
|
+
declare class KeySigningOperationFull extends OperationFull {
|
|
715
|
+
/** Resolve an eligible key and prepare the input for an actual signing attempt. */
|
|
716
|
+
readonly prepare: StepHelper;
|
|
717
|
+
/** Sign and assemble the usable signed artifact. Does not include submitting it. */
|
|
718
|
+
readonly sign: StepHelper;
|
|
719
|
+
constructor(tracker: CorbadoTracker, config?: KeyOperationConfig);
|
|
720
|
+
}
|
|
721
|
+
declare class KeyRegistrationOperationFull extends OperationFull {
|
|
722
|
+
/** Build the request that will establish the key's authority. */
|
|
723
|
+
readonly prepare: StepHelper;
|
|
724
|
+
/** Submit and await acceptance: finish only when the key is authorized and usable. */
|
|
725
|
+
readonly postResponse: StepHelper;
|
|
726
|
+
constructor(tracker: CorbadoTracker, config?: KeyOperationConfig);
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
type WindowCaptureContext = Pick<LowEvent, "subflowStartEventId" | "fieldRole" | "initiator"> & {
|
|
730
|
+
sessionId?: string;
|
|
731
|
+
};
|
|
732
|
+
/** One passive observer per tracker. Field/ceremony collectors register context, not DOM listeners. */
|
|
733
|
+
declare class SharedWindowObserver {
|
|
734
|
+
private logger;
|
|
735
|
+
private enqueue;
|
|
736
|
+
private flushKeepalive;
|
|
737
|
+
private inputs;
|
|
738
|
+
private ceremonies;
|
|
739
|
+
private removers;
|
|
740
|
+
private lastBlur?;
|
|
741
|
+
private bracket?;
|
|
742
|
+
private unrelatedPointerAt;
|
|
743
|
+
private destroyed;
|
|
744
|
+
private viewportContext;
|
|
745
|
+
private resize;
|
|
746
|
+
private scroll;
|
|
747
|
+
constructor(logger: Logger, enqueue: (low: LowEvent, sessionId?: string) => void, flushKeepalive: () => void);
|
|
748
|
+
registerInputs(fields: readonly HTMLInputElement[], context: () => WindowCaptureContext, flush: () => void): () => void;
|
|
749
|
+
beginCeremony(context: WindowCaptureContext): {
|
|
750
|
+
settle: (tailMs: number) => void;
|
|
751
|
+
destroy: () => void;
|
|
752
|
+
};
|
|
753
|
+
private context;
|
|
754
|
+
private findInput;
|
|
755
|
+
/** Flush all registered input batches before a high-level lifecycle boundary. */
|
|
756
|
+
flushInputs(): void;
|
|
757
|
+
private emit;
|
|
758
|
+
private listen;
|
|
759
|
+
private extendViewport;
|
|
760
|
+
private observeNavigation;
|
|
761
|
+
destroy(): void;
|
|
762
|
+
}
|
|
763
|
+
|
|
736
764
|
type PasskeyOperationLoginExplicitSpecType = "passkey-cui" | "passkey-known-identifier" | "passkey-no-identifier"
|
|
737
765
|
/**
|
|
738
766
|
* The `-auto` variants are the same two ceremonies started by the integration rather than by a
|
|
@@ -1398,6 +1426,9 @@ declare class CorbadoTracker {
|
|
|
1398
1426
|
* checkout login, or account recovery). If users can choose between multiple flows
|
|
1399
1427
|
* (such as login vs signup), pass `flowNames` and optionally `defaultFlowName`.
|
|
1400
1428
|
*
|
|
1429
|
+
* The returned handle can attach identity after completion with `await flow.enrich({ userId })`.
|
|
1430
|
+
* Enrichment requires a backend supporting explicit start-event targeting.
|
|
1431
|
+
*
|
|
1401
1432
|
* @param data - Flow metadata, including one flow (`flowName`) or multiple candidates (`flowNames`).
|
|
1402
1433
|
* @param tags - Optional key-value tags for filtering and segmentation.
|
|
1403
1434
|
* @param experiments - Optional per-call experiment overrides.
|
|
@@ -1413,7 +1444,7 @@ declare class CorbadoTracker {
|
|
|
1413
1444
|
* });
|
|
1414
1445
|
* ```
|
|
1415
1446
|
*/
|
|
1416
|
-
flowStarted(data: FlowStarted | MultiFlowStarted, tags?: Record<string, string>, experiments?: Record<string, string>, contexts?: Record<string, unknown>):
|
|
1447
|
+
flowStarted(data: FlowStarted | MultiFlowStarted, tags?: Record<string, string>, experiments?: Record<string, string>, contexts?: Record<string, unknown>): FlowHandle;
|
|
1417
1448
|
/**
|
|
1418
1449
|
* Track when the user commits to a specific flow.
|
|
1419
1450
|
*
|
|
@@ -1459,8 +1490,8 @@ declare class CorbadoTracker {
|
|
|
1459
1490
|
*
|
|
1460
1491
|
* @remarks
|
|
1461
1492
|
* Fire this when the user has finished the target flow end-to-end, such as completed login,
|
|
1462
|
-
* signup, or recovery. Record identity
|
|
1463
|
-
*
|
|
1493
|
+
* signup, or recovery. Record identity with `setUser()` while the flow is active,
|
|
1494
|
+
* or use the handle returned by `flowStarted()` to enrich it after completion.
|
|
1464
1495
|
*
|
|
1465
1496
|
* Legacy identity fields in `data` remain supported but are deprecated.
|
|
1466
1497
|
*
|
|
@@ -1638,6 +1669,52 @@ declare class CorbadoTracker {
|
|
|
1638
1669
|
provideDataOperationFull(config?: ProvideDataOperationConfig): ProvideDataOperationFull;
|
|
1639
1670
|
socialLoginOperationFull(config?: SocialLoginOperationConfig): SocialLoginOperationFull;
|
|
1640
1671
|
appConfirmationOperationFull(config?: AppConfirmationOperationConfig): AppConfirmationOperationFull;
|
|
1672
|
+
/**
|
|
1673
|
+
* Track direct key signing outside WebAuthn through prepare and sign.
|
|
1674
|
+
*
|
|
1675
|
+
* @param config - Optional configuration; explicitSpecType may only be undefined for now.
|
|
1676
|
+
* @remarks
|
|
1677
|
+
* Start prepare when resolving the eligible key and input for an actual attempt, not background
|
|
1678
|
+
* prefetch. Although system-driven, that work is meaningful interaction for classification.
|
|
1679
|
+
* Construction alone does not establish interaction. Finish sign only when the usable signed
|
|
1680
|
+
* artifact is ready, including assembly. Submission is outside this operation. Report failures
|
|
1681
|
+
* on the affected step using error(error). Never include key material, signatures or proofs.
|
|
1682
|
+
* WebAuthn assertions continue to use passkeyLoginFullOperation.
|
|
1683
|
+
* @example
|
|
1684
|
+
* ```ts
|
|
1685
|
+
* const signing = tracker.keySigningOperationFull();
|
|
1686
|
+
* signing.prepare.start({});
|
|
1687
|
+
* // Resolve an eligible key and prepare the signing input.
|
|
1688
|
+
* signing.prepare.finished({});
|
|
1689
|
+
* signing.sign.start({});
|
|
1690
|
+
* // Sign and assemble the artifact returned to the caller.
|
|
1691
|
+
* signing.sign.finished({});
|
|
1692
|
+
* ```
|
|
1693
|
+
*/
|
|
1694
|
+
keySigningOperationFull(config?: KeyOperationConfig): KeySigningOperationFull;
|
|
1695
|
+
/**
|
|
1696
|
+
* Track establishing a key's authority through prepare and postResponse.
|
|
1697
|
+
*
|
|
1698
|
+
* @param config - Optional configuration; explicitSpecType may only be undefined for now.
|
|
1699
|
+
* @remarks
|
|
1700
|
+
* Start prepare when building an actual registration request, not background prefetch.
|
|
1701
|
+
* This system-driven work is meaningful interaction; construction alone is not.
|
|
1702
|
+
* postResponse covers submission and acceptance. Finish only when the key is authorized and
|
|
1703
|
+
* usable, not merely when submission returns. Report rejection, transport, execution or timeout
|
|
1704
|
+
* errors on the affected step using error(error). Never include key material or proofs.
|
|
1705
|
+
* Credential creation and any authorizing WebAuthn assertion are separate operations.
|
|
1706
|
+
* @example
|
|
1707
|
+
* ```ts
|
|
1708
|
+
* const registration = tracker.keyRegistrationOperationFull();
|
|
1709
|
+
* registration.prepare.start({});
|
|
1710
|
+
* // Build the registration request.
|
|
1711
|
+
* registration.prepare.finished({});
|
|
1712
|
+
* registration.postResponse.start({});
|
|
1713
|
+
* // Submit and await evidence that the authority is usable.
|
|
1714
|
+
* registration.postResponse.finished({});
|
|
1715
|
+
* ```
|
|
1716
|
+
*/
|
|
1717
|
+
keyRegistrationOperationFull(config?: KeyOperationConfig): KeyRegistrationOperationFull;
|
|
1641
1718
|
captchaOperationFull(config?: CaptchaOperationConfig): CaptchaOperationFull;
|
|
1642
1719
|
/**
|
|
1643
1720
|
* Track a device-trust check through getOptions, ceremony and postResponse.
|
|
@@ -2284,4 +2361,4 @@ declare function logInfo(message: string): void;
|
|
|
2284
2361
|
declare function logError(message: string): void;
|
|
2285
2362
|
declare function destroy(): Promise<void>;
|
|
2286
2363
|
|
|
2287
|
-
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 ErrorStepOptions, 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 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 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 };
|
|
2364
|
+
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 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 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 };
|