@corbado/observe 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/script.global.js +1 -1
- package/dist/index.d.mts +50 -8
- package/dist/index.d.ts +50 -8
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -5,7 +5,7 @@ interface SdkInfo {
|
|
|
5
5
|
type EventType = "predefined" | "custom" | "error" | "identify";
|
|
6
6
|
type AuthMethodType = "identifier-email" | "passkey-login-known-identifier" | "passkey-login-no-identifier" | "passkey-login-cui" | "passkey-enrollment" | "password-login-known-identifier" | "password-login-with-identifier" | "password-enrollment" | "email-otp-login" | "email-otp-enrollment" | "email-link-login" | "email-link-enrollment" | "social-google" | "social-apple" | "social-facebook" | "social-other" | "reset-flow";
|
|
7
7
|
type SubflowType = "passkey-enrollment" | "passkey-login" | "email-otp" | "email-link" | "social-login" | "sms-otp" | "provide-identifier" | "provide-data" | "password-login" | "password-enrollment" | "totp";
|
|
8
|
-
type FlowType = "login" | "signup" | "recovery" | "enrollment";
|
|
8
|
+
type FlowType = "login" | "signup" | "recovery" | "enrollment" | (string & {});
|
|
9
9
|
type SocialLoginProviderType = "google" | "apple" | "facebook" | "github" | "microsoft" | "other";
|
|
10
10
|
declare enum AuthEventName {
|
|
11
11
|
FlowStarted = "flow_started",
|
|
@@ -64,7 +64,10 @@ type FlowFinished = {
|
|
|
64
64
|
explicitOutcome?: "skipped" | "invisible";
|
|
65
65
|
} & UserReference;
|
|
66
66
|
type FlowReset = {
|
|
67
|
-
flowName
|
|
67
|
+
flowName?: FlowType;
|
|
68
|
+
};
|
|
69
|
+
type MultiFlowReset = {
|
|
70
|
+
flowNames: FlowType[];
|
|
68
71
|
};
|
|
69
72
|
type FlowAutoFinished = {
|
|
70
73
|
flowName: FlowType;
|
|
@@ -126,10 +129,20 @@ interface CustomEvent extends BaseEvent {
|
|
|
126
129
|
data?: Record<string, unknown>;
|
|
127
130
|
}
|
|
128
131
|
type Event = PredefinedEvent | CustomEvent;
|
|
132
|
+
interface LowEvent {
|
|
133
|
+
lowType: string;
|
|
134
|
+
ts: number;
|
|
135
|
+
durationMs?: number;
|
|
136
|
+
}
|
|
137
|
+
interface EventBatchMeta {
|
|
138
|
+
sent: number;
|
|
139
|
+
}
|
|
129
140
|
interface EventBatch {
|
|
130
141
|
sessionId: string;
|
|
131
142
|
events: Event[];
|
|
132
143
|
sdk: SdkInfo;
|
|
144
|
+
lows?: LowEvent[];
|
|
145
|
+
meta?: EventBatchMeta;
|
|
133
146
|
}
|
|
134
147
|
type DeviceType = "web" | "app" | "other";
|
|
135
148
|
interface DeviceInfo {
|
|
@@ -275,7 +288,7 @@ type PasswordLoginAutoTrackConfig = {
|
|
|
275
288
|
};
|
|
276
289
|
declare class PasswordLoginOperationFull extends OperationFull {
|
|
277
290
|
readonly postResponse: StepHelper<{}, {}, PasswordLoginTypedError>;
|
|
278
|
-
private
|
|
291
|
+
private lowEventTracker?;
|
|
279
292
|
constructor(tracker: CorbadoTracker, autoTrackConfig?: PasswordLoginAutoTrackConfig);
|
|
280
293
|
destroy(): void;
|
|
281
294
|
}
|
|
@@ -291,7 +304,7 @@ type PasswordEnrollmentAutoTrackConfig = {
|
|
|
291
304
|
};
|
|
292
305
|
declare class PasswordEnrollmentOperationFull extends OperationFull {
|
|
293
306
|
readonly postResponse: StepHelper<{}, {}, PasswordEnrollmentTypedError>;
|
|
294
|
-
private
|
|
307
|
+
private lowEventTracker?;
|
|
295
308
|
constructor(tracker: CorbadoTracker, autoTrackConfig?: PasswordEnrollmentAutoTrackConfig);
|
|
296
309
|
destroy(): void;
|
|
297
310
|
}
|
|
@@ -317,7 +330,7 @@ type PasskeyLoginCUIGetOptionsFinished = {
|
|
|
317
330
|
};
|
|
318
331
|
declare class OperationFullProvideIdentifierWithCUI {
|
|
319
332
|
private tracker;
|
|
320
|
-
private
|
|
333
|
+
private lowEventTracker?;
|
|
321
334
|
readonly cui: {
|
|
322
335
|
trigger: (data: SubflowTrigger, options?: StepOptions) => void;
|
|
323
336
|
getOptions: StepHelper<PasskeyLoginCUIGetOptionsStart, PasskeyLoginCUIGetOptionsFinished>;
|
|
@@ -360,6 +373,7 @@ interface TrackerOptions {
|
|
|
360
373
|
deviceInfoDebounceTime?: number;
|
|
361
374
|
defaultTags?: Record<string, string>;
|
|
362
375
|
applicationId?: string;
|
|
376
|
+
flushInterval?: number;
|
|
363
377
|
}
|
|
364
378
|
/**
|
|
365
379
|
* @remarks
|
|
@@ -393,7 +407,7 @@ declare class CorbadoTracker {
|
|
|
393
407
|
private updateDeviceDebounced;
|
|
394
408
|
trackSubflowStarted(subflowType: SubflowType, data: Record<string, any>, options?: StepOptions): void;
|
|
395
409
|
trackSubflowTrigger(subflowType: SubflowType, data: Record<string, any>, options?: StepOptions): void;
|
|
396
|
-
trackSubflowStepStarted(subflowType: SubflowType, stepName: string, data: Record<string, any>, options?: StepOptions): void;
|
|
410
|
+
trackSubflowStepStarted(subflowType: SubflowType, stepName: string, data: Record<string, any>, options?: StepOptions, ignoreAsInteraction?: boolean): void;
|
|
397
411
|
trackSubflowStepFinished(subflowType: SubflowType, stepName: string, data: Record<string, any>, options?: StepOptions): void;
|
|
398
412
|
trackSubflowStepError(subflowType: SubflowType, stepName: string, data: Record<string, any>, options?: StepOptions): void;
|
|
399
413
|
trackSubflowFinished(subflowType: SubflowType, data: Record<string, any>, options?: StepOptions): void;
|
|
@@ -479,7 +493,7 @@ declare class CorbadoTracker {
|
|
|
479
493
|
* tracker.flowReset({flowName: "login"});
|
|
480
494
|
* ```
|
|
481
495
|
*/
|
|
482
|
-
flowReset(data: FlowReset, tags?: Record<string, string>): void;
|
|
496
|
+
flowReset(data: FlowReset | MultiFlowReset, tags?: Record<string, string>): void;
|
|
483
497
|
/**
|
|
484
498
|
* Track when a flow is considered finished because another flow finished it implicitly.
|
|
485
499
|
*
|
|
@@ -525,6 +539,23 @@ declare class CorbadoTracker {
|
|
|
525
539
|
authMethodsDecisionFinished(data: AuthMethodDecisionFinished, tags?: Record<string, string>): void;
|
|
526
540
|
authDecisionStarted(data: AuthDecisionStarted): void;
|
|
527
541
|
authDecisionFinished(data: AuthDecisionFinished): void;
|
|
542
|
+
/**
|
|
543
|
+
* Enqueue a "low" event (granular DOM/window/visualviewport/PWM signal) for the current session.
|
|
544
|
+
*
|
|
545
|
+
* @remarks
|
|
546
|
+
* Low events are sent in the `lows` array of the events endpoint payload, alongside any
|
|
547
|
+
* pending typed events. Blocked user agents are skipped silently.
|
|
548
|
+
*
|
|
549
|
+
* @internal
|
|
550
|
+
*/
|
|
551
|
+
enqueueLowEvent(low: LowEvent): void;
|
|
552
|
+
/**
|
|
553
|
+
* Synchronously flush any pending events and low events via beacon. Use during page-unload
|
|
554
|
+
* style teardown where async flushing is unreliable.
|
|
555
|
+
*
|
|
556
|
+
* @internal
|
|
557
|
+
*/
|
|
558
|
+
flushKeepalive(): void;
|
|
528
559
|
passkeyLoginFullOperation(): PasskeyLoginOperationFull;
|
|
529
560
|
passkeyEnrollmentFullOperation(): PasskeyEnrollmentOperationFull;
|
|
530
561
|
passwordLoginFullOperation(autoTrackConfig?: PasswordLoginAutoTrackConfig): PasswordLoginOperationFull;
|
|
@@ -578,6 +609,7 @@ declare class RequestQueue {
|
|
|
578
609
|
private readonly sdk;
|
|
579
610
|
private options;
|
|
580
611
|
private queue;
|
|
612
|
+
private lowsQueue;
|
|
581
613
|
private timer;
|
|
582
614
|
private isFlushing;
|
|
583
615
|
private onVisibilityChange;
|
|
@@ -589,6 +621,11 @@ declare class RequestQueue {
|
|
|
589
621
|
* - Any error while enqueueing or scheduling flush (including a synchronous throw from `flush`): log "Failed to enqueue event"
|
|
590
622
|
*/
|
|
591
623
|
enqueue(event: Event): void;
|
|
624
|
+
/**
|
|
625
|
+
* Error situations:
|
|
626
|
+
* - Any error while enqueueing or scheduling flush (including a synchronous throw from `flush`): log "Failed to enqueue low event"
|
|
627
|
+
*/
|
|
628
|
+
enqueueLow(low: LowEvent): void;
|
|
592
629
|
/**
|
|
593
630
|
* Error situations:
|
|
594
631
|
* - Queue is empty: return without calling transport.send
|
|
@@ -597,6 +634,11 @@ declare class RequestQueue {
|
|
|
597
634
|
*/
|
|
598
635
|
flush(): Promise<void>;
|
|
599
636
|
private setupLifecycleHooks;
|
|
637
|
+
/**
|
|
638
|
+
* Synchronously flush both events and lows via `sendBeacon` if the transport supports it.
|
|
639
|
+
* Safe to call multiple times: a no-op when both queues are empty.
|
|
640
|
+
*/
|
|
641
|
+
flushKeepalive(): void;
|
|
600
642
|
private flushSync;
|
|
601
643
|
/**
|
|
602
644
|
* Error situations:
|
|
@@ -690,4 +732,4 @@ declare function getTracker(): CorbadoTracker | undefined;
|
|
|
690
732
|
declare function resetSession(): string | undefined;
|
|
691
733
|
declare function destroy(): Promise<void>;
|
|
692
734
|
|
|
693
|
-
export { type AuthDecisionFinished, type AuthDecisionStarted, AuthEventName, type AuthMethodDecisionFinished, type AuthMethodDecisionStarted, type AuthMethodType, type BaseEvent, type ClientCapabilities, type ClientEnvHandleMeta, type ClientEnvHandleMetaSource, CookieStorage, CorbadoTracker, type CreateLoggerOptions, type CustomEvent, type DeviceInfo, type DeviceInfoDataWeb, type DeviceType, EmailLinkOperationFull, type EmailLinkOperationPostResponseStart, type EmailLinkOperationSendStart, type EmailLinkOperationSpecType, type EmailOTPOperationPostResponseStart, type EmailOTPOperationSendOTPStart, type EmailOTPOperationSpecType, EmailOtpOperationFull, type Event, type EventBatch, type EventType, type FlowAutoFinished, type FlowDecided, type FlowFinished, type FlowReset, type FlowStarted, type FlowType, type JavaScriptHighEntropy, LocalStorage, type Logger, type MultiFlowStarted, type NormalizedError, OperationFull, OperationFullProvideIdentifierWithCUI, type PasskeyEnrollmentCeremonyFinished, type PasskeyEnrollmentCeremonyStart, type PasskeyEnrollmentGetOptionsFinished, type PasskeyEnrollmentGetOptionsStart, PasskeyEnrollmentOperationFull, type PasskeyLoginCUIGetOptionsFinished, type PasskeyLoginCUIGetOptionsStart, type PasskeyLoginCUISpecType, type PasskeyLoginCeremonyFinished, type PasskeyLoginCeremonyStart, type PasskeyLoginClientError, type PasskeyLoginFinish, type PasskeyLoginGetOptionsFinished, type PasskeyLoginGetOptionsStart, PasskeyLoginOperationFull, type PasskeyLoginStartable, type PasskeyLoginSubmitted, type PasskeyOperationEnrollmentExplicitSpecType, type PasskeyOperationLoginExplicitSpecType, type PasswordEnrollmentAutoTrackConfig, PasswordEnrollmentOperationFull, type PasswordEnrollmentTypedError, type PasswordLoginAutoTrackConfig, PasswordLoginOperationFull, type PasswordLoginTypedError, type PredefinedEvent, type ProvideIdentifierError, type ProvideIdentifierFinish, type ProvideIdentifierPostResponseStart, type ProvideIdentifierSpecType, type ProvideIdentifierStart, type QueueOptions, RequestQueue, SDK_NAME, SDK_VERSION, type SdkInfo, SessionStorage, type SocialLoginExchangeCodeFinished, type SocialLoginExchangeCodeStart, type SocialLoginGetRedirectUrlFinished, type SocialLoginGetRedirectUrlStart, SocialLoginOperationFull, type SocialLoginProviderType, type SocialLoginSpecType, type StepHelper, type StepOptions, type StorageEngine, type SubflowTrigger, type SubflowType, type TrackerOptions, type Transport, type TransportMakeRequestResponse, type TransportOptions, type UserReference, createLogger, destroy, getTracker, init, resetSession };
|
|
735
|
+
export { type AuthDecisionFinished, type AuthDecisionStarted, AuthEventName, type AuthMethodDecisionFinished, type AuthMethodDecisionStarted, type AuthMethodType, type BaseEvent, type ClientCapabilities, type ClientEnvHandleMeta, type ClientEnvHandleMetaSource, CookieStorage, CorbadoTracker, type CreateLoggerOptions, type CustomEvent, type DeviceInfo, type DeviceInfoDataWeb, type DeviceType, EmailLinkOperationFull, type EmailLinkOperationPostResponseStart, type EmailLinkOperationSendStart, type EmailLinkOperationSpecType, type EmailOTPOperationPostResponseStart, type EmailOTPOperationSendOTPStart, type EmailOTPOperationSpecType, EmailOtpOperationFull, type Event, type EventBatch, type EventBatchMeta, type EventType, type FlowAutoFinished, type FlowDecided, type FlowFinished, type FlowReset, type FlowStarted, type FlowType, type JavaScriptHighEntropy, LocalStorage, type Logger, type LowEvent, type MultiFlowReset, type MultiFlowStarted, type NormalizedError, OperationFull, OperationFullProvideIdentifierWithCUI, type PasskeyEnrollmentCeremonyFinished, type PasskeyEnrollmentCeremonyStart, type PasskeyEnrollmentGetOptionsFinished, type PasskeyEnrollmentGetOptionsStart, PasskeyEnrollmentOperationFull, type PasskeyLoginCUIGetOptionsFinished, type PasskeyLoginCUIGetOptionsStart, type PasskeyLoginCUISpecType, type PasskeyLoginCeremonyFinished, type PasskeyLoginCeremonyStart, type PasskeyLoginClientError, type PasskeyLoginFinish, type PasskeyLoginGetOptionsFinished, type PasskeyLoginGetOptionsStart, PasskeyLoginOperationFull, type PasskeyLoginStartable, type PasskeyLoginSubmitted, type PasskeyOperationEnrollmentExplicitSpecType, type PasskeyOperationLoginExplicitSpecType, type PasswordEnrollmentAutoTrackConfig, PasswordEnrollmentOperationFull, type PasswordEnrollmentTypedError, type PasswordLoginAutoTrackConfig, PasswordLoginOperationFull, type PasswordLoginTypedError, type PredefinedEvent, type ProvideIdentifierError, type ProvideIdentifierFinish, type ProvideIdentifierPostResponseStart, type ProvideIdentifierSpecType, type ProvideIdentifierStart, type QueueOptions, RequestQueue, SDK_NAME, SDK_VERSION, type SdkInfo, SessionStorage, type SocialLoginExchangeCodeFinished, type SocialLoginExchangeCodeStart, type SocialLoginGetRedirectUrlFinished, type SocialLoginGetRedirectUrlStart, SocialLoginOperationFull, type SocialLoginProviderType, type SocialLoginSpecType, type StepHelper, type StepOptions, type StorageEngine, type SubflowTrigger, type SubflowType, type TrackerOptions, type Transport, type TransportMakeRequestResponse, type TransportOptions, type UserReference, createLogger, destroy, getTracker, init, resetSession };
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ interface SdkInfo {
|
|
|
5
5
|
type EventType = "predefined" | "custom" | "error" | "identify";
|
|
6
6
|
type AuthMethodType = "identifier-email" | "passkey-login-known-identifier" | "passkey-login-no-identifier" | "passkey-login-cui" | "passkey-enrollment" | "password-login-known-identifier" | "password-login-with-identifier" | "password-enrollment" | "email-otp-login" | "email-otp-enrollment" | "email-link-login" | "email-link-enrollment" | "social-google" | "social-apple" | "social-facebook" | "social-other" | "reset-flow";
|
|
7
7
|
type SubflowType = "passkey-enrollment" | "passkey-login" | "email-otp" | "email-link" | "social-login" | "sms-otp" | "provide-identifier" | "provide-data" | "password-login" | "password-enrollment" | "totp";
|
|
8
|
-
type FlowType = "login" | "signup" | "recovery" | "enrollment";
|
|
8
|
+
type FlowType = "login" | "signup" | "recovery" | "enrollment" | (string & {});
|
|
9
9
|
type SocialLoginProviderType = "google" | "apple" | "facebook" | "github" | "microsoft" | "other";
|
|
10
10
|
declare enum AuthEventName {
|
|
11
11
|
FlowStarted = "flow_started",
|
|
@@ -64,7 +64,10 @@ type FlowFinished = {
|
|
|
64
64
|
explicitOutcome?: "skipped" | "invisible";
|
|
65
65
|
} & UserReference;
|
|
66
66
|
type FlowReset = {
|
|
67
|
-
flowName
|
|
67
|
+
flowName?: FlowType;
|
|
68
|
+
};
|
|
69
|
+
type MultiFlowReset = {
|
|
70
|
+
flowNames: FlowType[];
|
|
68
71
|
};
|
|
69
72
|
type FlowAutoFinished = {
|
|
70
73
|
flowName: FlowType;
|
|
@@ -126,10 +129,20 @@ interface CustomEvent extends BaseEvent {
|
|
|
126
129
|
data?: Record<string, unknown>;
|
|
127
130
|
}
|
|
128
131
|
type Event = PredefinedEvent | CustomEvent;
|
|
132
|
+
interface LowEvent {
|
|
133
|
+
lowType: string;
|
|
134
|
+
ts: number;
|
|
135
|
+
durationMs?: number;
|
|
136
|
+
}
|
|
137
|
+
interface EventBatchMeta {
|
|
138
|
+
sent: number;
|
|
139
|
+
}
|
|
129
140
|
interface EventBatch {
|
|
130
141
|
sessionId: string;
|
|
131
142
|
events: Event[];
|
|
132
143
|
sdk: SdkInfo;
|
|
144
|
+
lows?: LowEvent[];
|
|
145
|
+
meta?: EventBatchMeta;
|
|
133
146
|
}
|
|
134
147
|
type DeviceType = "web" | "app" | "other";
|
|
135
148
|
interface DeviceInfo {
|
|
@@ -275,7 +288,7 @@ type PasswordLoginAutoTrackConfig = {
|
|
|
275
288
|
};
|
|
276
289
|
declare class PasswordLoginOperationFull extends OperationFull {
|
|
277
290
|
readonly postResponse: StepHelper<{}, {}, PasswordLoginTypedError>;
|
|
278
|
-
private
|
|
291
|
+
private lowEventTracker?;
|
|
279
292
|
constructor(tracker: CorbadoTracker, autoTrackConfig?: PasswordLoginAutoTrackConfig);
|
|
280
293
|
destroy(): void;
|
|
281
294
|
}
|
|
@@ -291,7 +304,7 @@ type PasswordEnrollmentAutoTrackConfig = {
|
|
|
291
304
|
};
|
|
292
305
|
declare class PasswordEnrollmentOperationFull extends OperationFull {
|
|
293
306
|
readonly postResponse: StepHelper<{}, {}, PasswordEnrollmentTypedError>;
|
|
294
|
-
private
|
|
307
|
+
private lowEventTracker?;
|
|
295
308
|
constructor(tracker: CorbadoTracker, autoTrackConfig?: PasswordEnrollmentAutoTrackConfig);
|
|
296
309
|
destroy(): void;
|
|
297
310
|
}
|
|
@@ -317,7 +330,7 @@ type PasskeyLoginCUIGetOptionsFinished = {
|
|
|
317
330
|
};
|
|
318
331
|
declare class OperationFullProvideIdentifierWithCUI {
|
|
319
332
|
private tracker;
|
|
320
|
-
private
|
|
333
|
+
private lowEventTracker?;
|
|
321
334
|
readonly cui: {
|
|
322
335
|
trigger: (data: SubflowTrigger, options?: StepOptions) => void;
|
|
323
336
|
getOptions: StepHelper<PasskeyLoginCUIGetOptionsStart, PasskeyLoginCUIGetOptionsFinished>;
|
|
@@ -360,6 +373,7 @@ interface TrackerOptions {
|
|
|
360
373
|
deviceInfoDebounceTime?: number;
|
|
361
374
|
defaultTags?: Record<string, string>;
|
|
362
375
|
applicationId?: string;
|
|
376
|
+
flushInterval?: number;
|
|
363
377
|
}
|
|
364
378
|
/**
|
|
365
379
|
* @remarks
|
|
@@ -393,7 +407,7 @@ declare class CorbadoTracker {
|
|
|
393
407
|
private updateDeviceDebounced;
|
|
394
408
|
trackSubflowStarted(subflowType: SubflowType, data: Record<string, any>, options?: StepOptions): void;
|
|
395
409
|
trackSubflowTrigger(subflowType: SubflowType, data: Record<string, any>, options?: StepOptions): void;
|
|
396
|
-
trackSubflowStepStarted(subflowType: SubflowType, stepName: string, data: Record<string, any>, options?: StepOptions): void;
|
|
410
|
+
trackSubflowStepStarted(subflowType: SubflowType, stepName: string, data: Record<string, any>, options?: StepOptions, ignoreAsInteraction?: boolean): void;
|
|
397
411
|
trackSubflowStepFinished(subflowType: SubflowType, stepName: string, data: Record<string, any>, options?: StepOptions): void;
|
|
398
412
|
trackSubflowStepError(subflowType: SubflowType, stepName: string, data: Record<string, any>, options?: StepOptions): void;
|
|
399
413
|
trackSubflowFinished(subflowType: SubflowType, data: Record<string, any>, options?: StepOptions): void;
|
|
@@ -479,7 +493,7 @@ declare class CorbadoTracker {
|
|
|
479
493
|
* tracker.flowReset({flowName: "login"});
|
|
480
494
|
* ```
|
|
481
495
|
*/
|
|
482
|
-
flowReset(data: FlowReset, tags?: Record<string, string>): void;
|
|
496
|
+
flowReset(data: FlowReset | MultiFlowReset, tags?: Record<string, string>): void;
|
|
483
497
|
/**
|
|
484
498
|
* Track when a flow is considered finished because another flow finished it implicitly.
|
|
485
499
|
*
|
|
@@ -525,6 +539,23 @@ declare class CorbadoTracker {
|
|
|
525
539
|
authMethodsDecisionFinished(data: AuthMethodDecisionFinished, tags?: Record<string, string>): void;
|
|
526
540
|
authDecisionStarted(data: AuthDecisionStarted): void;
|
|
527
541
|
authDecisionFinished(data: AuthDecisionFinished): void;
|
|
542
|
+
/**
|
|
543
|
+
* Enqueue a "low" event (granular DOM/window/visualviewport/PWM signal) for the current session.
|
|
544
|
+
*
|
|
545
|
+
* @remarks
|
|
546
|
+
* Low events are sent in the `lows` array of the events endpoint payload, alongside any
|
|
547
|
+
* pending typed events. Blocked user agents are skipped silently.
|
|
548
|
+
*
|
|
549
|
+
* @internal
|
|
550
|
+
*/
|
|
551
|
+
enqueueLowEvent(low: LowEvent): void;
|
|
552
|
+
/**
|
|
553
|
+
* Synchronously flush any pending events and low events via beacon. Use during page-unload
|
|
554
|
+
* style teardown where async flushing is unreliable.
|
|
555
|
+
*
|
|
556
|
+
* @internal
|
|
557
|
+
*/
|
|
558
|
+
flushKeepalive(): void;
|
|
528
559
|
passkeyLoginFullOperation(): PasskeyLoginOperationFull;
|
|
529
560
|
passkeyEnrollmentFullOperation(): PasskeyEnrollmentOperationFull;
|
|
530
561
|
passwordLoginFullOperation(autoTrackConfig?: PasswordLoginAutoTrackConfig): PasswordLoginOperationFull;
|
|
@@ -578,6 +609,7 @@ declare class RequestQueue {
|
|
|
578
609
|
private readonly sdk;
|
|
579
610
|
private options;
|
|
580
611
|
private queue;
|
|
612
|
+
private lowsQueue;
|
|
581
613
|
private timer;
|
|
582
614
|
private isFlushing;
|
|
583
615
|
private onVisibilityChange;
|
|
@@ -589,6 +621,11 @@ declare class RequestQueue {
|
|
|
589
621
|
* - Any error while enqueueing or scheduling flush (including a synchronous throw from `flush`): log "Failed to enqueue event"
|
|
590
622
|
*/
|
|
591
623
|
enqueue(event: Event): void;
|
|
624
|
+
/**
|
|
625
|
+
* Error situations:
|
|
626
|
+
* - Any error while enqueueing or scheduling flush (including a synchronous throw from `flush`): log "Failed to enqueue low event"
|
|
627
|
+
*/
|
|
628
|
+
enqueueLow(low: LowEvent): void;
|
|
592
629
|
/**
|
|
593
630
|
* Error situations:
|
|
594
631
|
* - Queue is empty: return without calling transport.send
|
|
@@ -597,6 +634,11 @@ declare class RequestQueue {
|
|
|
597
634
|
*/
|
|
598
635
|
flush(): Promise<void>;
|
|
599
636
|
private setupLifecycleHooks;
|
|
637
|
+
/**
|
|
638
|
+
* Synchronously flush both events and lows via `sendBeacon` if the transport supports it.
|
|
639
|
+
* Safe to call multiple times: a no-op when both queues are empty.
|
|
640
|
+
*/
|
|
641
|
+
flushKeepalive(): void;
|
|
600
642
|
private flushSync;
|
|
601
643
|
/**
|
|
602
644
|
* Error situations:
|
|
@@ -690,4 +732,4 @@ declare function getTracker(): CorbadoTracker | undefined;
|
|
|
690
732
|
declare function resetSession(): string | undefined;
|
|
691
733
|
declare function destroy(): Promise<void>;
|
|
692
734
|
|
|
693
|
-
export { type AuthDecisionFinished, type AuthDecisionStarted, AuthEventName, type AuthMethodDecisionFinished, type AuthMethodDecisionStarted, type AuthMethodType, type BaseEvent, type ClientCapabilities, type ClientEnvHandleMeta, type ClientEnvHandleMetaSource, CookieStorage, CorbadoTracker, type CreateLoggerOptions, type CustomEvent, type DeviceInfo, type DeviceInfoDataWeb, type DeviceType, EmailLinkOperationFull, type EmailLinkOperationPostResponseStart, type EmailLinkOperationSendStart, type EmailLinkOperationSpecType, type EmailOTPOperationPostResponseStart, type EmailOTPOperationSendOTPStart, type EmailOTPOperationSpecType, EmailOtpOperationFull, type Event, type EventBatch, type EventType, type FlowAutoFinished, type FlowDecided, type FlowFinished, type FlowReset, type FlowStarted, type FlowType, type JavaScriptHighEntropy, LocalStorage, type Logger, type MultiFlowStarted, type NormalizedError, OperationFull, OperationFullProvideIdentifierWithCUI, type PasskeyEnrollmentCeremonyFinished, type PasskeyEnrollmentCeremonyStart, type PasskeyEnrollmentGetOptionsFinished, type PasskeyEnrollmentGetOptionsStart, PasskeyEnrollmentOperationFull, type PasskeyLoginCUIGetOptionsFinished, type PasskeyLoginCUIGetOptionsStart, type PasskeyLoginCUISpecType, type PasskeyLoginCeremonyFinished, type PasskeyLoginCeremonyStart, type PasskeyLoginClientError, type PasskeyLoginFinish, type PasskeyLoginGetOptionsFinished, type PasskeyLoginGetOptionsStart, PasskeyLoginOperationFull, type PasskeyLoginStartable, type PasskeyLoginSubmitted, type PasskeyOperationEnrollmentExplicitSpecType, type PasskeyOperationLoginExplicitSpecType, type PasswordEnrollmentAutoTrackConfig, PasswordEnrollmentOperationFull, type PasswordEnrollmentTypedError, type PasswordLoginAutoTrackConfig, PasswordLoginOperationFull, type PasswordLoginTypedError, type PredefinedEvent, type ProvideIdentifierError, type ProvideIdentifierFinish, type ProvideIdentifierPostResponseStart, type ProvideIdentifierSpecType, type ProvideIdentifierStart, type QueueOptions, RequestQueue, SDK_NAME, SDK_VERSION, type SdkInfo, SessionStorage, type SocialLoginExchangeCodeFinished, type SocialLoginExchangeCodeStart, type SocialLoginGetRedirectUrlFinished, type SocialLoginGetRedirectUrlStart, SocialLoginOperationFull, type SocialLoginProviderType, type SocialLoginSpecType, type StepHelper, type StepOptions, type StorageEngine, type SubflowTrigger, type SubflowType, type TrackerOptions, type Transport, type TransportMakeRequestResponse, type TransportOptions, type UserReference, createLogger, destroy, getTracker, init, resetSession };
|
|
735
|
+
export { type AuthDecisionFinished, type AuthDecisionStarted, AuthEventName, type AuthMethodDecisionFinished, type AuthMethodDecisionStarted, type AuthMethodType, type BaseEvent, type ClientCapabilities, type ClientEnvHandleMeta, type ClientEnvHandleMetaSource, CookieStorage, CorbadoTracker, type CreateLoggerOptions, type CustomEvent, type DeviceInfo, type DeviceInfoDataWeb, type DeviceType, EmailLinkOperationFull, type EmailLinkOperationPostResponseStart, type EmailLinkOperationSendStart, type EmailLinkOperationSpecType, type EmailOTPOperationPostResponseStart, type EmailOTPOperationSendOTPStart, type EmailOTPOperationSpecType, EmailOtpOperationFull, type Event, type EventBatch, type EventBatchMeta, type EventType, type FlowAutoFinished, type FlowDecided, type FlowFinished, type FlowReset, type FlowStarted, type FlowType, type JavaScriptHighEntropy, LocalStorage, type Logger, type LowEvent, type MultiFlowReset, type MultiFlowStarted, type NormalizedError, OperationFull, OperationFullProvideIdentifierWithCUI, type PasskeyEnrollmentCeremonyFinished, type PasskeyEnrollmentCeremonyStart, type PasskeyEnrollmentGetOptionsFinished, type PasskeyEnrollmentGetOptionsStart, PasskeyEnrollmentOperationFull, type PasskeyLoginCUIGetOptionsFinished, type PasskeyLoginCUIGetOptionsStart, type PasskeyLoginCUISpecType, type PasskeyLoginCeremonyFinished, type PasskeyLoginCeremonyStart, type PasskeyLoginClientError, type PasskeyLoginFinish, type PasskeyLoginGetOptionsFinished, type PasskeyLoginGetOptionsStart, PasskeyLoginOperationFull, type PasskeyLoginStartable, type PasskeyLoginSubmitted, type PasskeyOperationEnrollmentExplicitSpecType, type PasskeyOperationLoginExplicitSpecType, type PasswordEnrollmentAutoTrackConfig, PasswordEnrollmentOperationFull, type PasswordEnrollmentTypedError, type PasswordLoginAutoTrackConfig, PasswordLoginOperationFull, type PasswordLoginTypedError, type PredefinedEvent, type ProvideIdentifierError, type ProvideIdentifierFinish, type ProvideIdentifierPostResponseStart, type ProvideIdentifierSpecType, type ProvideIdentifierStart, type QueueOptions, RequestQueue, SDK_NAME, SDK_VERSION, type SdkInfo, SessionStorage, type SocialLoginExchangeCodeFinished, type SocialLoginExchangeCodeStart, type SocialLoginGetRedirectUrlFinished, type SocialLoginGetRedirectUrlStart, SocialLoginOperationFull, type SocialLoginProviderType, type SocialLoginSpecType, type StepHelper, type StepOptions, type StorageEngine, type SubflowTrigger, type SubflowType, type TrackerOptions, type Transport, type TransportMakeRequestResponse, type TransportOptions, type UserReference, createLogger, destroy, getTracker, init, resetSession };
|