@openreplay/tracker 3.4.8 → 3.4.9
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/cjs/app/index.d.ts +1 -1
- package/cjs/app/index.js +1 -1
- package/cjs/index.d.ts +2 -1
- package/cjs/index.js +4 -4
- package/lib/app/index.d.ts +1 -1
- package/lib/app/index.js +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.js +4 -4
- package/package.json +1 -1
package/cjs/app/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import Observer from "./observer.js";
|
|
|
4
4
|
import Ticker from "./ticker.js";
|
|
5
5
|
import type { Options as ObserverOptions } from "./observer.js";
|
|
6
6
|
import type { Options as WebworkerOptions } from "../messages/webworker.js";
|
|
7
|
-
interface OnStartInfo {
|
|
7
|
+
export interface OnStartInfo {
|
|
8
8
|
sessionID: string;
|
|
9
9
|
sessionToken: string;
|
|
10
10
|
userUUID: string;
|
package/cjs/app/index.js
CHANGED
package/cjs/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { Options as ExceptionOptions } from "./modules/exception.js";
|
|
|
8
8
|
import { Options as InputOptions } from "./modules/input.js";
|
|
9
9
|
import { Options as PerformanceOptions } from "./modules/performance.js";
|
|
10
10
|
import { Options as TimingOptions } from "./modules/timing.js";
|
|
11
|
+
export type { OnStartInfo } from './app/index.js';
|
|
11
12
|
export declare type Options = Partial<AppOptions & ConsoleOptions & ExceptionOptions & InputOptions & PerformanceOptions & TimingOptions> & {
|
|
12
13
|
projectID?: number;
|
|
13
14
|
projectKey: string;
|
|
@@ -22,7 +23,7 @@ export default class API {
|
|
|
22
23
|
use<T>(fn: (app: App | null, options?: Options) => T): T;
|
|
23
24
|
isActive(): boolean;
|
|
24
25
|
active(): boolean;
|
|
25
|
-
start():
|
|
26
|
+
start(): Promise<import("./app/index.js").OnStartInfo>;
|
|
26
27
|
stop(): void;
|
|
27
28
|
getSessionToken(): string | null | undefined;
|
|
28
29
|
getSessionID(): string | null | undefined;
|
package/cjs/index.js
CHANGED
|
@@ -115,7 +115,7 @@ class API {
|
|
|
115
115
|
// no-cors issue only with text/plain or not-set Content-Type
|
|
116
116
|
// req.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
|
|
117
117
|
req.send(JSON.stringify({
|
|
118
|
-
trackerVersion: '3.4.
|
|
118
|
+
trackerVersion: '3.4.9',
|
|
119
119
|
projectKey: options.projectKey,
|
|
120
120
|
doNotTrack,
|
|
121
121
|
// TODO: add precise reason (an exact API missing)
|
|
@@ -138,12 +138,12 @@ class API {
|
|
|
138
138
|
start() {
|
|
139
139
|
if (!utils_js_1.IN_BROWSER) {
|
|
140
140
|
console.error(`OpenReplay: you are trying to start Tracker on a node.js environment. If you want to use OpenReplay with SSR, please, use componentDidMount or useEffect API for placing the \`tracker.start()\` line. Check documentation on ${utils_js_1.DOCS_HOST}${DOCS_SETUP}`);
|
|
141
|
-
return;
|
|
141
|
+
return Promise.reject("Trying to start not in browser.");
|
|
142
142
|
}
|
|
143
143
|
if (this.app === null) {
|
|
144
|
-
return;
|
|
144
|
+
return Promise.reject("Browser doesn't support required api, or doNotTrack is active.");
|
|
145
145
|
}
|
|
146
|
-
this.app.start();
|
|
146
|
+
return this.app.start();
|
|
147
147
|
}
|
|
148
148
|
stop() {
|
|
149
149
|
if (this.app === null) {
|
package/lib/app/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import Observer from "./observer.js";
|
|
|
4
4
|
import Ticker from "./ticker.js";
|
|
5
5
|
import type { Options as ObserverOptions } from "./observer.js";
|
|
6
6
|
import type { Options as WebworkerOptions } from "../messages/webworker.js";
|
|
7
|
-
interface OnStartInfo {
|
|
7
|
+
export interface OnStartInfo {
|
|
8
8
|
sessionID: string;
|
|
9
9
|
sessionToken: string;
|
|
10
10
|
userUUID: string;
|
package/lib/app/index.js
CHANGED
package/lib/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { Options as ExceptionOptions } from "./modules/exception.js";
|
|
|
8
8
|
import { Options as InputOptions } from "./modules/input.js";
|
|
9
9
|
import { Options as PerformanceOptions } from "./modules/performance.js";
|
|
10
10
|
import { Options as TimingOptions } from "./modules/timing.js";
|
|
11
|
+
export type { OnStartInfo } from './app/index.js';
|
|
11
12
|
export declare type Options = Partial<AppOptions & ConsoleOptions & ExceptionOptions & InputOptions & PerformanceOptions & TimingOptions> & {
|
|
12
13
|
projectID?: number;
|
|
13
14
|
projectKey: string;
|
|
@@ -22,7 +23,7 @@ export default class API {
|
|
|
22
23
|
use<T>(fn: (app: App | null, options?: Options) => T): T;
|
|
23
24
|
isActive(): boolean;
|
|
24
25
|
active(): boolean;
|
|
25
|
-
start():
|
|
26
|
+
start(): Promise<import("./app/index.js").OnStartInfo>;
|
|
26
27
|
stop(): void;
|
|
27
28
|
getSessionToken(): string | null | undefined;
|
|
28
29
|
getSessionID(): string | null | undefined;
|
package/lib/index.js
CHANGED
|
@@ -111,7 +111,7 @@ export default class API {
|
|
|
111
111
|
// no-cors issue only with text/plain or not-set Content-Type
|
|
112
112
|
// req.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
|
|
113
113
|
req.send(JSON.stringify({
|
|
114
|
-
trackerVersion: '3.4.
|
|
114
|
+
trackerVersion: '3.4.9',
|
|
115
115
|
projectKey: options.projectKey,
|
|
116
116
|
doNotTrack,
|
|
117
117
|
// TODO: add precise reason (an exact API missing)
|
|
@@ -134,12 +134,12 @@ export default class API {
|
|
|
134
134
|
start() {
|
|
135
135
|
if (!IN_BROWSER) {
|
|
136
136
|
console.error(`OpenReplay: you are trying to start Tracker on a node.js environment. If you want to use OpenReplay with SSR, please, use componentDidMount or useEffect API for placing the \`tracker.start()\` line. Check documentation on ${DOCS_HOST}${DOCS_SETUP}`);
|
|
137
|
-
return;
|
|
137
|
+
return Promise.reject("Trying to start not in browser.");
|
|
138
138
|
}
|
|
139
139
|
if (this.app === null) {
|
|
140
|
-
return;
|
|
140
|
+
return Promise.reject("Browser doesn't support required api, or doNotTrack is active.");
|
|
141
141
|
}
|
|
142
|
-
this.app.start();
|
|
142
|
+
return this.app.start();
|
|
143
143
|
}
|
|
144
144
|
stop() {
|
|
145
145
|
if (this.app === null) {
|