@multiplayer-app/session-recorder-browser 1.2.35 → 1.2.37

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/README.md CHANGED
@@ -41,9 +41,9 @@ The Multiplayer Full Stack Session Recorder is a powerful tool that offers deep
41
41
  ### Installation
42
42
 
43
43
  ```bash
44
- npm i @multiplayer-app/session-recorder-browser @opentelemetry/api
44
+ npm i @multiplayer-app/session-recorder-browser
45
45
  # or
46
- yarn add @multiplayer-app/session-recorder-browser @opentelemetry/api
46
+ yarn add @multiplayer-app/session-recorder-browser
47
47
  ```
48
48
 
49
49
  ## Set up web client:
@@ -70,7 +70,12 @@ SessionRecorder.init({
70
70
  propagateTraceHeaderCorsUrls: [new RegExp('https://api.example.com', 'i')],
71
71
  })
72
72
 
73
- // add any key value pairs which should be associated with a session
73
+
74
+ // Use session attributes to attach user context to recordings.
75
+ // The provided `userName` and `userId` will be visible in the Multiplayer
76
+ // sessions list and in the session details (shown as the reporter),
77
+ // making it easier to identify who reported or recorded the session.
78
+
74
79
  SessionRecorder.setSessionAttributes({
75
80
  userId: '12345',
76
81
  userName: 'John Doe'
@@ -220,14 +225,9 @@ SessionRecorder.setSessionAttributes({
220
225
  // optionally control via API (widget is enabled by default)
221
226
  // if you're not using widget (see: `showWidget: true/false`)
222
227
  // then you can programatically control the session recorder
223
- // by using the methods below
224
-
225
- // Option A: fire-and-forget (simple)
226
- // SessionRecorder.start()
227
- // ... later ...
228
- // SessionRecorder.stop('Finished session')
228
+ // by using the method below
229
229
 
230
- // Option B: wire up your own UI controls
230
+ // Wire up your own UI controls
231
231
  const startButton = document.getElementById('start')
232
232
  const pauseButton = document.getElementById('pause')
233
233
  const resumeButton = document.getElementById('resume')
@@ -337,12 +337,42 @@ activeSpan.setAttribute(SessionRecorder.ATTR_MULTIPLAYER_CONTINUOUS_SESSION_AUTO
337
337
  activeSpan.setAttribute(SessionRecorder.ATTR_MULTIPLAYER_CONTINUOUS_SESSION_AUTO_SAVE_REASON, 'Some reason')
338
338
  ```
339
339
 
340
- ## Session Recorder for Next.js
340
+ ## Framework-Specific Integrations
341
+
342
+ The Multiplayer Session Recorder works with any web framework, but we provide specialized packages and examples for popular frameworks to make integration easier.
343
+
344
+ ### React & Next.js
345
+
346
+ For React and Next.js applications, use the dedicated React package which includes idiomatic hooks, context helpers, and navigation tracking:
347
+
348
+ - **Package**: [@multiplayer-app/session-recorder-react](../session-recorder-react/README.md)
349
+ - **Features**: React hooks, context providers, error boundaries, and Next.js integration tips
350
+ - **Documentation**: [React/Next.js Integration Guide](../session-recorder-react/README.md)
351
+
352
+ ### Vue.js
353
+
354
+ For Vue.js applications, use the browser package directly. We provide comprehensive examples and integration guides:
355
+
356
+ - **Package**: `@multiplayer-app/session-recorder-browser` (this package)
357
+ - **Examples**: [Vue.js Example Application](./examples/vue/README.md)
358
+ - **Features**: Plugin-based integration, composables, Vue Router integration, and HTTP client support
359
+
360
+ ### Angular
361
+
362
+ For Angular applications, use the browser package with Angular-specific setup. We provide detailed examples and integration guides:
363
+
364
+ - **Package**: `@multiplayer-app/session-recorder-browser` (this package)
365
+ - **Examples**: [Angular Example Application](./examples/angular/README.md)
366
+ - **Features**: Service-based integration, app initializer setup, Angular HttpClient integration, and router support
367
+
368
+ ### React Native
341
369
 
342
- Use the React wrapper for Next.js. It includes idiomatic Next.js guidance and helpers:
370
+ For React Native applications (iOS and Android), use the dedicated React Native package:
343
371
 
344
- - React package: [@multiplayer-app/session-recorder-react](../session-recorder-react/README.md)
345
- - Next.js guide: [Next.js integration tips](../session-recorder-react/README.md#nextjs-integration-tips)
372
+ - **Package**: [@multiplayer-app/session-recorder-react-native](../session-recorder-react-native/README.md)
373
+ - **Features**: Native screen recording, gesture tracking, navigation monitoring, and full-stack debugging
374
+ - **Documentation**: [React Native Integration Guide](../session-recorder-react-native/README.md)
375
+ - **Note**: Does not support React Native Web - use the browser package for web platforms
346
376
 
347
377
  ## Documentation
348
378
 
@@ -25094,7 +25094,7 @@ const DEFAULT_MAX_HTTP_CAPTURING_PAYLOAD_SIZE = 100000;
25094
25094
  const SESSION_RESPONSE = 'multiplayer-debug-session-response';
25095
25095
  const CONTINUOUS_DEBUGGING_TIMEOUT = 60000; // 1 minutes
25096
25096
  const DEBUG_SESSION_MAX_DURATION_SECONDS = 10 * 60 + 30; // TODO: move to shared config otel core
25097
- const PACKAGE_VERSION_EXPORT = "1.2.35" || 0;
25097
+ const PACKAGE_VERSION_EXPORT = "1.2.37" || 0;
25098
25098
  // Regex patterns for OpenTelemetry ignore URLs
25099
25099
  const OTEL_IGNORE_URLS = [
25100
25100
  // Traces endpoint
@@ -25748,6 +25748,7 @@ __webpack_require__.r(__webpack_exports__);
25748
25748
  __webpack_require__.r(__webpack_exports__);
25749
25749
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
25750
25750
  /* harmony export */ extractResponseBody: () => (/* binding */ extractResponseBody),
25751
+ /* harmony export */ getElementTextContent: () => (/* binding */ getElementTextContent),
25751
25752
  /* harmony export */ getExporterEndpoint: () => (/* binding */ getExporterEndpoint),
25752
25753
  /* harmony export */ headersToObject: () => (/* binding */ headersToObject),
25753
25754
  /* harmony export */ processBody: () => (/* binding */ processBody),
@@ -25956,6 +25957,9 @@ const getExporterEndpoint = (exporterEndpoint) => {
25956
25957
  const trimmedExporterEndpoint = new URL(exporterEndpoint).origin;
25957
25958
  return `${trimmedExporterEndpoint}/v1/traces`;
25958
25959
  };
25960
+ const getElementTextContent = (element) => {
25961
+ return String(element.textContent || element.ariaLabel || '').trim();
25962
+ };
25959
25963
 
25960
25964
 
25961
25965
  /***/ }),
@@ -25998,7 +26002,6 @@ __webpack_require__.r(__webpack_exports__);
25998
26002
 
25999
26003
  class TracerBrowserSDK {
26000
26004
  constructor() {
26001
- this.allowedElements = new Set(['A', 'BUTTON']);
26002
26005
  this.sessionId = '';
26003
26006
  this.globalErrorListenersRegistered = false;
26004
26007
  }
@@ -26128,11 +26131,10 @@ class TracerBrowserSDK {
26128
26131
  if (span['parentSpanContext']) {
26129
26132
  return true;
26130
26133
  }
26131
- let textContent = '';
26132
- if (this.allowedElements.has(element.tagName)) {
26133
- textContent = String(element.textContent || element.ariaLabel || '').trim();
26134
- }
26135
- span.setAttribute('target.innerText', textContent);
26134
+ span.setAttribute('target.innerText', (0,_helpers__WEBPACK_IMPORTED_MODULE_3__.getElementTextContent)(element));
26135
+ Array.from(element.attributes).forEach(attribute => {
26136
+ span.setAttribute(`target.attribute.${attribute.name}`, attribute.value);
26137
+ });
26136
26138
  return false;
26137
26139
  },
26138
26140
  },