@openreplay/tracker 17.1.0 → 17.1.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.
@@ -1,4 +1,3 @@
1
- import { categories } from './types';
2
1
  interface PeopleEvent {
3
2
  type: string;
4
3
  timestamp: number;
@@ -25,8 +24,8 @@ declare class Batcher {
25
24
  constructor(backendUrl: string, getToken: () => string | null, init: () => Promise<void>);
26
25
  getBatches(): {
27
26
  data: {
28
- [categories.people]: PeopleEvent[];
29
- [categories.events]: Event[];
27
+ user_actions: PeopleEvent[];
28
+ events: Event[];
30
29
  };
31
30
  };
32
31
  addEvent(event: any): void;
@@ -8,11 +8,11 @@ export declare const mutationTypes: {
8
8
  incrementProperty: string;
9
9
  };
10
10
  export declare const categories: {
11
- people: string;
12
- events: string;
11
+ readonly people: "user_actions";
12
+ readonly events: "events";
13
13
  };
14
14
  export declare const createEvent: (category: (typeof categories)[keyof typeof categories], type?: (typeof mutationTypes)[keyof typeof mutationTypes], timestamp?: number, payload?: Record<string, any>) => {
15
- category: string;
15
+ category: "user_actions";
16
16
  data: {
17
17
  type: string | undefined;
18
18
  user_id: any;
@@ -21,7 +21,7 @@ export declare const createEvent: (category: (typeof categories)[keyof typeof ca
21
21
  name?: undefined;
22
22
  };
23
23
  } | {
24
- category: string;
24
+ category: "events";
25
25
  data: {
26
26
  name: any;
27
27
  payload: any;
@@ -2,5 +2,12 @@ import type App from '../app/index.js';
2
2
  export interface Options {
3
3
  urlSanitizer?: (url: string) => string;
4
4
  titleSanitizer?: (title: string) => string;
5
+ /** if present, tracker will remove given symbol to present url as regular router url on replay level;
6
+ *
7
+ * applied BEFORE sanitizers.
8
+ *
9
+ * @example passing '#/' will result in 'site.com/#/path' -> 'site.com/path'
10
+ */
11
+ replaceHashSymbol?: string;
5
12
  }
6
13
  export default function (app: App, options?: Options): void;
@@ -1,4 +1,3 @@
1
- import { categories } from './types';
2
1
  interface PeopleEvent {
3
2
  type: string;
4
3
  timestamp: number;
@@ -25,8 +24,8 @@ declare class Batcher {
25
24
  constructor(backendUrl: string, getToken: () => string | null, init: () => Promise<void>);
26
25
  getBatches(): {
27
26
  data: {
28
- [categories.people]: PeopleEvent[];
29
- [categories.events]: Event[];
27
+ user_actions: PeopleEvent[];
28
+ events: Event[];
30
29
  };
31
30
  };
32
31
  addEvent(event: any): void;
@@ -8,11 +8,11 @@ export declare const mutationTypes: {
8
8
  incrementProperty: string;
9
9
  };
10
10
  export declare const categories: {
11
- people: string;
12
- events: string;
11
+ readonly people: "user_actions";
12
+ readonly events: "events";
13
13
  };
14
14
  export declare const createEvent: (category: (typeof categories)[keyof typeof categories], type?: (typeof mutationTypes)[keyof typeof mutationTypes], timestamp?: number, payload?: Record<string, any>) => {
15
- category: string;
15
+ category: "user_actions";
16
16
  data: {
17
17
  type: string | undefined;
18
18
  user_id: any;
@@ -21,7 +21,7 @@ export declare const createEvent: (category: (typeof categories)[keyof typeof ca
21
21
  name?: undefined;
22
22
  };
23
23
  } | {
24
- category: string;
24
+ category: "events";
25
25
  data: {
26
26
  name: any;
27
27
  payload: any;
@@ -2,5 +2,12 @@ import type App from '../app/index.js';
2
2
  export interface Options {
3
3
  urlSanitizer?: (url: string) => string;
4
4
  titleSanitizer?: (title: string) => string;
5
+ /** if present, tracker will remove given symbol to present url as regular router url on replay level;
6
+ *
7
+ * applied BEFORE sanitizers.
8
+ *
9
+ * @example passing '#/' will result in 'site.com/#/path' -> 'site.com/path'
10
+ */
11
+ replaceHashSymbol?: string;
5
12
  }
6
13
  export default function (app: App, options?: Options): void;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@openreplay/tracker",
3
3
  "description": "The OpenReplay tracker main package",
4
- "version": "17.1.0",
4
+ "version": "17.1.2",
5
5
  "keywords": [
6
6
  "logging",
7
7
  "replay"