userlens-analytics-sdk 0.1.15 → 0.1.17
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/types/EventCollector/index.d.ts +9 -0
- package/dist/types/SessionRecorder/index.d.ts +13 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/types/index.d.ts +39 -0
- package/dist/types/utils.d.ts +1 -0
- package/dist/userlens.cjs.js +2 -2
- package/dist/userlens.esm.js +2 -2
- package/dist/userlens.umd.js +2 -2
- package/package.json +5 -2
- package/rollup.config.js +8 -3
- package/src/EventCollector/{index.js → index.ts} +112 -116
- package/src/SessionRecorder/{index.js → index.ts} +47 -37
- package/src/index.ts +12 -0
- package/src/types/index.ts +46 -0
- package/src/utils.ts +8 -0
- package/tsconfig.json +14 -0
- package/dist/userlens.ejs.js +0 -0
- package/src/EventTracker.js +0 -88
- package/src/api.js +0 -16
- package/src/index.js +0 -8
- package/src/utils.js +0 -3
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PushedEvent } from "../types";
|
|
2
|
+
export default class EventCollector {
|
|
3
|
+
#private;
|
|
4
|
+
private callback;
|
|
5
|
+
private intervalTime;
|
|
6
|
+
private events;
|
|
7
|
+
constructor(callback: (events: any[]) => void, intervalTime?: number);
|
|
8
|
+
pushEvent(event: PushedEvent): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SessionRecorderConfig } from "../types";
|
|
2
|
+
export default class SessionRecorder {
|
|
3
|
+
#private;
|
|
4
|
+
private WRITE_CODE;
|
|
5
|
+
private userId;
|
|
6
|
+
private TIMEOUT;
|
|
7
|
+
private BUFFER_SIZE;
|
|
8
|
+
private maskingOptions;
|
|
9
|
+
private sessionUuid;
|
|
10
|
+
private sessionEvents;
|
|
11
|
+
private rrwebControl;
|
|
12
|
+
constructor({ WRITE_CODE, userId, recordingOptions, }: SessionRecorderConfig);
|
|
13
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { default as SessionRecorder } from "./SessionRecorder";
|
|
2
|
+
export { default as EventCollector } from "./EventCollector";
|
|
3
|
+
export type { SessionRecorderConfig, SessionRecordingOptions, DOMSnapshotNode, RawEvent, PageViewEvent, PushedEvent, MaskingOption, } from "./types";
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export interface DOMSnapshotNode {
|
|
2
|
+
text: string | null;
|
|
3
|
+
tag_name: string;
|
|
4
|
+
attr_class: string[] | null;
|
|
5
|
+
href: string | null;
|
|
6
|
+
attr_id: string | null;
|
|
7
|
+
nth_child: number;
|
|
8
|
+
nth_of_type: number;
|
|
9
|
+
attributes: Record<string, string>;
|
|
10
|
+
}
|
|
11
|
+
export interface RawEvent {
|
|
12
|
+
event: string;
|
|
13
|
+
is_raw: true;
|
|
14
|
+
snapshot: DOMSnapshotNode[];
|
|
15
|
+
current_url: string;
|
|
16
|
+
}
|
|
17
|
+
export interface PushedEvent {
|
|
18
|
+
event: string;
|
|
19
|
+
}
|
|
20
|
+
interface PageViewEventProperties {
|
|
21
|
+
referrer: string;
|
|
22
|
+
query: Record<string, string>;
|
|
23
|
+
}
|
|
24
|
+
export interface PageViewEvent {
|
|
25
|
+
event: string;
|
|
26
|
+
properties: PageViewEventProperties;
|
|
27
|
+
}
|
|
28
|
+
export type MaskingOption = "passwords" | "all";
|
|
29
|
+
export interface SessionRecordingOptions {
|
|
30
|
+
TIMEOUT?: number;
|
|
31
|
+
BUFFER_SIZE?: number;
|
|
32
|
+
maskingOptions?: MaskingOption[];
|
|
33
|
+
}
|
|
34
|
+
export interface SessionRecorderConfig {
|
|
35
|
+
WRITE_CODE: string;
|
|
36
|
+
userId: string;
|
|
37
|
+
recordingOptions?: SessionRecordingOptions;
|
|
38
|
+
}
|
|
39
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function generateUuid(): string;
|