userlens-session-recorder 1.0.3 → 1.0.5
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
CHANGED
|
@@ -20647,13 +20647,14 @@ class SessionRecorder {
|
|
|
20647
20647
|
}
|
|
20648
20648
|
});
|
|
20649
20649
|
if (typeof window === "undefined") {
|
|
20650
|
-
|
|
20650
|
+
return;
|
|
20651
20651
|
}
|
|
20652
20652
|
if (!(WRITE_CODE === null || WRITE_CODE === void 0 ? void 0 : WRITE_CODE.trim())) {
|
|
20653
20653
|
throw new Error("Userlens SDK Error: WRITE_CODE is required and must be a string");
|
|
20654
20654
|
}
|
|
20655
20655
|
if (!(userId === null || userId === void 0 ? void 0 : userId.trim())) {
|
|
20656
20656
|
console.error("Userlens SDK Error: userId is required to identify session user.");
|
|
20657
|
+
return;
|
|
20657
20658
|
}
|
|
20658
20659
|
const { TIMEOUT = 30 * 60 * 1000, BUFFER_SIZE = 10, maskingOptions = ["passwords"], } = recordingOptions;
|
|
20659
20660
|
if (typeof WRITE_CODE === "string") {
|
|
@@ -20701,6 +20702,7 @@ _SessionRecorder_trackEventsThrottled = new WeakMap(), _SessionRecorder_handleVi
|
|
|
20701
20702
|
}, 100);
|
|
20702
20703
|
__classPrivateFieldGet(this, _SessionRecorder_instances, "m", _SessionRecorder_initFocusListener).call(this);
|
|
20703
20704
|
}, _SessionRecorder_handleEvent = function _SessionRecorder_handleEvent(event) {
|
|
20705
|
+
var _a;
|
|
20704
20706
|
const now = Date.now();
|
|
20705
20707
|
const lastActive = Number(localStorage.getItem("userlensSessionLastActive"));
|
|
20706
20708
|
// check inactivity timeout
|
|
@@ -20710,7 +20712,7 @@ _SessionRecorder_trackEventsThrottled = new WeakMap(), _SessionRecorder_handleVi
|
|
|
20710
20712
|
localStorage.setItem("userlensSessionLastActive", now.toString());
|
|
20711
20713
|
this.sessionEvents.push(event);
|
|
20712
20714
|
if (this.sessionEvents.length >= this.BUFFER_SIZE) {
|
|
20713
|
-
__classPrivateFieldGet(this, _SessionRecorder_trackEventsThrottled, "f").call(this);
|
|
20715
|
+
(_a = __classPrivateFieldGet(this, _SessionRecorder_trackEventsThrottled, "f")) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
20714
20716
|
}
|
|
20715
20717
|
}, _SessionRecorder_resetSession = function _SessionRecorder_resetSession() {
|
|
20716
20718
|
__classPrivateFieldGet(this, _SessionRecorder_instances, "m", _SessionRecorder_removeLocalSessionData).call(this);
|