@statsig/session-replay 3.22.0-beta.3 → 3.23.0-beta.1
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@statsig/session-replay",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.23.0-beta.1",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"homepage": "https://github.com/statsig-io/js-client-monorepo",
|
|
6
6
|
"repository": {
|
|
@@ -9,12 +9,11 @@
|
|
|
9
9
|
"directory": "packages/session-replay"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"@statsig/client-core": "3.22.0-beta.3"
|
|
12
|
+
"rrweb": "2.0.0-alpha.14",
|
|
13
|
+
"@statsig/client-core": "3.23.0-beta.1"
|
|
15
14
|
},
|
|
16
15
|
"devDependencies": {
|
|
17
|
-
"@rrweb/types": "2.0.0-alpha.
|
|
16
|
+
"@rrweb/types": "2.0.0-alpha.14"
|
|
18
17
|
},
|
|
19
18
|
"type": "commonjs",
|
|
20
19
|
"main": "./src/index.js",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { eventWithTime } from '@rrweb/types';
|
|
2
|
-
import
|
|
2
|
+
import * as rrweb from 'rrweb';
|
|
3
3
|
import { Flatten } from '@statsig/client-core';
|
|
4
4
|
export type ReplayEvent = Flatten<eventWithTime & {
|
|
5
5
|
eventIndex: number;
|
|
6
6
|
}>;
|
|
7
|
-
export type RRWebConfig = Omit<recordOptions<unknown>, 'emit'>;
|
|
7
|
+
export type RRWebConfig = Omit<rrweb.recordOptions<unknown>, 'emit'>;
|
|
8
8
|
export type ReplaySessionData = {
|
|
9
9
|
startTime: number;
|
|
10
10
|
endTime: number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SessionReplayClient = void 0;
|
|
4
|
-
const
|
|
4
|
+
const rrweb = require("rrweb");
|
|
5
5
|
const client_core_1 = require("@statsig/client-core");
|
|
6
6
|
const TIMEOUT_MS = 1000 * 60 * 60 * 4; // 4 hours
|
|
7
7
|
const CHECKOUT_WINDOW_MS = 1000 * 30; // 30 seconds
|
|
@@ -70,11 +70,12 @@ exports.SessionReplayClient = SessionReplayClient;
|
|
|
70
70
|
* This function ensures we handle both "npm" and "<script ..>" install options.
|
|
71
71
|
*/
|
|
72
72
|
function _minifiedAwareRecord(emit, config, keepRollingWindow) {
|
|
73
|
+
const record = typeof rrweb === 'function' ? rrweb : rrweb.record;
|
|
73
74
|
if (keepRollingWindow) {
|
|
74
|
-
return
|
|
75
|
+
return record(Object.assign(Object.assign({}, config), { emit, checkoutEveryNms: CHECKOUT_WINDOW_MS }));
|
|
75
76
|
}
|
|
76
77
|
else {
|
|
77
|
-
return
|
|
78
|
+
return record(Object.assign(Object.assign({}, config), { emit }));
|
|
78
79
|
}
|
|
79
80
|
}
|
|
80
81
|
function _isClickEvent(event) {
|