@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.umd.js CHANGED
@@ -24326,7 +24326,7 @@ const CONTINUOUS_DEBUGGING_TIMEOUT = 60000; // 1 minutes
24326
24326
  const DEBUG_SESSION_MAX_DURATION_SECONDS = 10 * 60 + 30; // TODO: move to shared config otel core
24327
24327
  const REMOTE_SESSION_RECORDING_START = 'remote-session-recording:start';
24328
24328
  const REMOTE_SESSION_RECORDING_STOP = 'remote-session-recording:stop';
24329
- const PACKAGE_VERSION_EXPORT = "1.3.22" || 0;
24329
+ const PACKAGE_VERSION_EXPORT = "1.3.23" || 0;
24330
24330
  // Regex patterns for OpenTelemetry ignore URLs
24331
24331
  const OTEL_IGNORE_URLS = [
24332
24332
  // Traces endpoint
@@ -25306,13 +25306,14 @@ const getElementTextContent = (element) => {
25306
25306
 
25307
25307
 
25308
25308
 
25309
+ 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);
25309
25310
  class TracerBrowserSDK {
25310
25311
  constructor() {
25311
25312
  this.clientId = '';
25312
25313
  this.sessionId = '';
25313
25314
  this.globalErrorListenersRegistered = false;
25314
25315
  }
25315
- setSessionId(sessionId, sessionType = _multiplayer_app_session_recorder_common__WEBPACK_IMPORTED_MODULE_1__.SessionType.MANUAL) {
25316
+ _setSessionId(sessionId, sessionType = _multiplayer_app_session_recorder_common__WEBPACK_IMPORTED_MODULE_1__.SessionType.MANUAL) {
25316
25317
  this.sessionId = sessionId;
25317
25318
  if (!this.idGenerator) {
25318
25319
  throw new Error('Id generator not initialized');
@@ -25321,10 +25322,10 @@ class TracerBrowserSDK {
25321
25322
  }
25322
25323
  init(options) {
25323
25324
  this.config = options;
25324
- 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)();
25325
+ this.clientId = clientIdGenerator();
25325
25326
  const { application, version, environment } = this.config;
25326
25327
  this.idGenerator = new _multiplayer_app_session_recorder_common__WEBPACK_IMPORTED_MODULE_1__.SessionRecorderIdGenerator();
25327
- this.setSessionId('', _multiplayer_app_session_recorder_common__WEBPACK_IMPORTED_MODULE_1__.SessionType.SESSION_CACHE);
25328
+ this._setSessionId('', _multiplayer_app_session_recorder_common__WEBPACK_IMPORTED_MODULE_1__.SessionType.SESSION_CACHE);
25328
25329
  this.exporter = new _multiplayer_app_session_recorder_common__WEBPACK_IMPORTED_MODULE_1__.SessionRecorderBrowserTraceExporter({
25329
25330
  apiKey: options.apiKey,
25330
25331
  url: (0,_helpers__WEBPACK_IMPORTED_MODULE_3__.getExporterEndpoint)(options.exporterEndpoint),
@@ -25458,13 +25459,13 @@ class TracerBrowserSDK {
25458
25459
  if (!this.tracerProvider) {
25459
25460
  throw new Error('Configuration not initialized. Call init() before start().');
25460
25461
  }
25461
- this.setSessionId(sessionId, sessionType);
25462
+ this._setSessionId(sessionId, sessionType);
25462
25463
  }
25463
25464
  stop() {
25464
25465
  if (!this.tracerProvider) {
25465
25466
  throw new Error('Configuration not initialized. Call init() before start().');
25466
25467
  }
25467
- this.setSessionId('', _multiplayer_app_session_recorder_common__WEBPACK_IMPORTED_MODULE_1__.SessionType.SESSION_CACHE);
25468
+ this._setSessionId('', _multiplayer_app_session_recorder_common__WEBPACK_IMPORTED_MODULE_1__.SessionType.SESSION_CACHE);
25468
25469
  }
25469
25470
  setApiKey(apiKey) {
25470
25471
  if (!this.exporter) {
@@ -25472,6 +25473,14 @@ class TracerBrowserSDK {
25472
25473
  }
25473
25474
  this.exporter.setApiKey(apiKey);
25474
25475
  }
25476
+ async exportTraces(spans) {
25477
+ var _a;
25478
+ if ((_a = this === null || this === void 0 ? void 0 : this.batchSpanProcessor) === null || _a === void 0 ? void 0 : _a.onEnd) {
25479
+ 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); });
25480
+ // return this.batchSpanProcessor.onEnd()
25481
+ }
25482
+ throw new Error('Buffer span processor not initialized');
25483
+ }
25475
25484
  /**
25476
25485
  * Capture an exception as an error span/event.
25477
25486
  * If there is an active span, the exception will be recorded on it.
@@ -25503,14 +25512,6 @@ class TracerBrowserSDK {
25503
25512
  }
25504
25513
  catch (_ignored) { }
25505
25514
  }
25506
- async exportTraces(spans) {
25507
- var _a;
25508
- if ((_a = this === null || this === void 0 ? void 0 : this.batchSpanProcessor) === null || _a === void 0 ? void 0 : _a.onEnd) {
25509
- 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); });
25510
- // return this.batchSpanProcessor.onEnd()
25511
- }
25512
- throw new Error('Buffer span processor not initialized');
25513
- }
25514
25515
  _recordException(span, error, errorInfo) {
25515
25516
  span.recordException(error);
25516
25517
  span.setStatus({ code: _opentelemetry_api__WEBPACK_IMPORTED_MODULE_13__.SpanStatusCode.ERROR, message: error.message });