@statsig/session-replay 0.0.1-beta.32 → 0.0.1-beta.34

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,9 +1,9 @@
1
1
  {
2
2
  "name": "@statsig/session-replay",
3
- "version": "0.0.1-beta.32",
3
+ "version": "0.0.1-beta.34",
4
4
  "dependencies": {
5
5
  "rrweb": "2.0.0-alpha.12",
6
- "@statsig/client-core": "0.0.1-beta.32"
6
+ "@statsig/client-core": "0.0.1-beta.34"
7
7
  },
8
8
  "devDependencies": {
9
9
  "@rrweb/types": "2.0.0-alpha.12"
@@ -2,11 +2,11 @@ import { PrecomputedEvaluationsInterface } from '@statsig/client-core';
2
2
  export declare function runStatsigSessionReplay(client: PrecomputedEvaluationsInterface): void;
3
3
  export declare class SessionReplay {
4
4
  private _client;
5
- private _errorBoundary;
6
5
  private _replayer;
7
6
  private _sessionData;
8
7
  private _events;
9
8
  private _currentSessionID;
9
+ private _errorBoundary;
10
10
  constructor(_client: PrecomputedEvaluationsInterface);
11
11
  private _onVisibilityChanged;
12
12
  private _onRecordingEvent;
@@ -22,9 +22,9 @@ class SessionReplay {
22
22
  this._client = _client;
23
23
  this._sessionData = null;
24
24
  this._events = [];
25
- const { sdkKey } = _client.getContext();
26
- this._errorBoundary = new client_core_1.ErrorBoundary(sdkKey);
27
- (0, client_core_1.monitorClass)(this._errorBoundary, this);
25
+ const { sdkKey, errorBoundary } = _client.getContext();
26
+ this._errorBoundary = errorBoundary;
27
+ this._errorBoundary.wrap(this);
28
28
  if ((0, client_core_1._isBrowserEnv)()) {
29
29
  const statsigGlobal = (0, client_core_1._getStatsigGlobal)();
30
30
  statsigGlobal.srInstances = Object.assign(Object.assign({}, statsigGlobal.srInstances), { [sdkKey]: this });
@@ -39,7 +39,13 @@ class SessionReplay {
39
39
  this._logRecording();
40
40
  this._currentSessionID = this._getSessionIdFromClient();
41
41
  });
42
- (0, client_core_1._subscribeToVisiblityChanged)(this._onVisibilityChanged.bind(this));
42
+ (0, client_core_1._subscribeToVisiblityChanged)((vis) => {
43
+ var _a;
44
+ const inst = (_a = __STATSIG__ === null || __STATSIG__ === void 0 ? void 0 : __STATSIG__.srInstances) === null || _a === void 0 ? void 0 : _a[sdkKey];
45
+ if (inst instanceof SessionReplay) {
46
+ inst._onVisibilityChanged(vis);
47
+ }
48
+ });
43
49
  this._attemptToStartRecording();
44
50
  }
45
51
  _onVisibilityChanged(visibility) {