@amplitude/session-replay-browser 1.40.0 → 1.41.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.
Files changed (79) hide show
  1. package/README.md +85 -0
  2. package/lib/cjs/config/local-config.d.ts +2 -1
  3. package/lib/cjs/config/local-config.d.ts.map +1 -1
  4. package/lib/cjs/config/local-config.js +3 -0
  5. package/lib/cjs/config/local-config.js.map +1 -1
  6. package/lib/cjs/config/types.d.ts +26 -0
  7. package/lib/cjs/config/types.d.ts.map +1 -1
  8. package/lib/cjs/config/types.js.map +1 -1
  9. package/lib/cjs/constants.d.ts +2 -0
  10. package/lib/cjs/constants.d.ts.map +1 -1
  11. package/lib/cjs/constants.js +3 -1
  12. package/lib/cjs/constants.js.map +1 -1
  13. package/lib/cjs/cross-origin-iframes.d.ts +28 -0
  14. package/lib/cjs/cross-origin-iframes.d.ts.map +1 -0
  15. package/lib/cjs/cross-origin-iframes.js +175 -0
  16. package/lib/cjs/cross-origin-iframes.js.map +1 -0
  17. package/lib/cjs/events/events-idb-store.d.ts +25 -4
  18. package/lib/cjs/events/events-idb-store.d.ts.map +1 -1
  19. package/lib/cjs/events/events-idb-store.js +257 -61
  20. package/lib/cjs/events/events-idb-store.js.map +1 -1
  21. package/lib/cjs/session-replay.d.ts +4 -0
  22. package/lib/cjs/session-replay.d.ts.map +1 -1
  23. package/lib/cjs/session-replay.js +118 -51
  24. package/lib/cjs/session-replay.js.map +1 -1
  25. package/lib/cjs/track-destination.d.ts.map +1 -1
  26. package/lib/cjs/track-destination.js +5 -1
  27. package/lib/cjs/track-destination.js.map +1 -1
  28. package/lib/cjs/utils/rrweb.d.ts +1 -0
  29. package/lib/cjs/utils/rrweb.d.ts.map +1 -1
  30. package/lib/cjs/utils/rrweb.js.map +1 -1
  31. package/lib/cjs/version.d.ts +1 -1
  32. package/lib/cjs/version.js +1 -1
  33. package/lib/cjs/version.js.map +1 -1
  34. package/lib/cjs/worker/index.js +1 -1
  35. package/lib/esm/config/local-config.d.ts +2 -1
  36. package/lib/esm/config/local-config.d.ts.map +1 -1
  37. package/lib/esm/config/local-config.js +3 -0
  38. package/lib/esm/config/local-config.js.map +1 -1
  39. package/lib/esm/config/types.d.ts +26 -0
  40. package/lib/esm/config/types.d.ts.map +1 -1
  41. package/lib/esm/config/types.js.map +1 -1
  42. package/lib/esm/constants.d.ts +2 -0
  43. package/lib/esm/constants.d.ts.map +1 -1
  44. package/lib/esm/constants.js +2 -0
  45. package/lib/esm/constants.js.map +1 -1
  46. package/lib/esm/cross-origin-iframes.d.ts +28 -0
  47. package/lib/esm/cross-origin-iframes.d.ts.map +1 -0
  48. package/lib/esm/cross-origin-iframes.js +170 -0
  49. package/lib/esm/cross-origin-iframes.js.map +1 -0
  50. package/lib/esm/events/events-idb-store.d.ts +25 -4
  51. package/lib/esm/events/events-idb-store.d.ts.map +1 -1
  52. package/lib/esm/events/events-idb-store.js +255 -61
  53. package/lib/esm/events/events-idb-store.js.map +1 -1
  54. package/lib/esm/session-replay.d.ts +4 -0
  55. package/lib/esm/session-replay.d.ts.map +1 -1
  56. package/lib/esm/session-replay.js +118 -51
  57. package/lib/esm/session-replay.js.map +1 -1
  58. package/lib/esm/track-destination.d.ts.map +1 -1
  59. package/lib/esm/track-destination.js +6 -2
  60. package/lib/esm/track-destination.js.map +1 -1
  61. package/lib/esm/utils/rrweb.d.ts +1 -0
  62. package/lib/esm/utils/rrweb.d.ts.map +1 -1
  63. package/lib/esm/utils/rrweb.js.map +1 -1
  64. package/lib/esm/version.d.ts +1 -1
  65. package/lib/esm/version.js +1 -1
  66. package/lib/esm/version.js.map +1 -1
  67. package/lib/esm/worker/index.js +1 -1
  68. package/lib/scripts/index-min.js +1 -1
  69. package/lib/scripts/index-min.js.gz +0 -0
  70. package/lib/scripts/index-min.js.map +1 -1
  71. package/lib/scripts/session-replay-browser-min.js +1 -1
  72. package/lib/scripts/session-replay-browser-min.js.gz +0 -0
  73. package/lib/scripts/session-replay-browser-min.js.map +1 -1
  74. package/lib/scripts/targeting-min.js +1 -1
  75. package/lib/scripts/targeting-min.js.gz +0 -0
  76. package/lib/scripts/targeting-min.js.map +1 -1
  77. package/lib/scripts/worker-min.js +1 -1
  78. package/lib/scripts/worker-min.js.gz +0 -0
  79. package/package.json +4 -4
@@ -1,6 +1,6 @@
1
1
  import { Config, Logger, FetchTransport, LogLevel } from '@amplitude/analytics-core';
2
2
  import { SessionReplayOptions, StoreType } from '../typings/session-replay';
3
- import { SessionReplayLocalConfig as ISessionReplayLocalConfig, InteractionConfig, PrivacyConfig, SessionReplayPerformanceConfig, SessionReplayVersion } from './types';
3
+ import { SessionReplayLocalConfig as ISessionReplayLocalConfig, CrossOriginIframesConfig, InteractionConfig, PrivacyConfig, SessionReplayPerformanceConfig, SessionReplayVersion } from './types';
4
4
  export declare const getDefaultConfig: () => {
5
5
  flushMaxRetries: number;
6
6
  logLevel: LogLevel;
@@ -29,6 +29,7 @@ export declare class SessionReplayLocalConfig extends Config implements ISession
29
29
  urlChangePollingInterval?: number;
30
30
  captureDocumentTitle?: boolean;
31
31
  captureAdoptedStyleSheets?: boolean;
32
+ crossOriginIframes?: CrossOriginIframesConfig;
32
33
  constructor(apiKey: string, options: SessionReplayOptions);
33
34
  }
34
35
  //# sourceMappingURL=local-config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"local-config.d.ts","sourceRoot":"","sources":["../../../src/config/local-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAOrF,OAAO,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAC5E,OAAO,EACL,wBAAwB,IAAI,yBAAyB,EACrD,iBAAiB,EACjB,aAAa,EACb,8BAA8B,EAC9B,oBAAoB,EACrB,MAAM,SAAS,CAAC;AAIjB,eAAO,MAAM,gBAAgB;;;;;CAK3B,CAAC;AAEH,qBA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K3B,CAAC;AAEH,qBAAa,wBAAyB,SAAQ,MAAO,YAAW,yBAAyB;IACvF,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAC/B,SAAS,EAAE,SAAS,CAAC;IACrB,iBAAiB,CAAC,EAAE,8BAA8B,CAAC;IACnD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,qCAAqC,CAAC,EAAE,OAAO,CAAC;IAChD,eAAe,CAAC,EAAE;QAChB,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,OAAO,CAAC,EAAE,OAAO,CAAC;KACnB,CAAC;IACF,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,kBAAkB,CAAC,EAAE,wBAAwB,CAAC;gBAElC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,oBAAoB;CA0D1D"}
@@ -60,6 +60,9 @@ var SessionReplayLocalConfig = /** @class */ (function (_super) {
60
60
  _this.omitElementTags = options.omitElementTags;
61
61
  }
62
62
  _this.captureAdoptedStyleSheets = (_g = options.captureAdoptedStyleSheets) !== null && _g !== void 0 ? _g : true;
63
+ if (options.crossOriginIframes) {
64
+ _this.crossOriginIframes = options.crossOriginIframes;
65
+ }
63
66
  return _this;
64
67
  }
65
68
  return SessionReplayLocalConfig;
@@ -1 +1 @@
1
- {"version":3,"file":"local-config.js","sourceRoot":"","sources":["../../../src/config/local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AG,OAAwD,CAAC;YAC/E,IAAI,CAAA,MAAA,aAAa,CAAC,YAAY,0CAAE,YAAY,MAAK,SAAS,EAAE;gBAC1D,KAAI,CAAC,YAAY,GAAG,aAAa,CAAC,YAAY,CAAC,YAAY,CAAC;aAC7D;SACF;QACD,IAAI,OAAO,CAAC,eAAe,EAAE;YAC3B,KAAI,CAAC,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;SAChD;QACD,KAAI,CAAC,yBAAyB,GAAG,MAAA,OAAO,CAAC,yBAAyB,mCAAI,IAAI,CAAC;;IAC7E,CAAC;IACH,+BAAC;AAAD,CAAC,AA9ED,CAA8C,MAAM,GA8EnD","sourcesContent":["import { Config, Logger, FetchTransport, LogLevel } from '@amplitude/analytics-core';\nimport {\n DEFAULT_PERFORMANCE_CONFIG,\n DEFAULT_SAMPLE_RATE,\n DEFAULT_SERVER_ZONE,\n DEFAULT_URL_CHANGE_POLLING_INTERVAL,\n} from '../constants';\nimport { SessionReplayOptions, StoreType } from '../typings/session-replay';\nimport {\n SessionReplayLocalConfig as ISessionReplayLocalConfig,\n InteractionConfig,\n PrivacyConfig,\n SessionReplayPerformanceConfig,\n SessionReplayVersion,\n} from './types';\nimport { SafeLoggerProvider } from '../logger';\nimport { validateUGCFilterRules } from '../helpers';\n\nexport const getDefaultConfig = () => ({\n flushMaxRetries: 2,\n logLevel: LogLevel.Warn,\n loggerProvider: new Logger(),\n transportProvider: new FetchTransport(),\n});\n\nexport class SessionReplayLocalConfig extends Config implements ISessionReplayLocalConfig {\n apiKey: string;\n sampleRate: number;\n privacyConfig?: PrivacyConfig;\n interactionConfig?: InteractionConfig;\n debugMode?: boolean;\n configServerUrl?: string;\n trackServerUrl?: string;\n shouldInlineStylesheet?: boolean;\n version?: SessionReplayVersion;\n storeType: StoreType;\n performanceConfig?: SessionReplayPerformanceConfig;\n useWebWorker?: boolean;\n applyBackgroundColorToBlockedElements?: boolean;\n omitElementTags?: {\n script?: boolean;\n comment?: boolean;\n };\n enableUrlChangePolling?: boolean;\n urlChangePollingInterval?: number;\n captureDocumentTitle?: boolean;\n captureAdoptedStyleSheets?: boolean;\n\n constructor(apiKey: string, options: SessionReplayOptions) {\n const defaultConfig = getDefaultConfig();\n super({\n transportProvider: defaultConfig.transportProvider,\n loggerProvider: new SafeLoggerProvider(options.loggerProvider || defaultConfig.loggerProvider),\n ...options,\n apiKey,\n });\n this.flushMaxRetries =\n options.flushMaxRetries !== undefined && options.flushMaxRetries <= defaultConfig.flushMaxRetries\n ? options.flushMaxRetries\n : defaultConfig.flushMaxRetries;\n\n this.apiKey = apiKey;\n this.sampleRate = options.sampleRate || DEFAULT_SAMPLE_RATE;\n this.serverZone = options.serverZone || DEFAULT_SERVER_ZONE;\n this.configServerUrl = options.configServerUrl;\n this.trackServerUrl = options.trackServerUrl;\n this.shouldInlineStylesheet = options.shouldInlineStylesheet;\n this.version = options.version;\n this.performanceConfig = options.performanceConfig || DEFAULT_PERFORMANCE_CONFIG;\n this.storeType = options.storeType ?? 'idb';\n this.applyBackgroundColorToBlockedElements = options.applyBackgroundColorToBlockedElements ?? false;\n this.enableUrlChangePolling = options.enableUrlChangePolling ?? false;\n this.urlChangePollingInterval = options.urlChangePollingInterval ?? DEFAULT_URL_CHANGE_POLLING_INTERVAL;\n this.captureDocumentTitle = options.captureDocumentTitle ?? false;\n\n if (options.privacyConfig) {\n this.privacyConfig = options.privacyConfig;\n }\n if (options.interactionConfig) {\n this.interactionConfig = options.interactionConfig;\n\n // validate ugcFilterRules, throw error if invalid - throw error at the beginning of the config\n if (this.interactionConfig.ugcFilterRules) {\n validateUGCFilterRules(this.interactionConfig.ugcFilterRules);\n }\n }\n if (options.debugMode) {\n this.debugMode = options.debugMode;\n }\n // Support both new useWebWorker and legacy experimental.useWebWorker for backwards compatibility\n if (options.useWebWorker !== undefined) {\n this.useWebWorker = options.useWebWorker;\n } else {\n const legacyOptions = options as { experimental?: { useWebWorker?: boolean } };\n if (legacyOptions.experimental?.useWebWorker !== undefined) {\n this.useWebWorker = legacyOptions.experimental.useWebWorker;\n }\n }\n if (options.omitElementTags) {\n this.omitElementTags = options.omitElementTags;\n }\n this.captureAdoptedStyleSheets = options.captureAdoptedStyleSheets ?? true;\n }\n}\n"]}
1
+ {"version":3,"file":"local-config.js","sourceRoot":"","sources":["../../../src/config/local-config.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrF,OAAO,EACL,0BAA0B,EAC1B,mBAAmB,EACnB,mBAAmB,EACnB,mCAAmC,GACpC,MAAM,cAAc,CAAC;AAUtB,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAEpD,MAAM,CAAC,IAAM,gBAAgB,GAAG,cAAM,OAAA,CAAC;IACrC,eAAe,EAAE,CAAC;IAClB,QAAQ,EAAE,QAAQ,CAAC,IAAI;IACvB,cAAc,EAAE,IAAI,MAAM,EAAE;IAC5B,iBAAiB,EAAE,IAAI,cAAc,EAAE;CACxC,CAAC,EALoC,CAKpC,CAAC;AAEH;IAA8C,4CAAM;IAwBlD,kCAAY,MAAc,EAAE,OAA6B;QAAzD,iBAyDC;;QAxDC,IAAM,aAAa,GAAG,gBAAgB,EAAE,CAAC;gBACzC,sCACE,iBAAiB,EAAE,aAAa,CAAC,iBAAiB,EAClD,cAAc,EAAE,IAAI,kBAAkB,CAAC,OAAO,CAAC,cAAc,IAAI,aAAa,CAAC,cAAc,CAAC,IAC3F,OAAO,KACV,MAAM,QAAA,IACN;QACF,KAAI,CAAC,eAAe;YAClB,OAAO,CAAC,eAAe,KAAK,SAAS,IAAI,OAAO,CAAC,eAAe,IAAI,aAAa,CAAC,eAAe;gBAC/F,CAAC,CAAC,OAAO,CAAC,eAAe;gBACzB,CAAC,CAAC,aAAa,CAAC,eAAe,CAAC;QAEpC,KAAI,CAAC,MAAM,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I,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;SACpC;QACD,iGAAiG;QACjG,IAAI,OAAO,CAAC,YAAY,KAAK,SAAS,EAAE;YACtC,KAAI,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;SAC1C;aAAM;YACL,IAAM,aAAa,GAAG,OAAwD,CAAC;YAC/E,IAAI,CAAA,MAAA,aAAa,CAAC,YAAY,0CAAE,YAAY,MAAK,SAAS,EAAE;gBAC1D,KAAI,CAAC,YAAY,GAAG,aAAa,CAAC,YAAY,CAAC,YAAY,CAAC;aAC7D;SACF;QACD,IAAI,OAAO,CAAC,eAAe,EAAE;YAC3B,KAAI,CAAC,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;SAChD;QACD,KAAI,CAAC,yBAAyB,GAAG,MAAA,OAAO,CAAC,yBAAyB,mCAAI,IAAI,CAAC;QAC3E,IAAI,OAAO,CAAC,kBAAkB,EAAE;YAC9B,KAAI,CAAC,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAC;SACtD;;IACH,CAAC;IACH,+BAAC;AAAD,CAAC,AAlFD,CAA8C,MAAM,GAkFnD","sourcesContent":["import { Config, Logger, FetchTransport, LogLevel } from '@amplitude/analytics-core';\nimport {\n DEFAULT_PERFORMANCE_CONFIG,\n DEFAULT_SAMPLE_RATE,\n DEFAULT_SERVER_ZONE,\n DEFAULT_URL_CHANGE_POLLING_INTERVAL,\n} from '../constants';\nimport { SessionReplayOptions, StoreType } from '../typings/session-replay';\nimport {\n SessionReplayLocalConfig as ISessionReplayLocalConfig,\n CrossOriginIframesConfig,\n InteractionConfig,\n PrivacyConfig,\n SessionReplayPerformanceConfig,\n SessionReplayVersion,\n} from './types';\nimport { SafeLoggerProvider } from '../logger';\nimport { validateUGCFilterRules } from '../helpers';\n\nexport const getDefaultConfig = () => ({\n flushMaxRetries: 2,\n logLevel: LogLevel.Warn,\n loggerProvider: new Logger(),\n transportProvider: new FetchTransport(),\n});\n\nexport class SessionReplayLocalConfig extends Config implements ISessionReplayLocalConfig {\n apiKey: string;\n sampleRate: number;\n privacyConfig?: PrivacyConfig;\n interactionConfig?: InteractionConfig;\n debugMode?: boolean;\n configServerUrl?: string;\n trackServerUrl?: string;\n shouldInlineStylesheet?: boolean;\n version?: SessionReplayVersion;\n storeType: StoreType;\n performanceConfig?: SessionReplayPerformanceConfig;\n useWebWorker?: boolean;\n applyBackgroundColorToBlockedElements?: boolean;\n omitElementTags?: {\n script?: boolean;\n comment?: boolean;\n };\n enableUrlChangePolling?: boolean;\n urlChangePollingInterval?: number;\n captureDocumentTitle?: boolean;\n captureAdoptedStyleSheets?: boolean;\n crossOriginIframes?: CrossOriginIframesConfig;\n\n constructor(apiKey: string, options: SessionReplayOptions) {\n const defaultConfig = getDefaultConfig();\n super({\n transportProvider: defaultConfig.transportProvider,\n loggerProvider: new SafeLoggerProvider(options.loggerProvider || defaultConfig.loggerProvider),\n ...options,\n apiKey,\n });\n this.flushMaxRetries =\n options.flushMaxRetries !== undefined && options.flushMaxRetries <= defaultConfig.flushMaxRetries\n ? options.flushMaxRetries\n : defaultConfig.flushMaxRetries;\n\n this.apiKey = apiKey;\n this.sampleRate = options.sampleRate || DEFAULT_SAMPLE_RATE;\n this.serverZone = options.serverZone || DEFAULT_SERVER_ZONE;\n this.configServerUrl = options.configServerUrl;\n this.trackServerUrl = options.trackServerUrl;\n this.shouldInlineStylesheet = options.shouldInlineStylesheet;\n this.version = options.version;\n this.performanceConfig = options.performanceConfig || DEFAULT_PERFORMANCE_CONFIG;\n this.storeType = options.storeType ?? 'idb';\n this.applyBackgroundColorToBlockedElements = options.applyBackgroundColorToBlockedElements ?? false;\n this.enableUrlChangePolling = options.enableUrlChangePolling ?? false;\n this.urlChangePollingInterval = options.urlChangePollingInterval ?? DEFAULT_URL_CHANGE_POLLING_INTERVAL;\n this.captureDocumentTitle = options.captureDocumentTitle ?? false;\n\n if (options.privacyConfig) {\n this.privacyConfig = options.privacyConfig;\n }\n if (options.interactionConfig) {\n this.interactionConfig = options.interactionConfig;\n\n // validate ugcFilterRules, throw error if invalid - throw error at the beginning of the config\n if (this.interactionConfig.ugcFilterRules) {\n validateUGCFilterRules(this.interactionConfig.ugcFilterRules);\n }\n }\n if (options.debugMode) {\n this.debugMode = options.debugMode;\n }\n // Support both new useWebWorker and legacy experimental.useWebWorker for backwards compatibility\n if (options.useWebWorker !== undefined) {\n this.useWebWorker = options.useWebWorker;\n } else {\n const legacyOptions = options as { experimental?: { useWebWorker?: boolean } };\n if (legacyOptions.experimental?.useWebWorker !== undefined) {\n this.useWebWorker = legacyOptions.experimental.useWebWorker;\n }\n }\n if (options.omitElementTags) {\n this.omitElementTags = options.omitElementTags;\n }\n this.captureAdoptedStyleSheets = options.captureAdoptedStyleSheets ?? true;\n if (options.crossOriginIframes) {\n this.crossOriginIframes = options.crossOriginIframes;\n }\n }\n}\n"]}
@@ -79,6 +79,24 @@ export type UGCFilterRule = {
79
79
  */
80
80
  replacement: string;
81
81
  };
82
+ export interface CrossOriginIframesConfig {
83
+ enabled: boolean;
84
+ /**
85
+ * When true (default), the parent SDK sends start/stop signals to child iframes via
86
+ * postMessage, keeping their recording lifecycle in sync with the parent.
87
+ *
88
+ * **Privacy note:** The child page's rrweb instance performs its own DOM serialization,
89
+ * so the parent's privacy config (mask levels, block selectors) does NOT automatically
90
+ * apply inside the iframe. Privacy settings must be configured independently on the child page.
91
+ *
92
+ * **Third-party iframes:** Cannot capture iframes you don't control (e.g. Stripe, Google
93
+ * Maps) — both parent and child pages must load the SDK with `crossOriginIframes.enabled: true`.
94
+ *
95
+ * Set to `false` to skip coordination and manage the child recording lifecycle yourself.
96
+ * @defaultValue true
97
+ */
98
+ coordinateChildren?: boolean;
99
+ }
82
100
  export interface SessionReplayLocalConfig extends IConfig {
83
101
  apiKey: string;
84
102
  loggerProvider: ILogger;
@@ -207,6 +225,14 @@ export interface SessionReplayLocalConfig extends IConfig {
207
225
  * @defaultValue true
208
226
  */
209
227
  captureAdoptedStyleSheets?: boolean;
228
+ /**
229
+ * Enables recording of cross-origin iframes. Both the parent page and each child iframe
230
+ * page must load the Amplitude Session Replay SDK with this option enabled.
231
+ *
232
+ * When enabled, rrweb uses `postMessage` to relay child DOM events to the parent, which
233
+ * merges them into a single unified event stream.
234
+ */
235
+ crossOriginIframes?: CrossOriginIframesConfig;
210
236
  }
211
237
  export interface SessionReplayJoinedConfig extends SessionReplayLocalConfig {
212
238
  captureEnabled?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/config/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,iBAAiB;IAChC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,cAAc,CAAC,EAAE,aAAa,EAAE,CAAC;CAClC;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE;QACP,OAAO,EAAE,OAAO,CAAC;QACjB,MAAM,EAAE,eAAe,EAAE,CAAC;KAC3B,CAAC;IACF,OAAO,CAAC,EAAE;QACR,OAAO,EAAE,OAAO,CAAC;QACjB,IAAI,CAAC,EAAE;YACL,OAAO,CAAC,EAAE,OAAO,CAAC;YAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;YACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;SAC3B,CAAC;KACH,CAAC;CACH;AAED,MAAM,MAAM,eAAe,GAAG,aAAa,CAAC;AAE5C,MAAM,MAAM,yBAA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version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/config/types.ts"],"names":[],"mappings":"AAuDA,MAAM,CAAC,IAAM,kBAAkB,GAAG,QAAQ,CAAC","sourcesContent":["import { IConfig, LogLevel, ILogger } from '@amplitude/analytics-core';\nimport { StoreType, ConsoleLogLevel } from '../typings/session-replay';\nimport { TargetingFlag } from '@amplitude/targeting';\n\nexport interface SamplingConfig {\n sample_rate: number;\n capture_enabled: boolean;\n}\n\nexport interface InteractionConfig {\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 LoggingConfig {\n console: {\n enabled: boolean;\n levels: ConsoleLogLevel[];\n };\n network?: {\n enabled: boolean;\n body?: {\n request?: boolean;\n response?: boolean;\n maxBodySizeBytes?: number;\n };\n };\n}\n\nexport type TargetingConfig = TargetingFlag;\n\nexport type SessionReplayRemoteConfig = {\n sr_sampling_config?: SamplingConfig;\n sr_privacy_config?: PrivacyConfig;\n sr_interaction_config?: InteractionConfig;\n sr_logging_config?: LoggingConfig;\n sr_targeting_config?: TargetingConfig;\n};\n\nexport interface SessionReplayRemoteConfigAPIResponse {\n configs: {\n sessionReplay: SessionReplayRemoteConfig;\n };\n}\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 const DEFAULT_MASK_LEVEL = 'medium';\n\n// err on the side of excluding more\nexport type PrivacyConfig = {\n blockSelector?: string | string[]; // exclude in the UI\n defaultMaskLevel?: MaskLevel;\n maskSelector?: string[];\n unmaskSelector?: string[];\n maskAttributes?: string[]; // HTML attribute names to mask (e.g. [\"placeholder\", \"aria-label\"])\n /**\n * Per-URL overrides for `defaultMaskLevel`. Each entry contains a glob pattern (`match`)\n * and a `maskLevel` to apply when the current page URL matches that pattern.\n * Rules are evaluated in order; the first match wins. Remote rules take precedence\n * over local rules (remote entries are prepended before local entries).\n *\n * @example\n * urlMaskLevels: [\n * { match: 'https://example.com/checkout/*', maskLevel: 'conservative' },\n * { match: 'https://example.com/public/*', maskLevel: 'light' },\n * ]\n */\n urlMaskLevels?: Array<{ match: string; maskLevel: MaskLevel }>;\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 SessionReplayLocalConfig extends IConfig {\n apiKey: string;\n loggerProvider: ILogger;\n /**\n * LogLevel.None or LogLevel.Error or LogLevel.Warn or LogLevel.Verbose or LogLevel.Debug.\n * Sets the log level.\n *\n * @defaultValue LogLevel.Warn\n */\n logLevel: LogLevel;\n /**\n * The maximum number of retries allowed for sending replay events.\n * Once this limit is reached, failed events will no longer be sent.\n *\n * @defaultValue 2\n */\n flushMaxRetries: number;\n /**\n * Use this option to control how many sessions to select for replay collection.\n * The number should be a decimal between 0 and 1, for example 0.4, representing\n * the fraction of sessions to have randomly selected for replay collection.\n * Over a large number of sessions, 0.4 would select 40% of those sessions.\n * Sample rates as small as six decimal places (0.000001) are supported.\n *\n * @defaultValue 0\n */\n sampleRate: number;\n privacyConfig?: PrivacyConfig;\n /**\n * Adds additional debug event property to help debug instrumentation issues\n * (such as mismatching apps). Only recommended for debugging initial setup,\n * and not recommended for production.\n */\n debugMode?: boolean;\n /**\n * Specifies the endpoint URL to fetch remote configuration.\n * If provided, it overrides the default server zone configuration.\n */\n configServerUrl?: string;\n /**\n * Specifies the endpoint URL for sending session replay data.\n * If provided, it overrides the default server zone configuration.\n */\n trackServerUrl?: string;\n /**\n * If stylesheets are inlined, the contents of the stylesheet will be stored.\n * During replay, the stored stylesheet will be used instead of attempting to fetch it remotely.\n * This prevents replays from appearing broken due to missing stylesheets.\n * Note: Inlining stylesheets may not work in all cases.\n */\n shouldInlineStylesheet?: boolean;\n version?: SessionReplayVersion;\n /**\n * Performance configuration config. If enabled, we will defer compression\n * to be done during the browser's idle periods.\n */\n performanceConfig?: SessionReplayPerformanceConfig;\n /**\n * Specifies how replay events should be stored. `idb` uses IndexedDB to persist replay events\n * when all events cannot be sent during capture. `memory` stores replay events only in memory,\n * meaning events are lost when the page is closed. If IndexedDB is unavailable, the system falls back to `memory`.\n */\n storeType: StoreType;\n\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 userProperties?: { [key: string]: any };\n\n /**\n * Remove certain parts of the DOM from being captured. These are typically ignored when blocking by selectors.\n */\n omitElementTags?: {\n /**\n * If true, removes script tags from the DOM, but not noscript tags.\n */\n script?: boolean;\n /**\n * If true, removes comment tags from the DOM.\n */\n comment?: boolean;\n };\n\n /**\n * If true, applies a background color to blocked elements in the replay.\n * This helps visualize which elements are blocked from being captured.\n */\n applyBackgroundColorToBlockedElements?: boolean;\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 interactionConfig?: InteractionConfig;\n /**\n * When true (default), the CSS rules of any `adoptedStyleSheets` on shadow roots and\n * the document are serialized **inline** within the full snapshot. This makes the snapshot\n * self-contained so that shadow DOM styles are replayed correctly even if subsequent\n * incremental `AdoptedStyleSheet` events are dropped in transit.\n *\n * Set to `false` to revert to the legacy behavior where adopted stylesheet rules are\n * emitted as separate incremental events (which may be lost if delivery is unreliable).\n * Only consider opting out if snapshot payload size is a critical concern.\n *\n * @defaultValue true\n */\n captureAdoptedStyleSheets?: boolean;\n}\n\nexport interface SessionReplayJoinedConfig extends SessionReplayLocalConfig {\n captureEnabled?: boolean;\n interactionConfig?: InteractionConfig;\n loggingConfig?: LoggingConfig;\n targetingConfig?: TargetingConfig;\n}\n\nexport interface SessionReplayConfigs {\n localConfig: SessionReplayLocalConfig;\n joinedConfig: SessionReplayJoinedConfig;\n remoteConfig: SessionReplayRemoteConfig | undefined;\n}\nexport interface SessionReplayJoinedConfigGenerator {\n generateJoinedConfig: () => Promise<SessionReplayConfigs>;\n}\n\nexport interface SessionReplayMetadata {\n remoteConfig: SessionReplayRemoteConfig | undefined;\n localConfig: SessionReplayLocalConfig;\n joinedConfig: SessionReplayJoinedConfig;\n framework?: {\n name: string;\n version: string;\n };\n sessionId: string | number | undefined;\n hashValue?: number;\n sampleRate: number;\n replaySDKType: string | null;\n replaySDKVersion: string | undefined;\n standaloneSDKType: string;\n standaloneSDKVersion: string | undefined;\n}\n\nexport interface SessionReplayVersion {\n version: string;\n type: SessionReplayType;\n}\n\n/**\n * Configuration options for session replay performance.\n */\nexport interface SessionReplayPerformanceConfig {\n /**\n * If enabled, event compression will be deferred to occur during the browser's idle periods.\n */\n enabled: boolean;\n /**\n * Optional timeout in milliseconds for the `requestIdleCallback` API.\n * If specified, this value will be used to set a maximum time for the browser to wait\n * before executing the deferred compression task, even if the browser is not idle.\n */\n timeout?: number;\n /**\n * If enabled, consecutive mutation events will be merged into a single event before\n * compression, reducing stored event count without changing replay semantics.\n * Defaults to false.\n */\n mergeMutations?: boolean;\n /**\n * Performance configuration for interaction tracking (clicks, scrolls).\n */\n interaction?: InteractionPerformanceConfig;\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 type SessionReplayType = 'standalone' | 'plugin' | 'segment';\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/config/types.ts"],"names":[],"mappings":"AAuDA,MAAM,CAAC,IAAM,kBAAkB,GAAG,QAAQ,CAAC","sourcesContent":["import { IConfig, LogLevel, ILogger } from '@amplitude/analytics-core';\nimport { StoreType, ConsoleLogLevel } from '../typings/session-replay';\nimport { TargetingFlag } from '@amplitude/targeting';\n\nexport interface SamplingConfig {\n sample_rate: number;\n capture_enabled: boolean;\n}\n\nexport interface InteractionConfig {\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 LoggingConfig {\n console: {\n enabled: boolean;\n levels: ConsoleLogLevel[];\n };\n network?: {\n enabled: boolean;\n body?: {\n request?: boolean;\n response?: boolean;\n maxBodySizeBytes?: number;\n };\n };\n}\n\nexport type TargetingConfig = TargetingFlag;\n\nexport type SessionReplayRemoteConfig = {\n sr_sampling_config?: SamplingConfig;\n sr_privacy_config?: PrivacyConfig;\n sr_interaction_config?: InteractionConfig;\n sr_logging_config?: LoggingConfig;\n sr_targeting_config?: TargetingConfig;\n};\n\nexport interface SessionReplayRemoteConfigAPIResponse {\n configs: {\n sessionReplay: SessionReplayRemoteConfig;\n };\n}\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 const DEFAULT_MASK_LEVEL = 'medium';\n\n// err on the side of excluding more\nexport type PrivacyConfig = {\n blockSelector?: string | string[]; // exclude in the UI\n defaultMaskLevel?: MaskLevel;\n maskSelector?: string[];\n unmaskSelector?: string[];\n maskAttributes?: string[]; // HTML attribute names to mask (e.g. [\"placeholder\", \"aria-label\"])\n /**\n * Per-URL overrides for `defaultMaskLevel`. Each entry contains a glob pattern (`match`)\n * and a `maskLevel` to apply when the current page URL matches that pattern.\n * Rules are evaluated in order; the first match wins. Remote rules take precedence\n * over local rules (remote entries are prepended before local entries).\n *\n * @example\n * urlMaskLevels: [\n * { match: 'https://example.com/checkout/*', maskLevel: 'conservative' },\n * { match: 'https://example.com/public/*', maskLevel: 'light' },\n * ]\n */\n urlMaskLevels?: Array<{ match: string; maskLevel: MaskLevel }>;\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 CrossOriginIframesConfig {\n enabled: boolean;\n /**\n * When true (default), the parent SDK sends start/stop signals to child iframes via\n * postMessage, keeping their recording lifecycle in sync with the parent.\n *\n * **Privacy note:** The child page's rrweb instance performs its own DOM serialization,\n * so the parent's privacy config (mask levels, block selectors) does NOT automatically\n * apply inside the iframe. Privacy settings must be configured independently on the child page.\n *\n * **Third-party iframes:** Cannot capture iframes you don't control (e.g. Stripe, Google\n * Maps) — both parent and child pages must load the SDK with `crossOriginIframes.enabled: true`.\n *\n * Set to `false` to skip coordination and manage the child recording lifecycle yourself.\n * @defaultValue true\n */\n coordinateChildren?: boolean;\n}\n\nexport interface SessionReplayLocalConfig extends IConfig {\n apiKey: string;\n loggerProvider: ILogger;\n /**\n * LogLevel.None or LogLevel.Error or LogLevel.Warn or LogLevel.Verbose or LogLevel.Debug.\n * Sets the log level.\n *\n * @defaultValue LogLevel.Warn\n */\n logLevel: LogLevel;\n /**\n * The maximum number of retries allowed for sending replay events.\n * Once this limit is reached, failed events will no longer be sent.\n *\n * @defaultValue 2\n */\n flushMaxRetries: number;\n /**\n * Use this option to control how many sessions to select for replay collection.\n * The number should be a decimal between 0 and 1, for example 0.4, representing\n * the fraction of sessions to have randomly selected for replay collection.\n * Over a large number of sessions, 0.4 would select 40% of those sessions.\n * Sample rates as small as six decimal places (0.000001) are supported.\n *\n * @defaultValue 0\n */\n sampleRate: number;\n privacyConfig?: PrivacyConfig;\n /**\n * Adds additional debug event property to help debug instrumentation issues\n * (such as mismatching apps). Only recommended for debugging initial setup,\n * and not recommended for production.\n */\n debugMode?: boolean;\n /**\n * Specifies the endpoint URL to fetch remote configuration.\n * If provided, it overrides the default server zone configuration.\n */\n configServerUrl?: string;\n /**\n * Specifies the endpoint URL for sending session replay data.\n * If provided, it overrides the default server zone configuration.\n */\n trackServerUrl?: string;\n /**\n * If stylesheets are inlined, the contents of the stylesheet will be stored.\n * During replay, the stored stylesheet will be used instead of attempting to fetch it remotely.\n * This prevents replays from appearing broken due to missing stylesheets.\n * Note: Inlining stylesheets may not work in all cases.\n */\n shouldInlineStylesheet?: boolean;\n version?: SessionReplayVersion;\n /**\n * Performance configuration config. If enabled, we will defer compression\n * to be done during the browser's idle periods.\n */\n performanceConfig?: SessionReplayPerformanceConfig;\n /**\n * Specifies how replay events should be stored. `idb` uses IndexedDB to persist replay events\n * when all events cannot be sent during capture. `memory` stores replay events only in memory,\n * meaning events are lost when the page is closed. If IndexedDB is unavailable, the system falls back to `memory`.\n */\n storeType: StoreType;\n\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 userProperties?: { [key: string]: any };\n\n /**\n * Remove certain parts of the DOM from being captured. These are typically ignored when blocking by selectors.\n */\n omitElementTags?: {\n /**\n * If true, removes script tags from the DOM, but not noscript tags.\n */\n script?: boolean;\n /**\n * If true, removes comment tags from the DOM.\n */\n comment?: boolean;\n };\n\n /**\n * If true, applies a background color to blocked elements in the replay.\n * This helps visualize which elements are blocked from being captured.\n */\n applyBackgroundColorToBlockedElements?: boolean;\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 interactionConfig?: InteractionConfig;\n /**\n * When true (default), the CSS rules of any `adoptedStyleSheets` on shadow roots and\n * the document are serialized **inline** within the full snapshot. This makes the snapshot\n * self-contained so that shadow DOM styles are replayed correctly even if subsequent\n * incremental `AdoptedStyleSheet` events are dropped in transit.\n *\n * Set to `false` to revert to the legacy behavior where adopted stylesheet rules are\n * emitted as separate incremental events (which may be lost if delivery is unreliable).\n * Only consider opting out if snapshot payload size is a critical concern.\n *\n * @defaultValue true\n */\n captureAdoptedStyleSheets?: boolean;\n /**\n * Enables recording of cross-origin iframes. Both the parent page and each child iframe\n * page must load the Amplitude Session Replay SDK with this option enabled.\n *\n * When enabled, rrweb uses `postMessage` to relay child DOM events to the parent, which\n * merges them into a single unified event stream.\n */\n crossOriginIframes?: CrossOriginIframesConfig;\n}\n\nexport interface SessionReplayJoinedConfig extends SessionReplayLocalConfig {\n captureEnabled?: boolean;\n interactionConfig?: InteractionConfig;\n loggingConfig?: LoggingConfig;\n targetingConfig?: TargetingConfig;\n}\n\nexport interface SessionReplayConfigs {\n localConfig: SessionReplayLocalConfig;\n joinedConfig: SessionReplayJoinedConfig;\n remoteConfig: SessionReplayRemoteConfig | undefined;\n}\nexport interface SessionReplayJoinedConfigGenerator {\n generateJoinedConfig: () => Promise<SessionReplayConfigs>;\n}\n\nexport interface SessionReplayMetadata {\n remoteConfig: SessionReplayRemoteConfig | undefined;\n localConfig: SessionReplayLocalConfig;\n joinedConfig: SessionReplayJoinedConfig;\n framework?: {\n name: string;\n version: string;\n };\n sessionId: string | number | undefined;\n hashValue?: number;\n sampleRate: number;\n replaySDKType: string | null;\n replaySDKVersion: string | undefined;\n standaloneSDKType: string;\n standaloneSDKVersion: string | undefined;\n}\n\nexport interface SessionReplayVersion {\n version: string;\n type: SessionReplayType;\n}\n\n/**\n * Configuration options for session replay performance.\n */\nexport interface SessionReplayPerformanceConfig {\n /**\n * If enabled, event compression will be deferred to occur during the browser's idle periods.\n */\n enabled: boolean;\n /**\n * Optional timeout in milliseconds for the `requestIdleCallback` API.\n * If specified, this value will be used to set a maximum time for the browser to wait\n * before executing the deferred compression task, even if the browser is not idle.\n */\n timeout?: number;\n /**\n * If enabled, consecutive mutation events will be merged into a single event before\n * compression, reducing stored event count without changing replay semantics.\n * Defaults to false.\n */\n mergeMutations?: boolean;\n /**\n * Performance configuration for interaction tracking (clicks, scrolls).\n */\n interaction?: InteractionPerformanceConfig;\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 type SessionReplayType = 'standalone' | 'plugin' | 'segment';\n"]}
@@ -26,6 +26,8 @@ export declare const MAX_IDB_STORAGE_LENGTH: number;
26
26
  export declare const KB_SIZE = 1024;
27
27
  export declare const MAX_URL_LENGTH = 1000;
28
28
  export declare const RETRY_TIMEOUT_MS = 1000;
29
+ export declare const MAX_KEEPALIVE_BYTES: number;
30
+ export declare const CROSS_ORIGIN_IFRAME_MESSAGE_TYPE = "amplitude-sr-iframe";
29
31
  export declare enum CustomRRwebEvent {
30
32
  GET_SR_PROPS = "get-sr-props",
31
33
  DEBUG_INFO = "debug-info",
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAEzE,eAAO,MAAM,6BAA6B,gBAAgB,CAAC;AAE3D,eAAO,MAAM,+BAA+B,QAAuD,CAAC;AACpG,eAAO,MAAM,2BAA2B,kBAAkB,CAAC;AAC3D,eAAO,MAAM,yBAAyB,gBAAgB,CAAC;AACvD,eAAO,MAAM,mBAAmB,IAAI,CAAC;AACrC,eAAO,MAAM,mBAAmB,gBAAgB,CAAC;AACjD,eAAO,MAAM,0BAA0B;;CAAoB,CAAC;AAC5D,eAAO,MAAM,mCAAmC,OAAO,CAAC;AAExD,eAAO,MAAM,6BAA6B,QAA0D,CAAC;AAErG,eAAO,MAAM,WAAW,cAAc,CAAC;AACvC,eAAO,MAAM,eAAe,aAAa,CAAC;AAC1C,eAAO,MAAM,iBAAiB,eAAe,CAAC;AAC9C,eAAO,MAAM,yBAAyB,mDAAmD,CAAC;AAC1F,eAAO,MAAM,qBAAqB,sDAAsD,CAAC;AACzF,eAAO,MAAM,0BAA0B,yDAAyD,CAAC;AACjG,eAAO,MAAM,cAAc,QAAsC,CAAC;AAClE,eAAO,MAAM,mBAAmB,QAAc,CAAC;AAC/C,eAAO,MAAM,wBAAwB,QAAS,CAAC;AAC/C,eAAO,MAAM,wBAAwB,QAAS,CAAC;AAC/C,eAAO,MAAM,YAAY,MAAM,CAAC;AAChC,eAAO,MAAM,YAAY,QAAY,CAAC;AACtC,eAAO,MAAM,sBAAsB,QAA0B,CAAC;AAC9D,eAAO,MAAM,OAAO,OAAO,CAAC;AA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CAAC;AAC5B,eAAO,MAAM,cAAc,OAAO,CAAC;AACnC,eAAO,MAAM,gBAAgB,OAAO,CAAC;AACrC,eAAO,MAAM,mBAAmB,QAAY,CAAC;AAE7C,eAAO,MAAM,gCAAgC,wBAAwB,CAAC;AAEtE,oBAAY,gBAAgB;IAC1B,YAAY,iBAAiB;IAC7B,UAAU,eAAe;IACzB,aAAa,kBAAkB;IAC/B,QAAQ,aAAa;IACrB,kBAAkB,uBAAuB;CAC1C"}
@@ -24,6 +24,8 @@ export var MAX_IDB_STORAGE_LENGTH = 1000 * 60 * 60 * 24 * 3; // 3 days
24
24
  export var KB_SIZE = 1024;
25
25
  export var MAX_URL_LENGTH = 1000;
26
26
  export var RETRY_TIMEOUT_MS = 1000;
27
+ export var MAX_KEEPALIVE_BYTES = 64 * 1024; // browser keepalive budget shared with sendBeacon
28
+ export var CROSS_ORIGIN_IFRAME_MESSAGE_TYPE = 'amplitude-sr-iframe';
27
29
  export var CustomRRwebEvent;
28
30
  (function (CustomRRwebEvent) {
29
31
  CustomRRwebEvent["GET_SR_PROPS"] = "get-sr-props";
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAEzE,MAAM,CAAC,IAAM,6BAA6B,GAAG,aAAa,CAAC;AAE3D,MAAM,CAAC,IAAM,+BAA+B,GAAG,UAAG,6BAA6B,uBAAoB,CAAC;AACpG,MAAM,CAAC,IAAM,2BAA2B,GAAG,eAAe,CAAC;AAC3D,MAAM,CAAC,IAAM,yBAAyB,GAAG,aAAa,CAAC;AACvD,MAAM,CAAC,IAAM,mBAAmB,GAAG,CAAC,CAAC;AACrC,MAAM,CAAC,IAAM,mBAAmB,GAAG,UAAU,CAAC,EAAE,CAAC;AACjD,MAAM,CAAC,IAAM,0BAA0B,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,CAA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B,6DAAyC,CAAA;AAC3C,CAAC,EANW,gBAAgB,KAAhB,gBAAgB,QAM3B","sourcesContent":["import { AMPLITUDE_PREFIX, ServerZone } from '@amplitude/analytics-core';\n\nexport const DEFAULT_EVENT_PROPERTY_PREFIX = '[Amplitude]';\n\nexport const DEFAULT_SESSION_REPLAY_PROPERTY = `${DEFAULT_EVENT_PROPERTY_PREFIX} Session Replay ID`;\nexport const DEFAULT_SESSION_START_EVENT = 'session_start';\nexport const DEFAULT_SESSION_END_EVENT = 'session_end';\nexport const DEFAULT_SAMPLE_RATE = 0;\nexport const DEFAULT_SERVER_ZONE = ServerZone.US;\nexport const DEFAULT_PERFORMANCE_CONFIG = { enabled: true };\nexport const DEFAULT_URL_CHANGE_POLLING_INTERVAL = 1000;\n\nexport const SESSION_REPLAY_DEBUG_PROPERTY = `${DEFAULT_EVENT_PROPERTY_PREFIX} Session Replay Debug`;\n\nexport const BLOCK_CLASS = 'amp-block';\nexport const MASK_TEXT_CLASS = 'amp-mask';\nexport const UNMASK_TEXT_CLASS = 'amp-unmask';\nexport const SESSION_REPLAY_SERVER_URL = 'https://api-sr.amplitude.com/sessions/v2/track';\nexport const SESSION_REPLAY_EU_URL = 'https://api-sr.eu.amplitude.com/sessions/v2/track';\nexport const SESSION_REPLAY_STAGING_URL = 'https://api-sr.stag2.amplitude.com/sessions/v2/track';\nexport const STORAGE_PREFIX = `${AMPLITUDE_PREFIX}_replay_unsent`;\nexport const MAX_EVENT_LIST_SIZE = 1 * 1000000; // ~1 MB limit for JSON serialized events payload\nexport const INTERACTION_MIN_INTERVAL = 30_000; // 30 seconds\nexport const INTERACTION_MAX_INTERVAL = 60_000; // 1 minute\nexport const MIN_INTERVAL = 500; // 500 ms\nexport const MAX_INTERVAL = 10 * 1000; // 10 seconds\nexport const MAX_IDB_STORAGE_LENGTH = 1000 * 60 * 60 * 24 * 3; // 3 days\nexport const KB_SIZE = 1024;\nexport const MAX_URL_LENGTH = 1000;\nexport const RETRY_TIMEOUT_MS = 1000;\n\nexport enum CustomRRwebEvent {\n GET_SR_PROPS = 'get-sr-props',\n DEBUG_INFO = 'debug-info',\n FETCH_REQUEST = 'fetch-request',\n METADATA = 'metadata',\n TARGETING_DECISION = 'targeting-decision',\n}\n"]}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAEzE,MAAM,CAAC,IAAM,6BAA6B,GAAG,aAAa,CAAC;AAE3D,MAAM,CAAC,IAAM,+BAA+B,GAAG,UAAG,6BAA6B,uBAAoB,CAAC;AACpG,MAAM,CAAC,IAAM,2BAA2B,GAAG,eAAe,CAAC;AAC3D,MAAM,CAAC,IAAM,yBAAyB,GAAG,aAAa,CAAC;AACvD,MAAM,CAAC,IAAM,mBAAmB,GAAG,CAAC,CAAC;AACrC,MAAM,CAAC,IAAM,mBAAmB,GAAG,UAAU,CAAC,EAAE,CAAC;AACjD,MAAM,CAAC,IAAM,0BAA0B,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAC5D,MAAM,CAAC,IAAM,mCAAmC,GAAG,IAAI,CAAC;AAExD,MAAM,CAAC,IAAM,6BAA6B,GAAG,UAAG,6BAA6B,0BAAuB,CAAC;AAErG,MAAM,CAAC,IAAM,WAAW,GAAG,WAAW,CAAC;AACvC,MAAM,CAAC,IAAM,eAAe,GAAG,UAAU,CAAC;AAC1C,MAAM,CAAC,IAAM,iBAAiB,GAAG,YAAY,CAAC;AAC9C,MAAM,CAAC,IAAM,yBAAyB,GAAG,gDAAgD,CAAC;AAC1F,MAAM,CAAC,IAAM,qBAAqB,GAAG,mDAAmD,CAAC;AACzF,MAAM,CAAC,IAAM,0BAA0B,GAAG,sDAAsD,CAAC;AACjG,MAAM,CAAC,IAAM,cAAc,GAAG,UAAG,gBAAgB,mBAAgB,CAAC;AAClE,MAAM,CAAC,IAAM,mBAAmB,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC,iDAAiD;AACjG,MAAM,CAAC,IAAM,wBAAwB,GAAG,KAAM,CAAC,CAAC,aAAa;AAC7D,MAAM,CAAC,IAAM,wBAAwB,GAAG,KAAM,CAAC,CAAC,WAAW;AAC3D,MAAM,CAAC,IAAM,YAAY,GAAG,GAAG,CAAC,CAAC,SAAS;AAC1C,MAAM,CAAC,IAAM,YAAY,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,aAAa;AACpD,MAAM,CAAC,IAAM,sBAAsB,GAAG,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,SAAS;AACxE,MAAM,CAAC,IAAM,OAAO,GAAG,IAAI,CAAC;AAC5B,MAAM,CAAC,IAAM,cAAc,GAAG,IAAI,CAAC;AACnC,MAAM,CAAC,IAAM,gBAAgB,GAAG,IAAI,CAAC;AACrC,MAAM,CAAC,IAAM,mBAAmB,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,kDAAkD;AAEhG,MAAM,CAAC,IAAM,gCAAgC,GAAG,qBAAqB,CAAC;AAEtE,MAAM,CAAN,IAAY,gBAMX;AAND,WAAY,gBAAgB;IAC1B,iDAA6B,CAAA;IAC7B,6CAAyB,CAAA;IACzB,mDAA+B,CAAA;IAC/B,yCAAqB,CAAA;IACrB,6DAAyC,CAAA;AAC3C,CAAC,EANW,gBAAgB,KAAhB,gBAAgB,QAM3B","sourcesContent":["import { AMPLITUDE_PREFIX, ServerZone } from '@amplitude/analytics-core';\n\nexport const DEFAULT_EVENT_PROPERTY_PREFIX = '[Amplitude]';\n\nexport const DEFAULT_SESSION_REPLAY_PROPERTY = `${DEFAULT_EVENT_PROPERTY_PREFIX} Session Replay ID`;\nexport const DEFAULT_SESSION_START_EVENT = 'session_start';\nexport const DEFAULT_SESSION_END_EVENT = 'session_end';\nexport const DEFAULT_SAMPLE_RATE = 0;\nexport const DEFAULT_SERVER_ZONE = ServerZone.US;\nexport const DEFAULT_PERFORMANCE_CONFIG = { enabled: true };\nexport const DEFAULT_URL_CHANGE_POLLING_INTERVAL = 1000;\n\nexport const SESSION_REPLAY_DEBUG_PROPERTY = `${DEFAULT_EVENT_PROPERTY_PREFIX} Session Replay Debug`;\n\nexport const BLOCK_CLASS = 'amp-block';\nexport const MASK_TEXT_CLASS = 'amp-mask';\nexport const UNMASK_TEXT_CLASS = 'amp-unmask';\nexport const SESSION_REPLAY_SERVER_URL = 'https://api-sr.amplitude.com/sessions/v2/track';\nexport const SESSION_REPLAY_EU_URL = 'https://api-sr.eu.amplitude.com/sessions/v2/track';\nexport const SESSION_REPLAY_STAGING_URL = 'https://api-sr.stag2.amplitude.com/sessions/v2/track';\nexport const STORAGE_PREFIX = `${AMPLITUDE_PREFIX}_replay_unsent`;\nexport const MAX_EVENT_LIST_SIZE = 1 * 1000000; // ~1 MB limit for JSON serialized events payload\nexport const INTERACTION_MIN_INTERVAL = 30_000; // 30 seconds\nexport const INTERACTION_MAX_INTERVAL = 60_000; // 1 minute\nexport const MIN_INTERVAL = 500; // 500 ms\nexport const MAX_INTERVAL = 10 * 1000; // 10 seconds\nexport const MAX_IDB_STORAGE_LENGTH = 1000 * 60 * 60 * 24 * 3; // 3 days\nexport const KB_SIZE = 1024;\nexport const MAX_URL_LENGTH = 1000;\nexport const RETRY_TIMEOUT_MS = 1000;\nexport const MAX_KEEPALIVE_BYTES = 64 * 1024; // browser keepalive budget shared with sendBeacon\n\nexport const CROSS_ORIGIN_IFRAME_MESSAGE_TYPE = 'amplitude-sr-iframe';\n\nexport enum CustomRRwebEvent {\n GET_SR_PROPS = 'get-sr-props',\n DEBUG_INFO = 'debug-info',\n FETCH_REQUEST = 'fetch-request',\n METADATA = 'metadata',\n TARGETING_DECISION = 'targeting-decision',\n}\n"]}
@@ -0,0 +1,28 @@
1
+ export declare function isInIframe(): boolean;
2
+ /**
3
+ * Manages the parent side of cross-origin iframe recording coordination.
4
+ *
5
+ * When the parent starts recording, it sends a start signal to all current child
6
+ * iframes and watches for dynamically added iframes via MutationObserver. When the
7
+ * parent stops, it sends a stop signal.
8
+ */
9
+ export declare class CrossOriginIframeCoordinator {
10
+ private mutationObserver;
11
+ private pendingLoadListeners;
12
+ start(): void;
13
+ stop(): void;
14
+ private sendToIframeAfterLoad;
15
+ private sendToAllIframes;
16
+ private sendToIframe;
17
+ }
18
+ /**
19
+ * Listens for start/stop signals from the parent page and invokes the provided
20
+ * callbacks. Only messages from `window.parent` are accepted.
21
+ *
22
+ * Returns a cleanup function that removes the message listener.
23
+ */
24
+ export declare function listenForParentSignals(callbacks: {
25
+ onStart: () => void;
26
+ onStop: () => void;
27
+ }): () => void;
28
+ //# sourceMappingURL=cross-origin-iframes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cross-origin-iframes.d.ts","sourceRoot":"","sources":["../../src/cross-origin-iframes.ts"],"names":[],"mappings":"AAGA,wBAAgB,UAAU,IAAI,OAAO,CAWpC;AAID;;;;;;GAMG;AACH,qBAAa,4BAA4B;IACvC,OAAO,CAAC,gBAAgB,CAA+B;IAEvD,OAAO,CAAC,oBAAoB,CAA4C;IAExE,KAAK;IAwCL,IAAI;IAWJ,OAAO,CAAC,qBAAqB;IAS7B,OAAO,CAAC,gBAAgB;IAKxB,OAAO,CAAC,YAAY;CAOrB;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE;IAAE,OAAO,EAAE,MAAM,IAAI,CAAC;IAAC,MAAM,EAAE,MAAM,IAAI,CAAA;CAAE,GAAG,MAAM,IAAI,CA0BzG"}
@@ -0,0 +1,170 @@
1
+ import { __values } from "tslib";
2
+ import { getGlobalScope } from '@amplitude/analytics-core';
3
+ import { CROSS_ORIGIN_IFRAME_MESSAGE_TYPE } from './constants';
4
+ export function isInIframe() {
5
+ try {
6
+ var globalScope = getGlobalScope();
7
+ if (!globalScope) {
8
+ return false;
9
+ }
10
+ return globalScope.parent !== globalScope;
11
+ }
12
+ catch (_a) {
13
+ // SecurityError accessing window.parent in some sandboxed environments
14
+ return true;
15
+ }
16
+ }
17
+ /**
18
+ * Manages the parent side of cross-origin iframe recording coordination.
19
+ *
20
+ * When the parent starts recording, it sends a start signal to all current child
21
+ * iframes and watches for dynamically added iframes via MutationObserver. When the
22
+ * parent stops, it sends a stop signal.
23
+ */
24
+ var CrossOriginIframeCoordinator = /** @class */ (function () {
25
+ function CrossOriginIframeCoordinator() {
26
+ // Tracks pending load listeners for dynamically added iframes so stop() can cancel them.
27
+ this.pendingLoadListeners = new Map();
28
+ }
29
+ CrossOriginIframeCoordinator.prototype.start = function () {
30
+ var _this = this;
31
+ var _a;
32
+ (_a = this.mutationObserver) === null || _a === void 0 ? void 0 : _a.disconnect(); // guard against double-start
33
+ var globalScope = getGlobalScope();
34
+ if (!globalScope) {
35
+ return;
36
+ }
37
+ this.sendToAllIframes({ type: CROSS_ORIGIN_IFRAME_MESSAGE_TYPE, action: 'start' });
38
+ this.mutationObserver = new MutationObserver(function (mutations) {
39
+ var e_1, _a, e_2, _b, e_3, _c;
40
+ try {
41
+ for (var mutations_1 = __values(mutations), mutations_1_1 = mutations_1.next(); !mutations_1_1.done; mutations_1_1 = mutations_1.next()) {
42
+ var mutation = mutations_1_1.value;
43
+ try {
44
+ for (var _d = (e_2 = void 0, __values(Array.from(mutation.addedNodes))), _e = _d.next(); !_e.done; _e = _d.next()) {
45
+ var node = _e.value;
46
+ if (node instanceof HTMLIFrameElement) {
47
+ // Send the start signal after the child page has loaded, not at insertion
48
+ // time. At insertion the contentWindow is still about:blank; the message
49
+ // sent there is discarded when the iframe navigates to its src, and the
50
+ // child SDK never receives it.
51
+ _this.sendToIframeAfterLoad(node);
52
+ }
53
+ else if (node instanceof Element) {
54
+ // A container element (e.g. a React-rendered div) may already have
55
+ // iframe descendants when it is inserted. These iframes do NOT appear
56
+ // in addedNodes — only the container does. Query the subtree so we
57
+ // don't miss them.
58
+ node.querySelectorAll('iframe').forEach(function (iframe) {
59
+ _this.sendToIframeAfterLoad(iframe);
60
+ });
61
+ }
62
+ }
63
+ }
64
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
65
+ finally {
66
+ try {
67
+ if (_e && !_e.done && (_b = _d.return)) _b.call(_d);
68
+ }
69
+ finally { if (e_2) throw e_2.error; }
70
+ }
71
+ try {
72
+ for (var _f = (e_3 = void 0, __values(Array.from(mutation.removedNodes))), _g = _f.next(); !_g.done; _g = _f.next()) {
73
+ var node = _g.value;
74
+ if (node instanceof HTMLIFrameElement) {
75
+ var listener = _this.pendingLoadListeners.get(node);
76
+ if (listener) {
77
+ node.removeEventListener('load', listener);
78
+ _this.pendingLoadListeners.delete(node);
79
+ }
80
+ }
81
+ }
82
+ }
83
+ catch (e_3_1) { e_3 = { error: e_3_1 }; }
84
+ finally {
85
+ try {
86
+ if (_g && !_g.done && (_c = _f.return)) _c.call(_f);
87
+ }
88
+ finally { if (e_3) throw e_3.error; }
89
+ }
90
+ }
91
+ }
92
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
93
+ finally {
94
+ try {
95
+ if (mutations_1_1 && !mutations_1_1.done && (_a = mutations_1.return)) _a.call(mutations_1);
96
+ }
97
+ finally { if (e_1) throw e_1.error; }
98
+ }
99
+ });
100
+ this.mutationObserver.observe(document.documentElement, { childList: true, subtree: true });
101
+ };
102
+ CrossOriginIframeCoordinator.prototype.stop = function () {
103
+ var _a;
104
+ (_a = this.mutationObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
105
+ this.mutationObserver = undefined;
106
+ // Cancel any start signals that were waiting for a pending iframe load.
107
+ this.pendingLoadListeners.forEach(function (listener, iframe) {
108
+ iframe.removeEventListener('load', listener);
109
+ });
110
+ this.pendingLoadListeners.clear();
111
+ this.sendToAllIframes({ type: CROSS_ORIGIN_IFRAME_MESSAGE_TYPE, action: 'stop' });
112
+ };
113
+ CrossOriginIframeCoordinator.prototype.sendToIframeAfterLoad = function (iframe) {
114
+ var _this = this;
115
+ var sendStart = function () {
116
+ _this.pendingLoadListeners.delete(iframe);
117
+ _this.sendToIframe(iframe, { type: CROSS_ORIGIN_IFRAME_MESSAGE_TYPE, action: 'start' });
118
+ };
119
+ this.pendingLoadListeners.set(iframe, sendStart);
120
+ iframe.addEventListener('load', sendStart, { once: true });
121
+ };
122
+ CrossOriginIframeCoordinator.prototype.sendToAllIframes = function (message) {
123
+ var _this = this;
124
+ var iframes = document.querySelectorAll('iframe');
125
+ iframes.forEach(function (iframe) { return _this.sendToIframe(iframe, message); });
126
+ };
127
+ CrossOriginIframeCoordinator.prototype.sendToIframe = function (iframe, message) {
128
+ var _a;
129
+ try {
130
+ (_a = iframe.contentWindow) === null || _a === void 0 ? void 0 : _a.postMessage(message, '*');
131
+ }
132
+ catch (_b) {
133
+ // Cross-origin postMessage can throw in some sandboxed environments; ignore.
134
+ }
135
+ };
136
+ return CrossOriginIframeCoordinator;
137
+ }());
138
+ export { CrossOriginIframeCoordinator };
139
+ /**
140
+ * Listens for start/stop signals from the parent page and invokes the provided
141
+ * callbacks. Only messages from `window.parent` are accepted.
142
+ *
143
+ * Returns a cleanup function that removes the message listener.
144
+ */
145
+ export function listenForParentSignals(callbacks) {
146
+ var globalScope = getGlobalScope();
147
+ if (!globalScope) {
148
+ return function () { return undefined; };
149
+ }
150
+ var parentFrame = globalScope.parent;
151
+ function handler(event) {
152
+ // Only accept messages from the direct parent frame.
153
+ if (event.source !== parentFrame) {
154
+ return;
155
+ }
156
+ var data = event.data;
157
+ if ((data === null || data === void 0 ? void 0 : data.type) !== CROSS_ORIGIN_IFRAME_MESSAGE_TYPE) {
158
+ return;
159
+ }
160
+ if (data.action === 'start') {
161
+ callbacks.onStart();
162
+ }
163
+ else if (data.action === 'stop') {
164
+ callbacks.onStop();
165
+ }
166
+ }
167
+ globalScope.addEventListener('message', handler);
168
+ return function () { return globalScope.removeEventListener('message', handler); };
169
+ }
170
+ //# sourceMappingURL=cross-origin-iframes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cross-origin-iframes.js","sourceRoot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ChB,OAAO,cAAM,OAAA,SAAS,EAAT,CAAS,CAAC;KACxB;IAED,IAAM,WAAW,GAAG,WAAW,CAAC,MAAM,CAAC;IAEvC,SAAS,OAAO,CAAC,KAAmB;QAClC,qDAAqD;QACrD,IAAI,KAAK,CAAC,MAAM,KAAK,WAAW,EAAE;YAChC,OAAO;SACR;QACD,IAAM,IAAI,GAAG,KAAK,CAAC,IAA8B,CAAC;QAClD,IAAI,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,IAAI,MAAK,gCAAgC,EAAE;YACnD,OAAO;SACR;QACD,IAAI,IAAI,CAAC,MAAM,KAAK,OAAO,EAAE;YAC3B,SAAS,CAAC,OAAO,EAAE,CAAC;SACrB;aAAM,IAAI,IAAI,CAAC,MAAM,KAAK,MAAM,EAAE;YACjC,SAAS,CAAC,MAAM,EAAE,CAAC;SACpB;IACH,CAAC;IAED,WAAW,CAAC,gBAAgB,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IACjD,OAAO,cAAM,OAAA,WAAW,CAAC,mBAAmB,CAAC,SAAS,EAAE,OAAO,CAAC,EAAnD,CAAmD,CAAC;AACnE,CAAC","sourcesContent":["import { getGlobalScope } from '@amplitude/analytics-core';\nimport { CROSS_ORIGIN_IFRAME_MESSAGE_TYPE } from './constants';\n\nexport function isInIframe(): boolean {\n try {\n const globalScope = getGlobalScope() as Window | undefined;\n if (!globalScope) {\n return false;\n }\n return globalScope.parent !== globalScope;\n } catch {\n // SecurityError accessing window.parent in some sandboxed environments\n return true;\n }\n}\n\ntype IframeMessage = { type: typeof CROSS_ORIGIN_IFRAME_MESSAGE_TYPE; action: 'start' | 'stop' };\n\n/**\n * Manages the parent side of cross-origin iframe recording coordination.\n *\n * When the parent starts recording, it sends a start signal to all current child\n * iframes and watches for dynamically added iframes via MutationObserver. When the\n * parent stops, it sends a stop signal.\n */\nexport class CrossOriginIframeCoordinator {\n private mutationObserver: MutationObserver | undefined;\n // Tracks pending load listeners for dynamically added iframes so stop() can cancel them.\n private pendingLoadListeners = new Map<HTMLIFrameElement, () => void>();\n\n start() {\n this.mutationObserver?.disconnect(); // guard against double-start\n const globalScope = getGlobalScope();\n if (!globalScope) {\n return;\n }\n this.sendToAllIframes({ type: CROSS_ORIGIN_IFRAME_MESSAGE_TYPE, action: 'start' });\n this.mutationObserver = new MutationObserver((mutations) => {\n for (const mutation of mutations) {\n for (const node of Array.from(mutation.addedNodes)) {\n if (node instanceof HTMLIFrameElement) {\n // Send the start signal after the child page has loaded, not at insertion\n // time. At insertion the contentWindow is still about:blank; the message\n // sent there is discarded when the iframe navigates to its src, and the\n // child SDK never receives it.\n this.sendToIframeAfterLoad(node);\n } else if (node instanceof Element) {\n // A container element (e.g. a React-rendered div) may already have\n // iframe descendants when it is inserted. These iframes do NOT appear\n // in addedNodes — only the container does. Query the subtree so we\n // don't miss them.\n node.querySelectorAll<HTMLIFrameElement>('iframe').forEach((iframe) => {\n this.sendToIframeAfterLoad(iframe);\n });\n }\n }\n for (const node of Array.from(mutation.removedNodes)) {\n if (node instanceof HTMLIFrameElement) {\n const listener = this.pendingLoadListeners.get(node);\n if (listener) {\n node.removeEventListener('load', listener);\n this.pendingLoadListeners.delete(node);\n }\n }\n }\n }\n });\n this.mutationObserver.observe(document.documentElement, { childList: true, subtree: true });\n }\n\n stop() {\n this.mutationObserver?.disconnect();\n this.mutationObserver = undefined;\n // Cancel any start signals that were waiting for a pending iframe load.\n this.pendingLoadListeners.forEach((listener, iframe) => {\n iframe.removeEventListener('load', listener);\n });\n this.pendingLoadListeners.clear();\n this.sendToAllIframes({ type: CROSS_ORIGIN_IFRAME_MESSAGE_TYPE, action: 'stop' });\n }\n\n private sendToIframeAfterLoad(iframe: HTMLIFrameElement) {\n const sendStart = () => {\n this.pendingLoadListeners.delete(iframe);\n this.sendToIframe(iframe, { type: CROSS_ORIGIN_IFRAME_MESSAGE_TYPE, action: 'start' });\n };\n this.pendingLoadListeners.set(iframe, sendStart);\n iframe.addEventListener('load', sendStart, { once: true });\n }\n\n private sendToAllIframes(message: IframeMessage) {\n const iframes = document.querySelectorAll<HTMLIFrameElement>('iframe');\n iframes.forEach((iframe) => this.sendToIframe(iframe, message));\n }\n\n private sendToIframe(iframe: HTMLIFrameElement, message: IframeMessage) {\n try {\n iframe.contentWindow?.postMessage(message, '*');\n } catch {\n // Cross-origin postMessage can throw in some sandboxed environments; ignore.\n }\n }\n}\n\n/**\n * Listens for start/stop signals from the parent page and invokes the provided\n * callbacks. Only messages from `window.parent` are accepted.\n *\n * Returns a cleanup function that removes the message listener.\n */\nexport function listenForParentSignals(callbacks: { onStart: () => void; onStop: () => void }): () => void {\n const globalScope = getGlobalScope() as Window | undefined;\n if (!globalScope) {\n return () => undefined;\n }\n\n const parentFrame = globalScope.parent;\n\n function handler(event: MessageEvent) {\n // Only accept messages from the direct parent frame.\n if (event.source !== parentFrame) {\n return;\n }\n const data = event.data as Partial<IframeMessage>;\n if (data?.type !== CROSS_ORIGIN_IFRAME_MESSAGE_TYPE) {\n return;\n }\n if (data.action === 'start') {\n callbacks.onStart();\n } else if (data.action === 'stop') {\n callbacks.onStop();\n }\n }\n\n globalScope.addEventListener('message', handler);\n return () => globalScope.removeEventListener('message', handler);\n}\n"]}
@@ -1,17 +1,31 @@
1
1
  import { DBSchema, IDBPDatabase } from 'idb';
2
2
  import { EventType, Events, SendingSequencesReturn } from '../typings/session-replay';
3
3
  import { BaseEventsStore, InstanceArgs as BaseInstanceArgs } from './base-events-store';
4
+ export declare function generateUUID(): string;
4
5
  export declare const currentSequenceKey = "sessionCurrentSequence";
5
6
  export declare const sequencesToSendKey = "sequencesToSend";
6
7
  export declare const remoteConfigKey = "remoteConfig";
8
+ export declare const OPEN_DB_TIMEOUT_MS = 2000;
9
+ export declare const TX_DONE_TIMEOUT_MS = 5000;
10
+ /**
11
+ * Race a promise against a timeout. Resolves/rejects with the original
12
+ * promise's value when it settles first; rejects with a timeout error if
13
+ * `ms` elapses first. Either way the timer is cleared so we don't leak
14
+ * pending setTimeouts.
15
+ */
16
+ export declare function withTimeout<T>(promise: Promise<T>, ms: number, message?: string): Promise<T>;
7
17
  export interface SessionReplayDB extends DBSchema {
8
18
  sessionCurrentSequence: {
9
19
  key: number;
10
- value: Omit<SendingSequencesReturn<number>, 'sequenceId'>;
20
+ value: Omit<SendingSequencesReturn<number>, 'sequenceId'> & {
21
+ tabId?: string;
22
+ };
11
23
  };
12
24
  sequencesToSend: {
13
25
  key: number;
14
- value: Omit<SendingSequencesReturn<number>, 'sequenceId'>;
26
+ value: Omit<SendingSequencesReturn<number>, 'sequenceId'> & {
27
+ tabId?: string;
28
+ };
15
29
  indexes: {
16
30
  sessionId: string | number;
17
31
  };
@@ -25,11 +39,13 @@ export declare const createStore: (dbName: string) => Promise<IDBPDatabase<Sessi
25
39
  type InstanceArgs = {
26
40
  apiKey: string;
27
41
  db: IDBPDatabase<SessionReplayDB>;
42
+ tabId: string;
28
43
  onPersistentFailure?: () => void;
29
44
  consecutiveFailureThreshold?: number;
30
45
  } & BaseInstanceArgs;
31
46
  export declare class SessionReplayEventsIDBStore extends BaseEventsStore<number> {
32
47
  private readonly db;
48
+ private readonly tabId;
33
49
  private readonly onPersistentFailure?;
34
50
  private readonly consecutiveFailureThreshold;
35
51
  private consecutiveFailures;
@@ -37,8 +53,13 @@ export declare class SessionReplayEventsIDBStore extends BaseEventsStore<number>
37
53
  constructor(args: InstanceArgs);
38
54
  private recordFailure;
39
55
  private recordSuccess;
40
- static new(type: EventType, args: Omit<InstanceArgs, 'db'>): Promise<SessionReplayEventsIDBStore | undefined>;
41
- getCurrentSequenceEvents(sessionId?: number): Promise<Omit<SendingSequencesReturn<number>, "sequenceId">[] | undefined>;
56
+ static new(type: EventType, args: Omit<InstanceArgs, 'db' | 'tabId'> & {
57
+ tabId?: string;
58
+ }): Promise<SessionReplayEventsIDBStore | undefined>;
59
+ getCurrentSequenceEvents(sessionId?: number): Promise<{
60
+ events: Events;
61
+ sessionId: string | number;
62
+ }[] | undefined>;
42
63
  getSequencesToSend: () => Promise<SendingSequencesReturn<number>[] | undefined>;
43
64
  storeCurrentSequence: (sessionId: number) => Promise<{
44
65
  sessionId: number;
@@ -1 +1 @@
1
- {"version":3,"file":"events-idb-store.d.ts","sourceRoot":"","sources":["../../../src/events/events-idb-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAU,MAAM,KAAK,CAAC;AAErD,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACtF,OAAO,EAAE,eAAe,EAAE,YAAY,IAAI,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAGxF,eAAO,MAAM,kBAAkB,2BAA2B,CAAC;AAC3D,eAAO,MAAM,kBAAkB,oBAAoB,CAAC;AACpD,eAAO,MAAM,eAAe,iBAAiB,CAAC;AAE9C,MAAM,WAAW,eAAgB,SAAQ,QAAQ;IAC/C,sBAAsB,EAAE;QACtB,GAAG,EAAE,MAAM,CAAC;QACZ,KAAK,EAAE,IAAI,CAAC,sBAAsB,CAAC,MAAM,CAAC,EAAE,YAAY,CAAC,CAAC;KAC3D,CAAC;IACF,eAAe,EAAE;QACf,GAAG,EAAE,MAAM,CAAC;QACZ,KAAK,EAAE,IAAI,CAAC,sBAAsB,CAAC,MAAM,CAAC,EAAE,YAAY,CAAC,CAAC;QAC1D,OAAO,EAAE;YAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAAA;SAAE,CAAC;KACzC,CAAC;CACH;AAED,eAAO,MAAM,kBAAkB,OAAQ,aAAa,eAAe,CAAC;;;CAmBnE,CAAC;AAEF,eAAO,MAAM,WAAW,WAAkB,MAAM,2CAI/C,CAAC;AAEF,KAAK,YAAY,GAAG;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,EAAE,EAAE,YAAY,CAAC,eAAe,CAAC,CAAC;IAClC,mBAAmB,CAAC,EAAE,MAAM,IAAI,CAAC;IACjC,2BAA2B,CAAC,EAAE,MAA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