@multiplayer-app/session-recorder-browser 1.2.31 → 1.2.32

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
@@ -339,88 +339,10 @@ activeSpan.setAttribute(SessionRecorder.ATTR_MULTIPLAYER_CONTINUOUS_SESSION_AUTO
339
339
 
340
340
  ## Session Recorder for Next.js
341
341
 
342
- ### Next.js 15.3+ (App Router) instrumentation-client.ts
342
+ Use the React wrapper for Next.js. It includes idiomatic Next.js guidance and helpers:
343
343
 
344
- On Next.js 15.3+ you can initialize the Session Recorder as early as possible with `src/instrumentation-client.ts|js`, which runs before hydration. You can also export `onRouterTransitionStart` to observe navigation. See the official docs: [instrumentation-client.ts](https://nextjs.org/docs/app/api-reference/file-conventions/instrumentation-client).
345
-
346
- 1. Create `app/instrumentation-client.ts|js`:
347
-
348
- ```ts
349
- import SessionRecorder from '@multiplayer-app/session-recorder-browser'
350
-
351
- // Initialize as early as possible (before hydration)
352
- try {
353
- SessionRecorder.init({
354
- application: 'my-next-app',
355
- version: '1.0.0',
356
- environment: process.env.NEXT_PUBLIC_ENVIRONMENT ?? 'production',
357
- apiKey: process.env.NEXT_PUBLIC_MULTIPLAYER_API_KEY!,
358
- showWidget: true,
359
- // If your APIs are on different origins, add them so OTLP headers are propagated
360
- // format: string | RegExp | Array
361
- propagateTraceHeaderCorsUrls: [new RegExp('https://api.example.com', 'i')]
362
- })
363
- } catch (error) {
364
- // Keep instrumentation resilient
365
- console.warn('[SessionRecorder] init failed in instrumentation-client:', error)
366
- }
367
-
368
- // Optional: Next.js will call this when navigation begins
369
- export function onRouterTransitionStart(url: string, navigationType: 'push' | 'replace' | 'traverse') {
370
- try {
371
- SessionRecorder.navigation.record({
372
- path: url || '/',
373
- navigationType,
374
- framework: 'nextjs',
375
- source: 'instrumentation-client'
376
- })
377
- } catch (error) {
378
- console.warn('[SessionRecorder] navigation record failed:', error)
379
- }
380
- }
381
- ```
382
-
383
- ## Note
384
-
385
- If frontend domain doesn't match to backend one, set backend domain to `propagateTraceHeaderCorsUrls` parameter:
386
-
387
- ```javascript
388
- import SessionRecorder from '@multiplayer-app/session-recorder-browser'
389
- try {
390
- SessionRecorder.init({
391
- application: 'my-next-app',
392
- version: '1.0.0',
393
- environment: process.env.NEXT_PUBLIC_ENVIRONMENT ?? 'production',
394
- apiKey: process.env.NEXT_PUBLIC_MULTIPLAYER_API_KEY!,
395
- propagateTraceHeaderCorsUrls: new RegExp(`https://your.backend.api.domain`, 'i')
396
- })
397
- } catch (error) {
398
- console.warn('[SessionRecorder] init failed:', error)
399
- }
400
- ```
401
-
402
- If frontend sends api requests to two or more different domains put them to `propagateTraceHeaderCorsUrls` as array:
403
-
404
- ```javascript
405
- import SessionRecorder from '@multiplayer-app/session-recorder-browser'
406
-
407
- try {
408
- SessionRecorder.init({
409
- // ... other config ...
410
- propagateTraceHeaderCorsUrls: [
411
- new RegExp(`https://your.backend.api.domain`, 'i'),
412
- new RegExp(`https://another.backend.api.domain`, 'i')
413
- ]
414
- })
415
- } catch (error) {
416
- console.warn('[SessionRecorder] init failed:', error)
417
- }
418
- ```
419
-
420
- ### Framework notes
421
-
422
- - Next.js: initialize the browser SDK in a Client Component (see example in the browser README). Ensure it runs only in the browser.
423
- - CORS: when your frontend calls multiple API domains, set `propagateTraceHeaderCorsUrls` to match them so parent/child spans correlate across services.
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)
424
346
 
425
347
  ## Documentation
426
348
 
@@ -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.31" || 0;
25097
+ const PACKAGE_VERSION_EXPORT = "1.2.32" || 0;
25098
25098
  // Regex patterns for OpenTelemetry ignore URLs
25099
25099
  const OTEL_IGNORE_URLS = [
25100
25100
  // Traces endpoint
@@ -9978,7 +9978,7 @@ const DEFAULT_MAX_HTTP_CAPTURING_PAYLOAD_SIZE = 100000;
9978
9978
  const SESSION_RESPONSE = 'multiplayer-debug-session-response';
9979
9979
  const CONTINUOUS_DEBUGGING_TIMEOUT = 60000; // 1 minutes
9980
9980
  const DEBUG_SESSION_MAX_DURATION_SECONDS = 10 * 60 + 30; // TODO: move to shared config otel core
9981
- const PACKAGE_VERSION_EXPORT = "1.2.31" || 0;
9981
+ const PACKAGE_VERSION_EXPORT = "1.2.32" || 0;
9982
9982
  // Regex patterns for OpenTelemetry ignore URLs
9983
9983
  const OTEL_IGNORE_URLS = [
9984
9984
  // Traces endpoint
package/dist/index.js CHANGED
@@ -24143,7 +24143,7 @@ const DEFAULT_MAX_HTTP_CAPTURING_PAYLOAD_SIZE = 100000;
24143
24143
  const SESSION_RESPONSE = 'multiplayer-debug-session-response';
24144
24144
  const CONTINUOUS_DEBUGGING_TIMEOUT = 60000; // 1 minutes
24145
24145
  const DEBUG_SESSION_MAX_DURATION_SECONDS = 10 * 60 + 30; // TODO: move to shared config otel core
24146
- const PACKAGE_VERSION_EXPORT = "1.2.31" || 0;
24146
+ const PACKAGE_VERSION_EXPORT = "1.2.32" || 0;
24147
24147
  // Regex patterns for OpenTelemetry ignore URLs
24148
24148
  const OTEL_IGNORE_URLS = [
24149
24149
  // Traces endpoint
package/dist/index.umd.js CHANGED
@@ -24317,7 +24317,7 @@ const DEFAULT_MAX_HTTP_CAPTURING_PAYLOAD_SIZE = 100000;
24317
24317
  const SESSION_RESPONSE = 'multiplayer-debug-session-response';
24318
24318
  const CONTINUOUS_DEBUGGING_TIMEOUT = 60000; // 1 minutes
24319
24319
  const DEBUG_SESSION_MAX_DURATION_SECONDS = 10 * 60 + 30; // TODO: move to shared config otel core
24320
- const PACKAGE_VERSION_EXPORT = "1.2.31" || 0;
24320
+ const PACKAGE_VERSION_EXPORT = "1.2.32" || 0;
24321
24321
  // Regex patterns for OpenTelemetry ignore URLs
24322
24322
  const OTEL_IGNORE_URLS = [
24323
24323
  // Traces endpoint
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@multiplayer-app/session-recorder-browser",
3
- "version": "1.2.31",
3
+ "version": "1.2.32",
4
4
  "description": "Multiplayer Fullstack Session Recorder for Browser",
5
5
  "author": {
6
6
  "name": "Multiplayer Software, Inc.",
@@ -70,7 +70,7 @@
70
70
  "webpack-cli": "5.1.4"
71
71
  },
72
72
  "dependencies": {
73
- "@multiplayer-app/session-recorder-common": "1.2.31",
73
+ "@multiplayer-app/session-recorder-common": "1.2.32",
74
74
  "@opentelemetry/auto-instrumentations-web": "0.49.0",
75
75
  "@opentelemetry/context-zone": "2.0.1",
76
76
  "@opentelemetry/core": "2.0.1",