@corbado/observe 0.1.0-next.24-ba140ad → 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 -40
- package/dist/index.d.ts +50 -40
- 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,11 +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;
|
|
133
|
-
|
|
144
|
+
lows?: LowEvent[];
|
|
145
|
+
meta?: EventBatchMeta;
|
|
134
146
|
}
|
|
135
147
|
type DeviceType = "web" | "app" | "other";
|
|
136
148
|
interface DeviceInfo {
|
|
@@ -276,7 +288,7 @@ type PasswordLoginAutoTrackConfig = {
|
|
|
276
288
|
};
|
|
277
289
|
declare class PasswordLoginOperationFull extends OperationFull {
|
|
278
290
|
readonly postResponse: StepHelper<{}, {}, PasswordLoginTypedError>;
|
|
279
|
-
private
|
|
291
|
+
private lowEventTracker?;
|
|
280
292
|
constructor(tracker: CorbadoTracker, autoTrackConfig?: PasswordLoginAutoTrackConfig);
|
|
281
293
|
destroy(): void;
|
|
282
294
|
}
|
|
@@ -292,7 +304,7 @@ type PasswordEnrollmentAutoTrackConfig = {
|
|
|
292
304
|
};
|
|
293
305
|
declare class PasswordEnrollmentOperationFull extends OperationFull {
|
|
294
306
|
readonly postResponse: StepHelper<{}, {}, PasswordEnrollmentTypedError>;
|
|
295
|
-
private
|
|
307
|
+
private lowEventTracker?;
|
|
296
308
|
constructor(tracker: CorbadoTracker, autoTrackConfig?: PasswordEnrollmentAutoTrackConfig);
|
|
297
309
|
destroy(): void;
|
|
298
310
|
}
|
|
@@ -318,7 +330,7 @@ type PasskeyLoginCUIGetOptionsFinished = {
|
|
|
318
330
|
};
|
|
319
331
|
declare class OperationFullProvideIdentifierWithCUI {
|
|
320
332
|
private tracker;
|
|
321
|
-
private
|
|
333
|
+
private lowEventTracker?;
|
|
322
334
|
readonly cui: {
|
|
323
335
|
trigger: (data: SubflowTrigger, options?: StepOptions) => void;
|
|
324
336
|
getOptions: StepHelper<PasskeyLoginCUIGetOptionsStart, PasskeyLoginCUIGetOptionsFinished>;
|
|
@@ -361,6 +373,7 @@ interface TrackerOptions {
|
|
|
361
373
|
deviceInfoDebounceTime?: number;
|
|
362
374
|
defaultTags?: Record<string, string>;
|
|
363
375
|
applicationId?: string;
|
|
376
|
+
flushInterval?: number;
|
|
364
377
|
}
|
|
365
378
|
/**
|
|
366
379
|
* @remarks
|
|
@@ -394,7 +407,7 @@ declare class CorbadoTracker {
|
|
|
394
407
|
private updateDeviceDebounced;
|
|
395
408
|
trackSubflowStarted(subflowType: SubflowType, data: Record<string, any>, options?: StepOptions): void;
|
|
396
409
|
trackSubflowTrigger(subflowType: SubflowType, data: Record<string, any>, options?: StepOptions): void;
|
|
397
|
-
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;
|
|
398
411
|
trackSubflowStepFinished(subflowType: SubflowType, stepName: string, data: Record<string, any>, options?: StepOptions): void;
|
|
399
412
|
trackSubflowStepError(subflowType: SubflowType, stepName: string, data: Record<string, any>, options?: StepOptions): void;
|
|
400
413
|
trackSubflowFinished(subflowType: SubflowType, data: Record<string, any>, options?: StepOptions): void;
|
|
@@ -480,7 +493,7 @@ declare class CorbadoTracker {
|
|
|
480
493
|
* tracker.flowReset({flowName: "login"});
|
|
481
494
|
* ```
|
|
482
495
|
*/
|
|
483
|
-
flowReset(data: FlowReset, tags?: Record<string, string>): void;
|
|
496
|
+
flowReset(data: FlowReset | MultiFlowReset, tags?: Record<string, string>): void;
|
|
484
497
|
/**
|
|
485
498
|
* Track when a flow is considered finished because another flow finished it implicitly.
|
|
486
499
|
*
|
|
@@ -526,6 +539,23 @@ declare class CorbadoTracker {
|
|
|
526
539
|
authMethodsDecisionFinished(data: AuthMethodDecisionFinished, tags?: Record<string, string>): void;
|
|
527
540
|
authDecisionStarted(data: AuthDecisionStarted): void;
|
|
528
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;
|
|
529
559
|
passkeyLoginFullOperation(): PasskeyLoginOperationFull;
|
|
530
560
|
passkeyEnrollmentFullOperation(): PasskeyEnrollmentOperationFull;
|
|
531
561
|
passwordLoginFullOperation(autoTrackConfig?: PasswordLoginAutoTrackConfig): PasswordLoginOperationFull;
|
|
@@ -579,6 +609,7 @@ declare class RequestQueue {
|
|
|
579
609
|
private readonly sdk;
|
|
580
610
|
private options;
|
|
581
611
|
private queue;
|
|
612
|
+
private lowsQueue;
|
|
582
613
|
private timer;
|
|
583
614
|
private isFlushing;
|
|
584
615
|
private onVisibilityChange;
|
|
@@ -590,6 +621,11 @@ declare class RequestQueue {
|
|
|
590
621
|
* - Any error while enqueueing or scheduling flush (including a synchronous throw from `flush`): log "Failed to enqueue event"
|
|
591
622
|
*/
|
|
592
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;
|
|
593
629
|
/**
|
|
594
630
|
* Error situations:
|
|
595
631
|
* - Queue is empty: return without calling transport.send
|
|
@@ -598,6 +634,11 @@ declare class RequestQueue {
|
|
|
598
634
|
*/
|
|
599
635
|
flush(): Promise<void>;
|
|
600
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;
|
|
601
642
|
private flushSync;
|
|
602
643
|
/**
|
|
603
644
|
* Error situations:
|
|
@@ -686,40 +727,9 @@ declare class SessionStorage implements StorageEngine {
|
|
|
686
727
|
removeItem(key: string): void;
|
|
687
728
|
}
|
|
688
729
|
|
|
689
|
-
interface InputFieldEvent {
|
|
690
|
-
type: "focus" | "blur" | "click" | "pointerdown" | "pointerup" | "keydown" | "keyup" | "beforeinput" | "input" | "change" | "paste" | "compositionstart" | "compositionupdate" | "compositionend";
|
|
691
|
-
timestamp: number;
|
|
692
|
-
charsDelta?: number;
|
|
693
|
-
value?: string;
|
|
694
|
-
key?: string | null;
|
|
695
|
-
inputType?: string | null;
|
|
696
|
-
data?: string | null;
|
|
697
|
-
selectionStart?: number | null;
|
|
698
|
-
selectionEnd?: number | null;
|
|
699
|
-
}
|
|
700
|
-
type InputFieldOsName = "iOS" | "Android" | "Windows" | "macOS" | "Linux" | "ChromeOS" | "other";
|
|
701
|
-
type InputFieldBrowserName = "Chrome" | "Firefox" | "Safari" | "Edge" | "Opera" | "IE" | "other";
|
|
702
|
-
interface InputFieldPatternDevice {
|
|
703
|
-
osName: InputFieldOsName;
|
|
704
|
-
osVersion?: string;
|
|
705
|
-
browserName: InputFieldBrowserName;
|
|
706
|
-
browserVersion?: string;
|
|
707
|
-
authenticator?: string;
|
|
708
|
-
}
|
|
709
|
-
interface InputFieldProcessingContext {
|
|
710
|
-
device: InputFieldPatternDevice;
|
|
711
|
-
cuiCompletedAt?: number;
|
|
712
|
-
}
|
|
713
|
-
interface InputFieldInsight {
|
|
714
|
-
pattern: InputFieldPattern;
|
|
715
|
-
timestamp: number;
|
|
716
|
-
}
|
|
717
|
-
type InputFieldPattern = "cui-start" | "cui-cancel" | "pwm-autofill";
|
|
718
|
-
declare function processInputFieldEvents(events: InputFieldEvent[], context: InputFieldProcessingContext): InputFieldInsight[];
|
|
719
|
-
|
|
720
730
|
declare function init(options: TrackerOptions): CorbadoTracker;
|
|
721
731
|
declare function getTracker(): CorbadoTracker | undefined;
|
|
722
732
|
declare function resetSession(): string | undefined;
|
|
723
733
|
declare function destroy(): Promise<void>;
|
|
724
734
|
|
|
725
|
-
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
|
|
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,11 +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;
|
|
133
|
-
|
|
144
|
+
lows?: LowEvent[];
|
|
145
|
+
meta?: EventBatchMeta;
|
|
134
146
|
}
|
|
135
147
|
type DeviceType = "web" | "app" | "other";
|
|
136
148
|
interface DeviceInfo {
|
|
@@ -276,7 +288,7 @@ type PasswordLoginAutoTrackConfig = {
|
|
|
276
288
|
};
|
|
277
289
|
declare class PasswordLoginOperationFull extends OperationFull {
|
|
278
290
|
readonly postResponse: StepHelper<{}, {}, PasswordLoginTypedError>;
|
|
279
|
-
private
|
|
291
|
+
private lowEventTracker?;
|
|
280
292
|
constructor(tracker: CorbadoTracker, autoTrackConfig?: PasswordLoginAutoTrackConfig);
|
|
281
293
|
destroy(): void;
|
|
282
294
|
}
|
|
@@ -292,7 +304,7 @@ type PasswordEnrollmentAutoTrackConfig = {
|
|
|
292
304
|
};
|
|
293
305
|
declare class PasswordEnrollmentOperationFull extends OperationFull {
|
|
294
306
|
readonly postResponse: StepHelper<{}, {}, PasswordEnrollmentTypedError>;
|
|
295
|
-
private
|
|
307
|
+
private lowEventTracker?;
|
|
296
308
|
constructor(tracker: CorbadoTracker, autoTrackConfig?: PasswordEnrollmentAutoTrackConfig);
|
|
297
309
|
destroy(): void;
|
|
298
310
|
}
|
|
@@ -318,7 +330,7 @@ type PasskeyLoginCUIGetOptionsFinished = {
|
|
|
318
330
|
};
|
|
319
331
|
declare class OperationFullProvideIdentifierWithCUI {
|
|
320
332
|
private tracker;
|
|
321
|
-
private
|
|
333
|
+
private lowEventTracker?;
|
|
322
334
|
readonly cui: {
|
|
323
335
|
trigger: (data: SubflowTrigger, options?: StepOptions) => void;
|
|
324
336
|
getOptions: StepHelper<PasskeyLoginCUIGetOptionsStart, PasskeyLoginCUIGetOptionsFinished>;
|
|
@@ -361,6 +373,7 @@ interface TrackerOptions {
|
|
|
361
373
|
deviceInfoDebounceTime?: number;
|
|
362
374
|
defaultTags?: Record<string, string>;
|
|
363
375
|
applicationId?: string;
|
|
376
|
+
flushInterval?: number;
|
|
364
377
|
}
|
|
365
378
|
/**
|
|
366
379
|
* @remarks
|
|
@@ -394,7 +407,7 @@ declare class CorbadoTracker {
|
|
|
394
407
|
private updateDeviceDebounced;
|
|
395
408
|
trackSubflowStarted(subflowType: SubflowType, data: Record<string, any>, options?: StepOptions): void;
|
|
396
409
|
trackSubflowTrigger(subflowType: SubflowType, data: Record<string, any>, options?: StepOptions): void;
|
|
397
|
-
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;
|
|
398
411
|
trackSubflowStepFinished(subflowType: SubflowType, stepName: string, data: Record<string, any>, options?: StepOptions): void;
|
|
399
412
|
trackSubflowStepError(subflowType: SubflowType, stepName: string, data: Record<string, any>, options?: StepOptions): void;
|
|
400
413
|
trackSubflowFinished(subflowType: SubflowType, data: Record<string, any>, options?: StepOptions): void;
|
|
@@ -480,7 +493,7 @@ declare class CorbadoTracker {
|
|
|
480
493
|
* tracker.flowReset({flowName: "login"});
|
|
481
494
|
* ```
|
|
482
495
|
*/
|
|
483
|
-
flowReset(data: FlowReset, tags?: Record<string, string>): void;
|
|
496
|
+
flowReset(data: FlowReset | MultiFlowReset, tags?: Record<string, string>): void;
|
|
484
497
|
/**
|
|
485
498
|
* Track when a flow is considered finished because another flow finished it implicitly.
|
|
486
499
|
*
|
|
@@ -526,6 +539,23 @@ declare class CorbadoTracker {
|
|
|
526
539
|
authMethodsDecisionFinished(data: AuthMethodDecisionFinished, tags?: Record<string, string>): void;
|
|
527
540
|
authDecisionStarted(data: AuthDecisionStarted): void;
|
|
528
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;
|
|
529
559
|
passkeyLoginFullOperation(): PasskeyLoginOperationFull;
|
|
530
560
|
passkeyEnrollmentFullOperation(): PasskeyEnrollmentOperationFull;
|
|
531
561
|
passwordLoginFullOperation(autoTrackConfig?: PasswordLoginAutoTrackConfig): PasswordLoginOperationFull;
|
|
@@ -579,6 +609,7 @@ declare class RequestQueue {
|
|
|
579
609
|
private readonly sdk;
|
|
580
610
|
private options;
|
|
581
611
|
private queue;
|
|
612
|
+
private lowsQueue;
|
|
582
613
|
private timer;
|
|
583
614
|
private isFlushing;
|
|
584
615
|
private onVisibilityChange;
|
|
@@ -590,6 +621,11 @@ declare class RequestQueue {
|
|
|
590
621
|
* - Any error while enqueueing or scheduling flush (including a synchronous throw from `flush`): log "Failed to enqueue event"
|
|
591
622
|
*/
|
|
592
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;
|
|
593
629
|
/**
|
|
594
630
|
* Error situations:
|
|
595
631
|
* - Queue is empty: return without calling transport.send
|
|
@@ -598,6 +634,11 @@ declare class RequestQueue {
|
|
|
598
634
|
*/
|
|
599
635
|
flush(): Promise<void>;
|
|
600
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;
|
|
601
642
|
private flushSync;
|
|
602
643
|
/**
|
|
603
644
|
* Error situations:
|
|
@@ -686,40 +727,9 @@ declare class SessionStorage implements StorageEngine {
|
|
|
686
727
|
removeItem(key: string): void;
|
|
687
728
|
}
|
|
688
729
|
|
|
689
|
-
interface InputFieldEvent {
|
|
690
|
-
type: "focus" | "blur" | "click" | "pointerdown" | "pointerup" | "keydown" | "keyup" | "beforeinput" | "input" | "change" | "paste" | "compositionstart" | "compositionupdate" | "compositionend";
|
|
691
|
-
timestamp: number;
|
|
692
|
-
charsDelta?: number;
|
|
693
|
-
value?: string;
|
|
694
|
-
key?: string | null;
|
|
695
|
-
inputType?: string | null;
|
|
696
|
-
data?: string | null;
|
|
697
|
-
selectionStart?: number | null;
|
|
698
|
-
selectionEnd?: number | null;
|
|
699
|
-
}
|
|
700
|
-
type InputFieldOsName = "iOS" | "Android" | "Windows" | "macOS" | "Linux" | "ChromeOS" | "other";
|
|
701
|
-
type InputFieldBrowserName = "Chrome" | "Firefox" | "Safari" | "Edge" | "Opera" | "IE" | "other";
|
|
702
|
-
interface InputFieldPatternDevice {
|
|
703
|
-
osName: InputFieldOsName;
|
|
704
|
-
osVersion?: string;
|
|
705
|
-
browserName: InputFieldBrowserName;
|
|
706
|
-
browserVersion?: string;
|
|
707
|
-
authenticator?: string;
|
|
708
|
-
}
|
|
709
|
-
interface InputFieldProcessingContext {
|
|
710
|
-
device: InputFieldPatternDevice;
|
|
711
|
-
cuiCompletedAt?: number;
|
|
712
|
-
}
|
|
713
|
-
interface InputFieldInsight {
|
|
714
|
-
pattern: InputFieldPattern;
|
|
715
|
-
timestamp: number;
|
|
716
|
-
}
|
|
717
|
-
type InputFieldPattern = "cui-start" | "cui-cancel" | "pwm-autofill";
|
|
718
|
-
declare function processInputFieldEvents(events: InputFieldEvent[], context: InputFieldProcessingContext): InputFieldInsight[];
|
|
719
|
-
|
|
720
730
|
declare function init(options: TrackerOptions): CorbadoTracker;
|
|
721
731
|
declare function getTracker(): CorbadoTracker | undefined;
|
|
722
732
|
declare function resetSession(): string | undefined;
|
|
723
733
|
declare function destroy(): Promise<void>;
|
|
724
734
|
|
|
725
|
-
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
|
|
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 };
|