posthog-js-lite 3.0.0-beta.1 → 3.0.0-beta.2
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/CHANGELOG.md +6 -0
- package/lib/index.cjs.js +87 -73
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.d.ts +14 -5
- package/lib/index.esm.js +87 -73
- package/lib/index.esm.js.map +1 -1
- package/lib/posthog-core/src/index.d.ts +12 -5
- package/lib/posthog-core/src/types.d.ts +2 -0
- package/package.json +1 -1
|
@@ -7,7 +7,9 @@ export declare abstract class PostHogCoreStateless {
|
|
|
7
7
|
private apiKey;
|
|
8
8
|
host: string;
|
|
9
9
|
private flushAt;
|
|
10
|
+
private maxBatchSize;
|
|
10
11
|
private flushInterval;
|
|
12
|
+
private flushPromise;
|
|
11
13
|
private requestTimeout;
|
|
12
14
|
private featureFlagsRequestTimeoutMs;
|
|
13
15
|
private captureMode;
|
|
@@ -37,7 +39,7 @@ export declare abstract class PostHogCoreStateless {
|
|
|
37
39
|
debug(enabled?: boolean): void;
|
|
38
40
|
get isDebug(): boolean;
|
|
39
41
|
private buildPayload;
|
|
40
|
-
protected addPendingPromise(promise: Promise<
|
|
42
|
+
protected addPendingPromise<T>(promise: Promise<T>): Promise<T>;
|
|
41
43
|
/***
|
|
42
44
|
*** TRACKING
|
|
43
45
|
***/
|
|
@@ -69,11 +71,16 @@ export declare abstract class PostHogCoreStateless {
|
|
|
69
71
|
*** QUEUEING AND FLUSHING
|
|
70
72
|
***/
|
|
71
73
|
protected enqueue(type: string, _message: any, options?: PostHogCaptureOptions): void;
|
|
72
|
-
|
|
73
|
-
|
|
74
|
+
private clearFlushTimer;
|
|
75
|
+
/**
|
|
76
|
+
* Helper for flushing the queue in the background
|
|
77
|
+
* Avoids unnecessary promise errors
|
|
78
|
+
*/
|
|
79
|
+
private flushBackground;
|
|
80
|
+
flush(): Promise<any[]>;
|
|
81
|
+
private _flush;
|
|
74
82
|
private fetchWithRetry;
|
|
75
|
-
|
|
76
|
-
shutdown(shutdownTimeoutMs?: number): void;
|
|
83
|
+
shutdown(shutdownTimeoutMs?: number): Promise<void>;
|
|
77
84
|
}
|
|
78
85
|
export declare abstract class PostHogCore extends PostHogCoreStateless {
|
|
79
86
|
private sendFeatureFlagEvent;
|
|
@@ -5,6 +5,8 @@ export declare type PostHogCoreOptions = {
|
|
|
5
5
|
flushAt?: number;
|
|
6
6
|
/** The interval in milliseconds between periodic flushes */
|
|
7
7
|
flushInterval?: number;
|
|
8
|
+
/** The maximum number of queued messages to be flushed as part of a single batch (must be higher than `flushAt`) */
|
|
9
|
+
maxBatchSize?: number;
|
|
8
10
|
/** If set to true the SDK is essentially disabled (useful for local environments where you don't want to track anything) */
|
|
9
11
|
disabled?: boolean;
|
|
10
12
|
/** If set to false the SDK will not track until the `optIn` function is called. */
|