@multiplayer-app/session-recorder-browser 1.3.22 → 1.3.23

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.js CHANGED
@@ -24152,7 +24152,7 @@ const CONTINUOUS_DEBUGGING_TIMEOUT = 60000; // 1 minutes
24152
24152
  const DEBUG_SESSION_MAX_DURATION_SECONDS = 10 * 60 + 30; // TODO: move to shared config otel core
24153
24153
  const REMOTE_SESSION_RECORDING_START = 'remote-session-recording:start';
24154
24154
  const REMOTE_SESSION_RECORDING_STOP = 'remote-session-recording:stop';
24155
- const PACKAGE_VERSION_EXPORT = "1.3.22" || 0;
24155
+ const PACKAGE_VERSION_EXPORT = "1.3.23" || 0;
24156
24156
  // Regex patterns for OpenTelemetry ignore URLs
24157
24157
  const OTEL_IGNORE_URLS = [
24158
24158
  // Traces endpoint
@@ -25118,13 +25118,14 @@ const getElementTextContent = (element) => {
25118
25118
 
25119
25119
 
25120
25120
 
25121
+ const clientIdGenerator = _multiplayer_app_session_recorder_common__WEBPACK_IMPORTED_MODULE_1__.SessionRecorderSdk.getIdGenerator(_multiplayer_app_session_recorder_common__WEBPACK_IMPORTED_MODULE_1__.MULTIPLAYER_TRACE_CLIENT_ID_LENGTH);
25121
25122
  class TracerBrowserSDK {
25122
25123
  constructor() {
25123
25124
  this.clientId = '';
25124
25125
  this.sessionId = '';
25125
25126
  this.globalErrorListenersRegistered = false;
25126
25127
  }
25127
- setSessionId(sessionId, sessionType = _multiplayer_app_session_recorder_common__WEBPACK_IMPORTED_MODULE_1__.SessionType.MANUAL) {
25128
+ _setSessionId(sessionId, sessionType = _multiplayer_app_session_recorder_common__WEBPACK_IMPORTED_MODULE_1__.SessionType.MANUAL) {
25128
25129
  this.sessionId = sessionId;
25129
25130
  if (!this.idGenerator) {
25130
25131
  throw new Error('Id generator not initialized');
@@ -25133,10 +25134,10 @@ class TracerBrowserSDK {
25133
25134
  }
25134
25135
  init(options) {
25135
25136
  this.config = options;
25136
- this.clientId = _multiplayer_app_session_recorder_common__WEBPACK_IMPORTED_MODULE_1__.SessionRecorderSdk.getIdGenerator(_multiplayer_app_session_recorder_common__WEBPACK_IMPORTED_MODULE_1__.MULTIPLAYER_TRACE_CLIENT_ID_LENGTH)();
25137
+ this.clientId = clientIdGenerator();
25137
25138
  const { application, version, environment } = this.config;
25138
25139
  this.idGenerator = new _multiplayer_app_session_recorder_common__WEBPACK_IMPORTED_MODULE_1__.SessionRecorderIdGenerator();
25139
- this.setSessionId('', _multiplayer_app_session_recorder_common__WEBPACK_IMPORTED_MODULE_1__.SessionType.SESSION_CACHE);
25140
+ this._setSessionId('', _multiplayer_app_session_recorder_common__WEBPACK_IMPORTED_MODULE_1__.SessionType.SESSION_CACHE);
25140
25141
  this.exporter = new _multiplayer_app_session_recorder_common__WEBPACK_IMPORTED_MODULE_1__.SessionRecorderBrowserTraceExporter({
25141
25142
  apiKey: options.apiKey,
25142
25143
  url: (0,_helpers__WEBPACK_IMPORTED_MODULE_3__.getExporterEndpoint)(options.exporterEndpoint),
@@ -25270,13 +25271,13 @@ class TracerBrowserSDK {
25270
25271
  if (!this.tracerProvider) {
25271
25272
  throw new Error('Configuration not initialized. Call init() before start().');
25272
25273
  }
25273
- this.setSessionId(sessionId, sessionType);
25274
+ this._setSessionId(sessionId, sessionType);
25274
25275
  }
25275
25276
  stop() {
25276
25277
  if (!this.tracerProvider) {
25277
25278
  throw new Error('Configuration not initialized. Call init() before start().');
25278
25279
  }
25279
- this.setSessionId('', _multiplayer_app_session_recorder_common__WEBPACK_IMPORTED_MODULE_1__.SessionType.SESSION_CACHE);
25280
+ this._setSessionId('', _multiplayer_app_session_recorder_common__WEBPACK_IMPORTED_MODULE_1__.SessionType.SESSION_CACHE);
25280
25281
  }
25281
25282
  setApiKey(apiKey) {
25282
25283
  if (!this.exporter) {
@@ -25284,6 +25285,14 @@ class TracerBrowserSDK {
25284
25285
  }
25285
25286
  this.exporter.setApiKey(apiKey);
25286
25287
  }
25288
+ async exportTraces(spans) {
25289
+ var _a;
25290
+ if ((_a = this === null || this === void 0 ? void 0 : this.batchSpanProcessor) === null || _a === void 0 ? void 0 : _a.onEnd) {
25291
+ spans.map((span) => { var _a; return (_a = this === null || this === void 0 ? void 0 : this.batchSpanProcessor) === null || _a === void 0 ? void 0 : _a.onEnd(span); });
25292
+ // return this.batchSpanProcessor.onEnd()
25293
+ }
25294
+ throw new Error('Buffer span processor not initialized');
25295
+ }
25287
25296
  /**
25288
25297
  * Capture an exception as an error span/event.
25289
25298
  * If there is an active span, the exception will be recorded on it.
@@ -25315,14 +25324,6 @@ class TracerBrowserSDK {
25315
25324
  }
25316
25325
  catch (_ignored) { }
25317
25326
  }
25318
- async exportTraces(spans) {
25319
- var _a;
25320
- if ((_a = this === null || this === void 0 ? void 0 : this.batchSpanProcessor) === null || _a === void 0 ? void 0 : _a.onEnd) {
25321
- spans.map((span) => { var _a; return (_a = this === null || this === void 0 ? void 0 : this.batchSpanProcessor) === null || _a === void 0 ? void 0 : _a.onEnd(span); });
25322
- // return this.batchSpanProcessor.onEnd()
25323
- }
25324
- throw new Error('Buffer span processor not initialized');
25325
- }
25326
25327
  _recordException(span, error, errorInfo) {
25327
25328
  span.recordException(error);
25328
25329
  span.setStatus({ code: _opentelemetry_api__WEBPACK_IMPORTED_MODULE_13__.SpanStatusCode.ERROR, message: error.message });