@amplitude/plugin-session-replay-browser 1.32.0-sr-4646-rc2.0 → 1.32.0-sr-perf-reliability-rc2.0

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
@@ -63,6 +63,7 @@ const sessionReplayTracking = sessionReplayPlugin({
63
63
  |`storeType`|`string`|No|`idb`|Specifies how replay events should be stored. `idb` uses IndexedDB to persist replay events when all events cannot be sent during capture. `memory` stores replay events only in memory, meaning events are lost when the page is closed. If IndexedDB is unavailable, the system falls back to `memory`.|
64
64
  |`performanceConfig.enabled`|`boolean`|No|`true`|If enabled, event compression will be deferred to occur during the browser's idle periods.|
65
65
  |`performanceConfig.timeout`|`number`|No|`undefined`|Optional timeout in milliseconds for the `requestIdleCallback` API. If specified, this value will be used to set a maximum time for the browser to wait before executing the deferred compression task, even if the browser is not idle.|
66
+ |`performanceConfig.mergeMutations`|`boolean`|No|`false`|If enabled, consecutive mutation events are merged into a single event before compression. This reduces the stored event count and coalesces bursts of inline `style` mutations on the same node (last-write-wins), without changing replay semantics.|
66
67
  |`experimental.useWebWorker`|`boolean`|No|`false`|If the SDK should compress the replay events using a webworker.|
67
68
 
68
69
  ### 3. Install plugin to Amplitude SDK
@@ -43,6 +43,13 @@ export interface InteractionPerformanceConfig {
43
43
  export interface SessionReplayPerformanceConfig {
44
44
  enabled: boolean;
45
45
  timeout?: number;
46
+ /**
47
+ * If enabled, consecutive mutation events are merged into a single event before
48
+ * compression. This reduces the stored event count and coalesces bursts of
49
+ * inline `style` mutations on the same node (last-write-wins), without changing
50
+ * replay semantics. Defaults to false.
51
+ */
52
+ mergeMutations?: boolean;
46
53
  /**
47
54
  * Performance configuration for interaction tracking (clicks, scrolls).
48
55
  */
@@ -1 +1 @@
1
- {"version":3,"file":"session-replay.d.ts","sourceRoot":"","sources":["../../../src/typings/session-replay.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,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G;IACH,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC;;OAEG;IACH,2BAA2B,CAAC,EAAE,MAAM,CAAC;IACrC;;OAEG;IACH,uBAAuB,CAAC,EAAE,MAAM,CAAC;CAClC"}
1
+ {"version":3,"file":"session-replay.d.ts","sourceRoot":"","sources":["../../../src/typings/session-replay.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAClD,OAAO,EACL,SAAS,EAET,KAAK,oBAAoB,IAAI,8BAA8B,EAC5D,MAAM,mCAAmC,CAAC;AAE3C;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG,WAAW,CAAC,8BAA8B,CAAC,oBAAoB,CAAC,CAAC,CAAC;AAEzG;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,WAAW,CAAC,8BAA8B,CAAC,qBAAqB,CAAC,CAAC,CAAC;AAErG,MAAM,MAAM,SAAS,GACjB,OAAO,GACP,QAAQ,GACR,cAAc,CAAC;AAEnB,MAAM,WAAW,0BAA0B;IACzC,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAClC,gBAAgB,CAAC,EAAE,SAAS,CAAC;IAC7B,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,8BAA8B;IAC7C,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;OAEG;IACH,WAAW,CAAC,EAAE,4BAA4B,CAA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;;;;OAKG;IACH,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC;;;;;OAKG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B;;OAEG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC;;OAEG;IACH,kBAAkB,CAAC,EAAE,wBAAwB,CAAC;IAC9C;;OAEG;IACH,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C;;OAEG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;OAEG;IACH,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC;;OAEG;IACH,2BAA2B,CAAC,EAAE,MAAM,CAAC;IACrC;;OAEG;IACH,uBAAuB,CAAC,EAAE,MAAM,CAAC;CAClC"}
@@ -1 +1 @@
1
- {"version":3,"file":"session-replay.js","sourceRoot":"","sources":["../../../src/typings/session-replay.ts"],"names":[],"mappings":"","sourcesContent":["import { Event } from '@amplitude/analytics-core';\nimport {\n StoreType,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n type SessionReplayOptions as StandaloneSessionReplayOptions, // used for documentation\n} from '@amplitude/session-replay-browser';\n\n/**\n * Configuration for cross-origin iframe support.\n * Extracted from the standalone SDK's SessionReplayOptions.\n */\nexport type CrossOriginIframesConfig = NonNullable<StandaloneSessionReplayOptions['crossOriginIframes']>;\n\n/**\n * Configuration for rrweb event-split flush cadence.\n * Extracted from the standalone SDK's SessionReplayOptions.\n */\nexport type FlushIntervalConfig = NonNullable<StandaloneSessionReplayOptions['flushIntervalConfig']>;\n\nexport type MaskLevel =\n | 'light' // only mask a subset of inputs that’s deemed sensitive - password, credit card, telephone #, email. These are information we never want to capture.\n | 'medium' // mask all inputs\n | 'conservative'; // mask all inputs and all texts\n\nexport interface SessionReplayPrivacyConfig {\n blockSelector?: string | string[];\n defaultMaskLevel?: MaskLevel;\n maskSelector?: string[];\n unmaskSelector?: string[];\n}\n\n/**\n * Performance configuration for interaction tracking, specifically for CSS selector generation.\n */\nexport interface InteractionPerformanceConfig {\n /**\n * Maximum time in milliseconds allowed for CSS selector generation.\n * If selector generation takes longer than this, it will throw a timeout error.\n * Default: undefined (no timeout limit)\n */\n timeoutMs?: number;\n /**\n * Maximum number of attempts to optimize/simplify the CSS selector path.\n * Higher values may produce shorter selectors but take longer to compute.\n * Default: 10000\n */\n maxNumberOfTries?: number;\n /**\n * Maximum number of CSS selector combinations to test for uniqueness.\n * If more combinations would be generated, falls back to a simpler strategy.\n * Default: 1000\n */\n threshold?: number;\n}\n\nexport interface SessionReplayPerformanceConfig {\n enabled: boolean;\n timeout?: number;\n /**\n * Performance configuration for interaction tracking (clicks, scrolls).\n */\n interaction?: InteractionPerformanceConfig;\n}\n\n/**\n * UGC filter rule.\n */\nexport type UGCFilterRule = {\n /**\n * The selector of the UGC element.\n */\n selector: string;\n /**\n * The replacement text for the UGC element.\n */\n replacement: string;\n};\n\nexport interface SessionReplayInteractionConfig {\n trackEveryNms?: number;\n enabled: boolean; // defaults to false\n batch: boolean; // defaults to false\n /**\n * UGC filter rules.\n */\n ugcFilterRules?: UGCFilterRule[];\n}\n\nexport interface SessionReplayOptions {\n /**\n * @see {@link StandaloneSessionReplayOptions.sampleRate}\n */\n sampleRate?: number;\n /**\n * @see {@link StandaloneSessionReplayOptions.privacyConfig}\n */\n privacyConfig?: SessionReplayPrivacyConfig;\n /**\n * @see {@link StandaloneSessionReplayOptions.debugMode}\n */\n debugMode?: boolean;\n /**\n * If this is enabled we will force the browser SDK to also send start and end session events.\n */\n forceSessionTracking?: boolean;\n /**\n * @see {@link StandaloneSessionReplayOptions.configServerUrl}\n */\n configServerUrl?: string;\n /**\n * @see {@link StandaloneSessionReplayOptions.trackServerUrl}\n */\n trackServerUrl?: string;\n /**\n * @see {@link StandaloneSessionReplayOptions.shouldInlineStylesheet}\n */\n shouldInlineStylesheet?: boolean;\n /**\n * @see {@link StandaloneSessionReplayOptions.performanceConfig}\n */\n performanceConfig?: SessionReplayPerformanceConfig;\n /**\n * @see {@link StandaloneSessionReplayOptions.storeType}\n */\n storeType?: StoreType;\n /**\n * If true, the SDK will compress replay events using a web worker.\n * This offloads compression to a separate thread, improving performance on the main thread.\n *\n * @defaultValue false\n */\n useWebWorker?: boolean;\n /**\n * Override the device ID for session replay.\n */\n deviceId?: string;\n /**\n * Dynamically overrides the session ID for replay. Ensure stability to avoid frequent restarts.\n * @param event Browser SDK event\n * @returns The session ID for the session replay.\n */\n customSessionId?: (event: Event) => string | undefined;\n /**\n * @deprecated Use `useWebWorker` instead. This will be removed in a future version.\n * @see {@link StandaloneSessionReplayOptions.useWebWorker}\n */\n experimental?: {\n useWebWorker: boolean;\n };\n /**\n * If true, applies a background color to blocked elements for visual masking. Defaults to false.\n */\n applyBackgroundColorToBlockedElements?: boolean;\n\n interactionConfig?: SessionReplayInteractionConfig;\n\n /**\n * Enables URL change polling as a fallback for SPA route tracking.\n * When enabled, the SDK will periodically check for URL changes every second\n * in addition to patching the History API. This is useful for edge cases where\n * route changes might bypass the standard History API methods.\n *\n * @defaultValue false\n */\n enableUrlChangePolling?: boolean;\n /**\n * Specifies the interval in milliseconds for URL change polling when enableUrlChangePolling is true.\n * The SDK will check for URL changes at this interval as a fallback for SPA route tracking.\n *\n * @defaultValue 1000\n */\n urlChangePollingInterval?: number;\n /**\n * Whether to capture document title in URL change events.\n * When disabled, the title field will be empty in URL change events.\n *\n * @defaultValue false\n */\n captureDocumentTitle?: boolean;\n /**\n * @see {@link StandaloneSessionReplayOptions.captureAdoptedStyleSheets}\n */\n captureAdoptedStyleSheets?: boolean;\n /**\n * @see {@link StandaloneSessionReplayOptions.crossOriginIframes}\n */\n crossOriginIframes?: CrossOriginIframesConfig;\n /**\n * @see {@link StandaloneSessionReplayOptions.flushIntervalConfig}\n */\n flushIntervalConfig?: FlushIntervalConfig;\n /**\n * @see {@link StandaloneSessionReplayOptions.eagerFullSnapshotSend}\n */\n eagerFullSnapshotSend?: boolean;\n /**\n * @see {@link StandaloneSessionReplayOptions.captureFullSnapshotOnFocus}\n */\n captureFullSnapshotOnFocus?: boolean;\n /**\n * @see {@link StandaloneSessionReplayOptions.maxPersistedEventsSizeBytes}\n */\n maxPersistedEventsSizeBytes?: number;\n /**\n * @see {@link StandaloneSessionReplayOptions.maxSingleEventSizeBytes}\n */\n maxSingleEventSizeBytes?: number;\n}\n"]}
1
+ {"version":3,"file":"session-replay.js","sourceRoot":"","sources":["../../../src/typings/session-replay.ts"],"names":[],"mappings":"","sourcesContent":["import { Event } from '@amplitude/analytics-core';\nimport {\n StoreType,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n type SessionReplayOptions as StandaloneSessionReplayOptions, // used for documentation\n} from '@amplitude/session-replay-browser';\n\n/**\n * Configuration for cross-origin iframe support.\n * Extracted from the standalone SDK's SessionReplayOptions.\n */\nexport type CrossOriginIframesConfig = NonNullable<StandaloneSessionReplayOptions['crossOriginIframes']>;\n\n/**\n * Configuration for rrweb event-split flush cadence.\n * Extracted from the standalone SDK's SessionReplayOptions.\n */\nexport type FlushIntervalConfig = NonNullable<StandaloneSessionReplayOptions['flushIntervalConfig']>;\n\nexport type MaskLevel =\n | 'light' // only mask a subset of inputs that’s deemed sensitive - password, credit card, telephone #, email. These are information we never want to capture.\n | 'medium' // mask all inputs\n | 'conservative'; // mask all inputs and all texts\n\nexport interface SessionReplayPrivacyConfig {\n blockSelector?: string | string[];\n defaultMaskLevel?: MaskLevel;\n maskSelector?: string[];\n unmaskSelector?: string[];\n}\n\n/**\n * Performance configuration for interaction tracking, specifically for CSS selector generation.\n */\nexport interface InteractionPerformanceConfig {\n /**\n * Maximum time in milliseconds allowed for CSS selector generation.\n * If selector generation takes longer than this, it will throw a timeout error.\n * Default: undefined (no timeout limit)\n */\n timeoutMs?: number;\n /**\n * Maximum number of attempts to optimize/simplify the CSS selector path.\n * Higher values may produce shorter selectors but take longer to compute.\n * Default: 10000\n */\n maxNumberOfTries?: number;\n /**\n * Maximum number of CSS selector combinations to test for uniqueness.\n * If more combinations would be generated, falls back to a simpler strategy.\n * Default: 1000\n */\n threshold?: number;\n}\n\nexport interface SessionReplayPerformanceConfig {\n enabled: boolean;\n timeout?: number;\n /**\n * If enabled, consecutive mutation events are merged into a single event before\n * compression. This reduces the stored event count and coalesces bursts of\n * inline `style` mutations on the same node (last-write-wins), without changing\n * replay semantics. Defaults to false.\n */\n mergeMutations?: boolean;\n /**\n * Performance configuration for interaction tracking (clicks, scrolls).\n */\n interaction?: InteractionPerformanceConfig;\n}\n\n/**\n * UGC filter rule.\n */\nexport type UGCFilterRule = {\n /**\n * The selector of the UGC element.\n */\n selector: string;\n /**\n * The replacement text for the UGC element.\n */\n replacement: string;\n};\n\nexport interface SessionReplayInteractionConfig {\n trackEveryNms?: number;\n enabled: boolean; // defaults to false\n batch: boolean; // defaults to false\n /**\n * UGC filter rules.\n */\n ugcFilterRules?: UGCFilterRule[];\n}\n\nexport interface SessionReplayOptions {\n /**\n * @see {@link StandaloneSessionReplayOptions.sampleRate}\n */\n sampleRate?: number;\n /**\n * @see {@link StandaloneSessionReplayOptions.privacyConfig}\n */\n privacyConfig?: SessionReplayPrivacyConfig;\n /**\n * @see {@link StandaloneSessionReplayOptions.debugMode}\n */\n debugMode?: boolean;\n /**\n * If this is enabled we will force the browser SDK to also send start and end session events.\n */\n forceSessionTracking?: boolean;\n /**\n * @see {@link StandaloneSessionReplayOptions.configServerUrl}\n */\n configServerUrl?: string;\n /**\n * @see {@link StandaloneSessionReplayOptions.trackServerUrl}\n */\n trackServerUrl?: string;\n /**\n * @see {@link StandaloneSessionReplayOptions.shouldInlineStylesheet}\n */\n shouldInlineStylesheet?: boolean;\n /**\n * @see {@link StandaloneSessionReplayOptions.performanceConfig}\n */\n performanceConfig?: SessionReplayPerformanceConfig;\n /**\n * @see {@link StandaloneSessionReplayOptions.storeType}\n */\n storeType?: StoreType;\n /**\n * If true, the SDK will compress replay events using a web worker.\n * This offloads compression to a separate thread, improving performance on the main thread.\n *\n * @defaultValue false\n */\n useWebWorker?: boolean;\n /**\n * Override the device ID for session replay.\n */\n deviceId?: string;\n /**\n * Dynamically overrides the session ID for replay. Ensure stability to avoid frequent restarts.\n * @param event Browser SDK event\n * @returns The session ID for the session replay.\n */\n customSessionId?: (event: Event) => string | undefined;\n /**\n * @deprecated Use `useWebWorker` instead. This will be removed in a future version.\n * @see {@link StandaloneSessionReplayOptions.useWebWorker}\n */\n experimental?: {\n useWebWorker: boolean;\n };\n /**\n * If true, applies a background color to blocked elements for visual masking. Defaults to false.\n */\n applyBackgroundColorToBlockedElements?: boolean;\n\n interactionConfig?: SessionReplayInteractionConfig;\n\n /**\n * Enables URL change polling as a fallback for SPA route tracking.\n * When enabled, the SDK will periodically check for URL changes every second\n * in addition to patching the History API. This is useful for edge cases where\n * route changes might bypass the standard History API methods.\n *\n * @defaultValue false\n */\n enableUrlChangePolling?: boolean;\n /**\n * Specifies the interval in milliseconds for URL change polling when enableUrlChangePolling is true.\n * The SDK will check for URL changes at this interval as a fallback for SPA route tracking.\n *\n * @defaultValue 1000\n */\n urlChangePollingInterval?: number;\n /**\n * Whether to capture document title in URL change events.\n * When disabled, the title field will be empty in URL change events.\n *\n * @defaultValue false\n */\n captureDocumentTitle?: boolean;\n /**\n * @see {@link StandaloneSessionReplayOptions.captureAdoptedStyleSheets}\n */\n captureAdoptedStyleSheets?: boolean;\n /**\n * @see {@link StandaloneSessionReplayOptions.crossOriginIframes}\n */\n crossOriginIframes?: CrossOriginIframesConfig;\n /**\n * @see {@link StandaloneSessionReplayOptions.flushIntervalConfig}\n */\n flushIntervalConfig?: FlushIntervalConfig;\n /**\n * @see {@link StandaloneSessionReplayOptions.eagerFullSnapshotSend}\n */\n eagerFullSnapshotSend?: boolean;\n /**\n * @see {@link StandaloneSessionReplayOptions.captureFullSnapshotOnFocus}\n */\n captureFullSnapshotOnFocus?: boolean;\n /**\n * @see {@link StandaloneSessionReplayOptions.maxPersistedEventsSizeBytes}\n */\n maxPersistedEventsSizeBytes?: number;\n /**\n * @see {@link StandaloneSessionReplayOptions.maxSingleEventSizeBytes}\n */\n maxSingleEventSizeBytes?: number;\n}\n"]}
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.32.0-sr-4646-rc2.0";
1
+ export declare const VERSION = "1.32.0-sr-perf-reliability-rc2.0";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,OAAO,yBAAyB,CAAC"}
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,OAAO,qCAAqC,CAAC"}
@@ -2,5 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
4
  // Autogenerated by `pnpm version-file`. DO NOT EDIT
5
- exports.VERSION = '1.32.0-sr-4646-rc2.0';
5
+ exports.VERSION = '1.32.0-sr-perf-reliability-rc2.0';
6
6
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";;;AAAA,oDAAoD;AACvC,QAAA,OAAO,GAAG,sBAAsB,CAAC","sourcesContent":["// Autogenerated by `pnpm version-file`. DO NOT EDIT\nexport const VERSION = '1.32.0-sr-4646-rc2.0';\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";;;AAAA,oDAAoD;AACvC,QAAA,OAAO,GAAG,kCAAkC,CAAC","sourcesContent":["// Autogenerated by `pnpm version-file`. DO NOT EDIT\nexport const VERSION = '1.32.0-sr-perf-reliability-rc2.0';\n"]}
@@ -43,6 +43,13 @@ export interface InteractionPerformanceConfig {
43
43
  export interface SessionReplayPerformanceConfig {
44
44
  enabled: boolean;
45
45
  timeout?: number;
46
+ /**
47
+ * If enabled, consecutive mutation events are merged into a single event before
48
+ * compression. This reduces the stored event count and coalesces bursts of
49
+ * inline `style` mutations on the same node (last-write-wins), without changing
50
+ * replay semantics. Defaults to false.
51
+ */
52
+ mergeMutations?: boolean;
46
53
  /**
47
54
  * Performance configuration for interaction tracking (clicks, scrolls).
48
55
  */
@@ -1 +1 @@
1
- {"version":3,"file":"session-replay.d.ts","sourceRoot":"","sources":["../../../src/typings/session-replay.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAClD,OAAO,EACL,SAAS,EAET,KAAK,oBAAoB,IAAI,8BAA8B,EAC5D,MAAM,mCAAmC,CAAC;AAE3C;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG,WAAW,CAAC,8BAA8B,CAAC,oBAAoB,CAAC,CAAC,CAAC;AAEzG;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,WAAW,CAAC,8BAA8B,CAAC,qBAAqB,CAAC,CAAC,CAAC;AAErG,MAAM,MAAM,SAAS,GACjB,OAAO,GACP,QAAQ,GACR,cAAc,CAAC;AAEnB,MAAM,WAAW,0BAA0B;IACzC,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAClC,gBAAgB,CAAC,EAAE,SAAS,CAAC;IAC7B,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,8BAA8B;IAC7C,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,WAAW,CAAC,EAAE,4BAA4B,CAAC;CAC5C;AAED;;GAEG;AACH,MAAM,MAAM,aAA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CAAC;IAClC;;;;;OAKG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B;;OAEG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC;;OAEG;IACH,kBAAkB,CAAC,EAAE,wBAAwB,CAAC;IAC9C;;OAEG;IACH,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C;;OAEG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;OAEG;IACH,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC;;OAEG;IACH,2BAA2B,CAAC,EAAE,MAAM,CAAC;IACrC;;OAEG;IACH,uBAAuB,CAAC,EAAE,MAAM,CAAC;CAClC"}
1
+ {"version":3,"file":"session-replay.d.ts","sourceRoot":"","sources":["../../../src/typings/session-replay.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAClD,OAAO,EACL,SAAS,EAET,KAAK,oBAAoB,IAAI,8BAA8B,EAC5D,MAAM,mCAAmC,CAAC;AAE3C;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG,WAAW,CAAC,8BAA8B,CAAC,oBAAoB,CAAC,CAAC,CAAC;AAEzG;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,WAAW,CAAC,8BAA8B,CAAC,qBAAqB,CAAC,CAAC,CAAC;AAErG,MAAM,MAAM,SAAS,GACjB,OAAO,GACP,QAAQ,GACR,cAAc,CAAC;AAEnB,MAAM,WAAW,0BAA0B;IACzC,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAClC,gBAAgB,CAAC,EAAE,SAAS,CAAC;IAC7B,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,g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KAAK,EAAE,KAAK,KAAK,MAAM,GAAG,SAAS,CAAC;IACvD;;;OAGG;IACH,YAAY,CAAC,EAAE;QACb,YAAY,EAAE,OAAO,CAAC;KACvB,CAAC;IACF;;OAEG;IACH,qCAAqC,CAAC,EAAE,OAAO,CAAC;IAEhD,iBAAiB,CAAC,EAAE,8BAA8B,CAAC;IAEnD;;;;;;;OAOG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC;;;;;OAKG;IACH,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC;;;;;OAKG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B;;OAEG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC;;OAEG;IACH,kBAAkB,CAAC,EAAE,wBAAwB,CAAC;IAC9C;;OAEG;IACH,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C;;OAEG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;OAEG;IACH,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC;;OAEG;IACH,2BAA2B,CAAC,EAAE,MAAM,CAAC;IACrC;;OAEG;IACH,uBAAuB,CAAC,EAAE,MAAM,CAAC;CAClC"}
@@ -1 +1 @@
1
- {"version":3,"file":"session-replay.js","sourceRoot":"","sources":["../../../src/typings/session-replay.ts"],"names":[],"mappings":"","sourcesContent":["import { Event } from '@amplitude/analytics-core';\nimport {\n StoreType,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n type SessionReplayOptions as StandaloneSessionReplayOptions, // used for documentation\n} from '@amplitude/session-replay-browser';\n\n/**\n * Configuration for cross-origin iframe support.\n * Extracted from the standalone SDK's SessionReplayOptions.\n */\nexport type CrossOriginIframesConfig = NonNullable<StandaloneSessionReplayOptions['crossOriginIframes']>;\n\n/**\n * Configuration for rrweb event-split flush cadence.\n * Extracted from the standalone SDK's SessionReplayOptions.\n */\nexport type FlushIntervalConfig = NonNullable<StandaloneSessionReplayOptions['flushIntervalConfig']>;\n\nexport type MaskLevel =\n | 'light' // only mask a subset of inputs that’s deemed sensitive - password, credit card, telephone #, email. These are information we never want to capture.\n | 'medium' // mask all inputs\n | 'conservative'; // mask all inputs and all texts\n\nexport interface SessionReplayPrivacyConfig {\n blockSelector?: string | string[];\n defaultMaskLevel?: MaskLevel;\n maskSelector?: string[];\n unmaskSelector?: string[];\n}\n\n/**\n * Performance configuration for interaction tracking, specifically for CSS selector generation.\n */\nexport interface InteractionPerformanceConfig {\n /**\n * Maximum time in milliseconds allowed for CSS selector generation.\n * If selector generation takes longer than this, it will throw a timeout error.\n * Default: undefined (no timeout limit)\n */\n timeoutMs?: number;\n /**\n * Maximum number of attempts to optimize/simplify the CSS selector path.\n * Higher values may produce shorter selectors but take longer to compute.\n * Default: 10000\n */\n maxNumberOfTries?: number;\n /**\n * Maximum number of CSS selector combinations to test for uniqueness.\n * If more combinations would be generated, falls back to a simpler strategy.\n * Default: 1000\n */\n threshold?: number;\n}\n\nexport interface SessionReplayPerformanceConfig {\n enabled: boolean;\n timeout?: number;\n /**\n * Performance configuration for interaction tracking (clicks, scrolls).\n */\n interaction?: InteractionPerformanceConfig;\n}\n\n/**\n * UGC filter rule.\n */\nexport type UGCFilterRule = {\n /**\n * The selector of the UGC element.\n */\n selector: string;\n /**\n * The replacement text for the UGC element.\n */\n replacement: string;\n};\n\nexport interface SessionReplayInteractionConfig {\n trackEveryNms?: number;\n enabled: boolean; // defaults to false\n batch: boolean; // defaults to false\n /**\n * UGC filter rules.\n */\n ugcFilterRules?: UGCFilterRule[];\n}\n\nexport interface SessionReplayOptions {\n /**\n * @see {@link StandaloneSessionReplayOptions.sampleRate}\n */\n sampleRate?: number;\n /**\n * @see {@link StandaloneSessionReplayOptions.privacyConfig}\n */\n privacyConfig?: SessionReplayPrivacyConfig;\n /**\n * @see {@link StandaloneSessionReplayOptions.debugMode}\n */\n debugMode?: boolean;\n /**\n * If this is enabled we will force the browser SDK to also send start and end session events.\n */\n forceSessionTracking?: boolean;\n /**\n * @see {@link StandaloneSessionReplayOptions.configServerUrl}\n */\n configServerUrl?: string;\n /**\n * @see {@link StandaloneSessionReplayOptions.trackServerUrl}\n */\n trackServerUrl?: string;\n /**\n * @see {@link StandaloneSessionReplayOptions.shouldInlineStylesheet}\n */\n shouldInlineStylesheet?: boolean;\n /**\n * @see {@link StandaloneSessionReplayOptions.performanceConfig}\n */\n performanceConfig?: SessionReplayPerformanceConfig;\n /**\n * @see {@link StandaloneSessionReplayOptions.storeType}\n */\n storeType?: StoreType;\n /**\n * If true, the SDK will compress replay events using a web worker.\n * This offloads compression to a separate thread, improving performance on the main thread.\n *\n * @defaultValue false\n */\n useWebWorker?: boolean;\n /**\n * Override the device ID for session replay.\n */\n deviceId?: string;\n /**\n * Dynamically overrides the session ID for replay. Ensure stability to avoid frequent restarts.\n * @param event Browser SDK event\n * @returns The session ID for the session replay.\n */\n customSessionId?: (event: Event) => string | undefined;\n /**\n * @deprecated Use `useWebWorker` instead. This will be removed in a future version.\n * @see {@link StandaloneSessionReplayOptions.useWebWorker}\n */\n experimental?: {\n useWebWorker: boolean;\n };\n /**\n * If true, applies a background color to blocked elements for visual masking. Defaults to false.\n */\n applyBackgroundColorToBlockedElements?: boolean;\n\n interactionConfig?: SessionReplayInteractionConfig;\n\n /**\n * Enables URL change polling as a fallback for SPA route tracking.\n * When enabled, the SDK will periodically check for URL changes every second\n * in addition to patching the History API. This is useful for edge cases where\n * route changes might bypass the standard History API methods.\n *\n * @defaultValue false\n */\n enableUrlChangePolling?: boolean;\n /**\n * Specifies the interval in milliseconds for URL change polling when enableUrlChangePolling is true.\n * The SDK will check for URL changes at this interval as a fallback for SPA route tracking.\n *\n * @defaultValue 1000\n */\n urlChangePollingInterval?: number;\n /**\n * Whether to capture document title in URL change events.\n * When disabled, the title field will be empty in URL change events.\n *\n * @defaultValue false\n */\n captureDocumentTitle?: boolean;\n /**\n * @see {@link StandaloneSessionReplayOptions.captureAdoptedStyleSheets}\n */\n captureAdoptedStyleSheets?: boolean;\n /**\n * @see {@link StandaloneSessionReplayOptions.crossOriginIframes}\n */\n crossOriginIframes?: CrossOriginIframesConfig;\n /**\n * @see {@link StandaloneSessionReplayOptions.flushIntervalConfig}\n */\n flushIntervalConfig?: FlushIntervalConfig;\n /**\n * @see {@link StandaloneSessionReplayOptions.eagerFullSnapshotSend}\n */\n eagerFullSnapshotSend?: boolean;\n /**\n * @see {@link StandaloneSessionReplayOptions.captureFullSnapshotOnFocus}\n */\n captureFullSnapshotOnFocus?: boolean;\n /**\n * @see {@link StandaloneSessionReplayOptions.maxPersistedEventsSizeBytes}\n */\n maxPersistedEventsSizeBytes?: number;\n /**\n * @see {@link StandaloneSessionReplayOptions.maxSingleEventSizeBytes}\n */\n maxSingleEventSizeBytes?: number;\n}\n"]}
1
+ {"version":3,"file":"session-replay.js","sourceRoot":"","sources":["../../../src/typings/session-replay.ts"],"names":[],"mappings":"","sourcesContent":["import { Event } from '@amplitude/analytics-core';\nimport {\n StoreType,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n type SessionReplayOptions as StandaloneSessionReplayOptions, // used for documentation\n} from '@amplitude/session-replay-browser';\n\n/**\n * Configuration for cross-origin iframe support.\n * Extracted from the standalone SDK's SessionReplayOptions.\n */\nexport type CrossOriginIframesConfig = NonNullable<StandaloneSessionReplayOptions['crossOriginIframes']>;\n\n/**\n * Configuration for rrweb event-split flush cadence.\n * Extracted from the standalone SDK's SessionReplayOptions.\n */\nexport type FlushIntervalConfig = NonNullable<StandaloneSessionReplayOptions['flushIntervalConfig']>;\n\nexport type MaskLevel =\n | 'light' // only mask a subset of inputs that’s deemed sensitive - password, credit card, telephone #, email. These are information we never want to capture.\n | 'medium' // mask all inputs\n | 'conservative'; // mask all inputs and all texts\n\nexport interface SessionReplayPrivacyConfig {\n blockSelector?: string | string[];\n defaultMaskLevel?: MaskLevel;\n maskSelector?: string[];\n unmaskSelector?: string[];\n}\n\n/**\n * Performance configuration for interaction tracking, specifically for CSS selector generation.\n */\nexport interface InteractionPerformanceConfig {\n /**\n * Maximum time in milliseconds allowed for CSS selector generation.\n * If selector generation takes longer than this, it will throw a timeout error.\n * Default: undefined (no timeout limit)\n */\n timeoutMs?: number;\n /**\n * Maximum number of attempts to optimize/simplify the CSS selector path.\n * Higher values may produce shorter selectors but take longer to compute.\n * Default: 10000\n */\n maxNumberOfTries?: number;\n /**\n * Maximum number of CSS selector combinations to test for uniqueness.\n * If more combinations would be generated, falls back to a simpler strategy.\n * Default: 1000\n */\n threshold?: number;\n}\n\nexport interface SessionReplayPerformanceConfig {\n enabled: boolean;\n timeout?: number;\n /**\n * If enabled, consecutive mutation events are merged into a single event before\n * compression. This reduces the stored event count and coalesces bursts of\n * inline `style` mutations on the same node (last-write-wins), without changing\n * replay semantics. Defaults to false.\n */\n mergeMutations?: boolean;\n /**\n * Performance configuration for interaction tracking (clicks, scrolls).\n */\n interaction?: InteractionPerformanceConfig;\n}\n\n/**\n * UGC filter rule.\n */\nexport type UGCFilterRule = {\n /**\n * The selector of the UGC element.\n */\n selector: string;\n /**\n * The replacement text for the UGC element.\n */\n replacement: string;\n};\n\nexport interface SessionReplayInteractionConfig {\n trackEveryNms?: number;\n enabled: boolean; // defaults to false\n batch: boolean; // defaults to false\n /**\n * UGC filter rules.\n */\n ugcFilterRules?: UGCFilterRule[];\n}\n\nexport interface SessionReplayOptions {\n /**\n * @see {@link StandaloneSessionReplayOptions.sampleRate}\n */\n sampleRate?: number;\n /**\n * @see {@link StandaloneSessionReplayOptions.privacyConfig}\n */\n privacyConfig?: SessionReplayPrivacyConfig;\n /**\n * @see {@link StandaloneSessionReplayOptions.debugMode}\n */\n debugMode?: boolean;\n /**\n * If this is enabled we will force the browser SDK to also send start and end session events.\n */\n forceSessionTracking?: boolean;\n /**\n * @see {@link StandaloneSessionReplayOptions.configServerUrl}\n */\n configServerUrl?: string;\n /**\n * @see {@link StandaloneSessionReplayOptions.trackServerUrl}\n */\n trackServerUrl?: string;\n /**\n * @see {@link StandaloneSessionReplayOptions.shouldInlineStylesheet}\n */\n shouldInlineStylesheet?: boolean;\n /**\n * @see {@link StandaloneSessionReplayOptions.performanceConfig}\n */\n performanceConfig?: SessionReplayPerformanceConfig;\n /**\n * @see {@link StandaloneSessionReplayOptions.storeType}\n */\n storeType?: StoreType;\n /**\n * If true, the SDK will compress replay events using a web worker.\n * This offloads compression to a separate thread, improving performance on the main thread.\n *\n * @defaultValue false\n */\n useWebWorker?: boolean;\n /**\n * Override the device ID for session replay.\n */\n deviceId?: string;\n /**\n * Dynamically overrides the session ID for replay. Ensure stability to avoid frequent restarts.\n * @param event Browser SDK event\n * @returns The session ID for the session replay.\n */\n customSessionId?: (event: Event) => string | undefined;\n /**\n * @deprecated Use `useWebWorker` instead. This will be removed in a future version.\n * @see {@link StandaloneSessionReplayOptions.useWebWorker}\n */\n experimental?: {\n useWebWorker: boolean;\n };\n /**\n * If true, applies a background color to blocked elements for visual masking. Defaults to false.\n */\n applyBackgroundColorToBlockedElements?: boolean;\n\n interactionConfig?: SessionReplayInteractionConfig;\n\n /**\n * Enables URL change polling as a fallback for SPA route tracking.\n * When enabled, the SDK will periodically check for URL changes every second\n * in addition to patching the History API. This is useful for edge cases where\n * route changes might bypass the standard History API methods.\n *\n * @defaultValue false\n */\n enableUrlChangePolling?: boolean;\n /**\n * Specifies the interval in milliseconds for URL change polling when enableUrlChangePolling is true.\n * The SDK will check for URL changes at this interval as a fallback for SPA route tracking.\n *\n * @defaultValue 1000\n */\n urlChangePollingInterval?: number;\n /**\n * Whether to capture document title in URL change events.\n * When disabled, the title field will be empty in URL change events.\n *\n * @defaultValue false\n */\n captureDocumentTitle?: boolean;\n /**\n * @see {@link StandaloneSessionReplayOptions.captureAdoptedStyleSheets}\n */\n captureAdoptedStyleSheets?: boolean;\n /**\n * @see {@link StandaloneSessionReplayOptions.crossOriginIframes}\n */\n crossOriginIframes?: CrossOriginIframesConfig;\n /**\n * @see {@link StandaloneSessionReplayOptions.flushIntervalConfig}\n */\n flushIntervalConfig?: FlushIntervalConfig;\n /**\n * @see {@link StandaloneSessionReplayOptions.eagerFullSnapshotSend}\n */\n eagerFullSnapshotSend?: boolean;\n /**\n * @see {@link StandaloneSessionReplayOptions.captureFullSnapshotOnFocus}\n */\n captureFullSnapshotOnFocus?: boolean;\n /**\n * @see {@link StandaloneSessionReplayOptions.maxPersistedEventsSizeBytes}\n */\n maxPersistedEventsSizeBytes?: number;\n /**\n * @see {@link StandaloneSessionReplayOptions.maxSingleEventSizeBytes}\n */\n maxSingleEventSizeBytes?: number;\n}\n"]}
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.32.0-sr-4646-rc2.0";
1
+ export declare const VERSION = "1.32.0-sr-perf-reliability-rc2.0";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,OAAO,yBAAyB,CAAC"}
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,OAAO,qCAAqC,CAAC"}
@@ -1,3 +1,3 @@
1
1
  // Autogenerated by `pnpm version-file`. DO NOT EDIT
2
- export var VERSION = '1.32.0-sr-4646-rc2.0';
2
+ export var VERSION = '1.32.0-sr-perf-reliability-rc2.0';
3
3
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,MAAM,CAAC,IAAM,OAAO,GAAG,sBAAsB,CAAC","sourcesContent":["// Autogenerated by `pnpm version-file`. DO NOT EDIT\nexport const VERSION = '1.32.0-sr-4646-rc2.0';\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,MAAM,CAAC,IAAM,OAAO,GAAG,kCAAkC,CAAC","sourcesContent":["// Autogenerated by `pnpm version-file`. DO NOT EDIT\nexport const VERSION = '1.32.0-sr-perf-reliability-rc2.0';\n"]}