@brainfish-ai/web-tracker 0.0.11 → 0.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +13 -13
- package/dist/index.cjs.js.gz +0 -0
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +979 -937
- package/dist/index.js.gz +0 -0
- package/dist/index.js.map +1 -1
- package/dist/src/index.d.ts +2 -0
- package/dist/src/record/index.d.ts +11 -1
- package/dist/src/record/recordingManager.d.ts +1 -0
- package/dist/src/session/sessionManager.d.ts +7 -6
- package/package.json +1 -1
package/dist/src/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export type TrackerOptions = TrackerSdkOptions & {
|
|
|
8
8
|
enableRecording?: boolean;
|
|
9
9
|
recordingBlocklist?: string[];
|
|
10
10
|
_allowLocalhostRecording?: boolean;
|
|
11
|
+
_allowScreenRecording?: boolean;
|
|
11
12
|
};
|
|
12
13
|
export declare const VERSION: string;
|
|
13
14
|
export declare class Tracker extends TrackerSdk {
|
|
@@ -32,4 +33,5 @@ export declare class Tracker extends TrackerSdk {
|
|
|
32
33
|
* @returns Promise that resolves when events are recorded and session is managed
|
|
33
34
|
*/
|
|
34
35
|
private recordEventsToServer;
|
|
36
|
+
private sendScreenViewEvent;
|
|
35
37
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { default as Sender } from './sender';
|
|
2
2
|
import { default as RecordingManager } from './recordingManager';
|
|
3
3
|
import { default as Timer } from './timer';
|
|
4
|
+
import { default as SessionManager } from '../session/sessionManager';
|
|
4
5
|
export default class Agent {
|
|
5
6
|
recordingManager: RecordingManager;
|
|
6
7
|
sender: Sender;
|
|
@@ -8,16 +9,25 @@ export default class Agent {
|
|
|
8
9
|
MAX_IDLE_TIME: any;
|
|
9
10
|
timer: Timer | undefined;
|
|
10
11
|
sendEvents: ((events: any[]) => Promise<void>) | undefined;
|
|
12
|
+
sendScreenViewEvent: ((props: any) => void) | undefined;
|
|
11
13
|
recordingBlocklist: string[];
|
|
12
14
|
_allowLocalhostRecording?: boolean;
|
|
15
|
+
_allowScreenRecording?: boolean;
|
|
16
|
+
private sessionCreationPromise;
|
|
17
|
+
private static _sessionManager;
|
|
18
|
+
get sessionManager(): SessionManager;
|
|
13
19
|
constructor();
|
|
14
|
-
start({ endpoint, sendEvents, recordingBlocklist, _allowLocalhostRecording, }: {
|
|
20
|
+
start({ endpoint, sendEvents, sendScreenViewEvent, recordingBlocklist, _allowLocalhostRecording, _allowScreenRecording, }: {
|
|
15
21
|
endpoint: string;
|
|
16
22
|
sendEvents: (events: any[]) => Promise<void>;
|
|
23
|
+
sendScreenViewEvent: (props: any) => void;
|
|
17
24
|
recordingBlocklist: string[];
|
|
18
25
|
_allowLocalhostRecording?: boolean;
|
|
26
|
+
_allowScreenRecording?: boolean;
|
|
19
27
|
}): Promise<void>;
|
|
20
28
|
handleTimeout(): void;
|
|
29
|
+
handleActivityDuringIdle(): void;
|
|
21
30
|
takeFullSnapshot(): void;
|
|
22
31
|
static handleCustomEvent(customEventType: string): void;
|
|
32
|
+
private createSession;
|
|
23
33
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type SessionCallbacks = {
|
|
2
|
-
|
|
2
|
+
takeFullSnapshot?: () => void;
|
|
3
3
|
};
|
|
4
4
|
/**
|
|
5
5
|
* Manages session state and transitions for the tracker
|
|
@@ -9,7 +9,8 @@ export type SessionCallbacks = {
|
|
|
9
9
|
export declare class SessionManager {
|
|
10
10
|
private static instance;
|
|
11
11
|
private sessionId;
|
|
12
|
-
private
|
|
12
|
+
private lastScreenViewEventTime;
|
|
13
|
+
isIdle: boolean;
|
|
13
14
|
static getInstance(): SessionManager;
|
|
14
15
|
/**
|
|
15
16
|
* Determines the current session state based on previous and current session IDs
|
|
@@ -24,10 +25,10 @@ export declare class SessionManager {
|
|
|
24
25
|
* @param newSessionId The new session ID from the server
|
|
25
26
|
* @param callbacks Optional callbacks for session state changes
|
|
26
27
|
*/
|
|
27
|
-
updateSession(newSessionId: string, callbacks?: SessionCallbacks): void;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
updateSession(newSessionId: string | null, callbacks?: SessionCallbacks): void;
|
|
29
|
+
updateLastScreenViewEventTime(): void;
|
|
30
|
+
updateIdleStatus(isIdle: boolean): void;
|
|
31
|
+
getLastScreenViewEventTime(): number;
|
|
31
32
|
getCurrentSessionId(): string | null;
|
|
32
33
|
}
|
|
33
34
|
export default SessionManager;
|