@amplitude/session-replay-browser 1.37.0 → 1.39.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/lib/cjs/config/local-config.d.ts +1 -0
- package/lib/cjs/config/local-config.d.ts.map +1 -1
- package/lib/cjs/config/local-config.js +2 -1
- package/lib/cjs/config/local-config.js.map +1 -1
- package/lib/cjs/config/types.d.ts +19 -0
- package/lib/cjs/config/types.d.ts.map +1 -1
- package/lib/cjs/config/types.js.map +1 -1
- package/lib/cjs/events/event-compressor.d.ts +2 -0
- package/lib/cjs/events/event-compressor.d.ts.map +1 -1
- package/lib/cjs/events/event-compressor.js +54 -6
- package/lib/cjs/events/event-compressor.js.map +1 -1
- package/lib/cjs/events/merge-mutation-events.d.ts +10 -0
- package/lib/cjs/events/merge-mutation-events.d.ts.map +1 -0
- package/lib/cjs/events/merge-mutation-events.js +232 -0
- package/lib/cjs/events/merge-mutation-events.js.map +1 -0
- package/lib/cjs/session-replay.d.ts.map +1 -1
- package/lib/cjs/session-replay.js +1 -0
- package/lib/cjs/session-replay.js.map +1 -1
- package/lib/cjs/utils/rrweb.d.ts +6 -0
- package/lib/cjs/utils/rrweb.d.ts.map +1 -1
- package/lib/cjs/utils/rrweb.js.map +1 -1
- package/lib/cjs/version.d.ts +1 -1
- package/lib/cjs/version.js +1 -1
- package/lib/cjs/version.js.map +1 -1
- package/lib/esm/config/local-config.d.ts +1 -0
- package/lib/esm/config/local-config.d.ts.map +1 -1
- package/lib/esm/config/local-config.js +2 -1
- package/lib/esm/config/local-config.js.map +1 -1
- package/lib/esm/config/types.d.ts +19 -0
- package/lib/esm/config/types.d.ts.map +1 -1
- package/lib/esm/config/types.js.map +1 -1
- package/lib/esm/events/event-compressor.d.ts +2 -0
- package/lib/esm/events/event-compressor.d.ts.map +1 -1
- package/lib/esm/events/event-compressor.js +55 -7
- package/lib/esm/events/event-compressor.js.map +1 -1
- package/lib/esm/events/merge-mutation-events.d.ts +10 -0
- package/lib/esm/events/merge-mutation-events.d.ts.map +1 -0
- package/lib/esm/events/merge-mutation-events.js +228 -0
- package/lib/esm/events/merge-mutation-events.js.map +1 -0
- package/lib/esm/session-replay.d.ts.map +1 -1
- package/lib/esm/session-replay.js +1 -0
- package/lib/esm/session-replay.js.map +1 -1
- package/lib/esm/utils/rrweb.d.ts +6 -0
- package/lib/esm/utils/rrweb.d.ts.map +1 -1
- package/lib/esm/utils/rrweb.js.map +1 -1
- package/lib/esm/version.d.ts +1 -1
- package/lib/esm/version.js +1 -1
- package/lib/esm/version.js.map +1 -1
- package/lib/scripts/index-min.js +1 -1
- package/lib/scripts/index-min.js.gz +0 -0
- package/lib/scripts/index-min.js.map +1 -1
- package/lib/scripts/session-replay-browser-min.js +1 -1
- package/lib/scripts/session-replay-browser-min.js.gz +0 -0
- package/lib/scripts/session-replay-browser-min.js.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mergeMutationEvents = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var rrweb_types_1 = require("@amplitude/rrweb-types");
|
|
6
|
+
function isMergeableMutation(event) {
|
|
7
|
+
if (event.type !== rrweb_types_1.EventType.IncrementalSnapshot)
|
|
8
|
+
return false;
|
|
9
|
+
var data = event.data;
|
|
10
|
+
return data.source === rrweb_types_1.IncrementalSource.Mutation && !data.isAttachIframe;
|
|
11
|
+
}
|
|
12
|
+
function mergeGroup(events) {
|
|
13
|
+
var e_1, _a, e_2, _b;
|
|
14
|
+
var first = events[0];
|
|
15
|
+
// Track first/last event index for each node's adds and removes.
|
|
16
|
+
// lastParentById: final parent from most recent add (last-write-wins).
|
|
17
|
+
var firstAddEventIndex = new Map();
|
|
18
|
+
var lastAddEventIndex = new Map();
|
|
19
|
+
var firstRemoveEventIndex = new Map();
|
|
20
|
+
var lastRemoveEventIndex = new Map();
|
|
21
|
+
var lastParentById = new Map();
|
|
22
|
+
events.forEach(function (e, i) {
|
|
23
|
+
var e_3, _a, e_4, _b;
|
|
24
|
+
var data = e.data;
|
|
25
|
+
try {
|
|
26
|
+
for (var _c = tslib_1.__values(data.adds), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
27
|
+
var add = _d.value;
|
|
28
|
+
if (!firstAddEventIndex.has(add.node.id))
|
|
29
|
+
firstAddEventIndex.set(add.node.id, i);
|
|
30
|
+
lastAddEventIndex.set(add.node.id, i);
|
|
31
|
+
lastParentById.set(add.node.id, add.parentId);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
35
|
+
finally {
|
|
36
|
+
try {
|
|
37
|
+
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
|
38
|
+
}
|
|
39
|
+
finally { if (e_3) throw e_3.error; }
|
|
40
|
+
}
|
|
41
|
+
try {
|
|
42
|
+
for (var _e = tslib_1.__values(data.removes), _f = _e.next(); !_f.done; _f = _e.next()) {
|
|
43
|
+
var remove = _f.value;
|
|
44
|
+
if (!firstRemoveEventIndex.has(remove.id))
|
|
45
|
+
firstRemoveEventIndex.set(remove.id, i);
|
|
46
|
+
lastRemoveEventIndex.set(remove.id, i);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
50
|
+
finally {
|
|
51
|
+
try {
|
|
52
|
+
if (_f && !_f.done && (_b = _e.return)) _b.call(_e);
|
|
53
|
+
}
|
|
54
|
+
finally { if (e_4) throw e_4.error; }
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
// Classify nodes that appear in both adds and removes within this window:
|
|
58
|
+
//
|
|
59
|
+
// Pure transient: created here (firstAddIdx < firstRemoveIdx) and ultimately removed
|
|
60
|
+
// (lastAddIdx < lastRemoveIdx). Cancel all adds + all removes.
|
|
61
|
+
//
|
|
62
|
+
// Pre-existing transient: pre-existed in DOM (firstRemoveIdx < firstAddIdx — removed before
|
|
63
|
+
// first add), then re-added, then removed again (lastAddIdx < lastRemoveIdx).
|
|
64
|
+
// The rrweb replayer processes all removes first: the re-add would still
|
|
65
|
+
// execute after both removes, leaving the node present when it should be
|
|
66
|
+
// absent. Fix: cancel the re-add and all post-add removes; keep only the
|
|
67
|
+
// pre-add removes (they represent the legitimate removal from the original
|
|
68
|
+
// location).
|
|
69
|
+
var transientIds = new Set();
|
|
70
|
+
var preExistingTransientIds = new Set();
|
|
71
|
+
try {
|
|
72
|
+
for (var firstAddEventIndex_1 = tslib_1.__values(firstAddEventIndex), firstAddEventIndex_1_1 = firstAddEventIndex_1.next(); !firstAddEventIndex_1_1.done; firstAddEventIndex_1_1 = firstAddEventIndex_1.next()) {
|
|
73
|
+
var _c = tslib_1.__read(firstAddEventIndex_1_1.value, 2), id = _c[0], firstAddIdx = _c[1];
|
|
74
|
+
var firstRemoveIdx = firstRemoveEventIndex.get(id);
|
|
75
|
+
if (firstRemoveIdx === undefined)
|
|
76
|
+
continue;
|
|
77
|
+
var lastAddIdx = lastAddEventIndex.get(id);
|
|
78
|
+
var lastRemoveIdx = lastRemoveEventIndex.get(id);
|
|
79
|
+
if (lastAddIdx >= lastRemoveIdx)
|
|
80
|
+
continue; // ultimately present — keep as-is
|
|
81
|
+
if (firstAddIdx < firstRemoveIdx) {
|
|
82
|
+
transientIds.add(id);
|
|
83
|
+
}
|
|
84
|
+
else if (firstRemoveIdx < firstAddIdx) {
|
|
85
|
+
// firstRemoveIdx < firstAddIdx: pre-existing node removed, re-added, then removed again
|
|
86
|
+
preExistingTransientIds.add(id);
|
|
87
|
+
}
|
|
88
|
+
// firstAddIdx === firstRemoveIdx: same-event move (remove+add in one rrweb event) followed
|
|
89
|
+
// by a later remove — keep all operations so the move and final removal survive
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
93
|
+
finally {
|
|
94
|
+
try {
|
|
95
|
+
if (firstAddEventIndex_1_1 && !firstAddEventIndex_1_1.done && (_a = firstAddEventIndex_1.return)) _a.call(firstAddEventIndex_1);
|
|
96
|
+
}
|
|
97
|
+
finally { if (e_1) throw e_1.error; }
|
|
98
|
+
}
|
|
99
|
+
// Cascade: nodes whose FINAL parent is effectively cancelled (transient or pre-existing-transient)
|
|
100
|
+
// would be orphaned, so treat them as cancelled too.
|
|
101
|
+
// Use lastParentById so a node moved away from a cancelled parent to a live one is not wrongly elided.
|
|
102
|
+
//
|
|
103
|
+
// Three cascade outcomes mirror the main-loop classification:
|
|
104
|
+
// transientIds: no pre-existing removes (node created in window), or no remove/add overlap
|
|
105
|
+
// preExistingTransientIds: nodeFirstRemoveIdx < nodeFirstAddIdx (pre-existing, removed before re-add)
|
|
106
|
+
// cascadeDropAddsOnlyIds: nodeFirstRemoveIdx === nodeFirstAddIdx (same-event move to cancelled parent)
|
|
107
|
+
// → drop adds but preserve removes from non-cancelled parents
|
|
108
|
+
var cascadeDropAddsOnlyIds = new Set();
|
|
109
|
+
if (transientIds.size > 0 || preExistingTransientIds.size > 0) {
|
|
110
|
+
var changed = true;
|
|
111
|
+
while (changed) {
|
|
112
|
+
changed = false;
|
|
113
|
+
try {
|
|
114
|
+
for (var lastParentById_1 = (e_2 = void 0, tslib_1.__values(lastParentById)), lastParentById_1_1 = lastParentById_1.next(); !lastParentById_1_1.done; lastParentById_1_1 = lastParentById_1.next()) {
|
|
115
|
+
var _d = tslib_1.__read(lastParentById_1_1.value, 2), nodeId = _d[0], parentId = _d[1];
|
|
116
|
+
if (!transientIds.has(nodeId) &&
|
|
117
|
+
!preExistingTransientIds.has(nodeId) &&
|
|
118
|
+
!cascadeDropAddsOnlyIds.has(nodeId) &&
|
|
119
|
+
(transientIds.has(parentId) || preExistingTransientIds.has(parentId) || cascadeDropAddsOnlyIds.has(parentId))) {
|
|
120
|
+
var nodeFirstRemoveIdx = firstRemoveEventIndex.get(nodeId);
|
|
121
|
+
var nodeFirstAddIdx = firstAddEventIndex.get(nodeId);
|
|
122
|
+
if (nodeFirstRemoveIdx !== undefined &&
|
|
123
|
+
nodeFirstAddIdx !== undefined &&
|
|
124
|
+
nodeFirstRemoveIdx < nodeFirstAddIdx) {
|
|
125
|
+
preExistingTransientIds.add(nodeId);
|
|
126
|
+
}
|
|
127
|
+
else if (nodeFirstRemoveIdx !== undefined &&
|
|
128
|
+
nodeFirstAddIdx !== undefined &&
|
|
129
|
+
nodeFirstRemoveIdx === nodeFirstAddIdx) {
|
|
130
|
+
cascadeDropAddsOnlyIds.add(nodeId);
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
transientIds.add(nodeId);
|
|
134
|
+
}
|
|
135
|
+
changed = true;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
140
|
+
finally {
|
|
141
|
+
try {
|
|
142
|
+
if (lastParentById_1_1 && !lastParentById_1_1.done && (_b = lastParentById_1.return)) _b.call(lastParentById_1);
|
|
143
|
+
}
|
|
144
|
+
finally { if (e_2) throw e_2.error; }
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
var needsFilter = transientIds.size > 0 || preExistingTransientIds.size > 0 || cascadeDropAddsOnlyIds.size > 0;
|
|
149
|
+
// Build filtered removes by iterating per event so we know each remove's event index.
|
|
150
|
+
// Pure transients: drop all removes.
|
|
151
|
+
// Pre-existing transients: drop removes at eventIdx >= firstAddIdx (the cancelled re-add cycle);
|
|
152
|
+
// keep removes at eventIdx < firstAddIdx (legitimate pre-window removal).
|
|
153
|
+
// Cascade drop-adds-only: keep removes from non-cancelled parents; drop removes from cancelled parents
|
|
154
|
+
// (the cancelled parent is never added in the replay, so a remove from it
|
|
155
|
+
// would reference a non-existent node in the replayer).
|
|
156
|
+
var filteredRemoves = [];
|
|
157
|
+
events.forEach(function (e, eventIdx) {
|
|
158
|
+
var e_5, _a;
|
|
159
|
+
try {
|
|
160
|
+
for (var _b = tslib_1.__values(e.data.removes), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
161
|
+
var r = _c.value;
|
|
162
|
+
if (transientIds.has(r.id))
|
|
163
|
+
continue;
|
|
164
|
+
if (preExistingTransientIds.has(r.id) && eventIdx >= firstAddEventIndex.get(r.id))
|
|
165
|
+
continue;
|
|
166
|
+
if (cascadeDropAddsOnlyIds.has(r.id) &&
|
|
167
|
+
(transientIds.has(r.parentId) ||
|
|
168
|
+
preExistingTransientIds.has(r.parentId) ||
|
|
169
|
+
cascadeDropAddsOnlyIds.has(r.parentId)))
|
|
170
|
+
continue;
|
|
171
|
+
filteredRemoves.push(r);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
175
|
+
finally {
|
|
176
|
+
try {
|
|
177
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
178
|
+
}
|
|
179
|
+
finally { if (e_5) throw e_5.error; }
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
var allAdds = events.flatMap(function (e) { return e.data.adds; });
|
|
183
|
+
var allTexts = events.flatMap(function (e) { return e.data.texts; });
|
|
184
|
+
var allAttributes = events.flatMap(function (e) { return e.data.attributes; });
|
|
185
|
+
var merged = {
|
|
186
|
+
source: rrweb_types_1.IncrementalSource.Mutation,
|
|
187
|
+
removes: filteredRemoves,
|
|
188
|
+
adds: needsFilter
|
|
189
|
+
? allAdds.filter(function (a) {
|
|
190
|
+
return !transientIds.has(a.node.id) &&
|
|
191
|
+
!preExistingTransientIds.has(a.node.id) &&
|
|
192
|
+
!cascadeDropAddsOnlyIds.has(a.node.id);
|
|
193
|
+
})
|
|
194
|
+
: allAdds,
|
|
195
|
+
texts: needsFilter
|
|
196
|
+
? allTexts.filter(function (t) { return !transientIds.has(t.id) && !preExistingTransientIds.has(t.id) && !cascadeDropAddsOnlyIds.has(t.id); })
|
|
197
|
+
: allTexts,
|
|
198
|
+
attributes: needsFilter
|
|
199
|
+
? allAttributes.filter(function (a) { return !transientIds.has(a.id) && !preExistingTransientIds.has(a.id) && !cascadeDropAddsOnlyIds.has(a.id); })
|
|
200
|
+
: allAttributes,
|
|
201
|
+
};
|
|
202
|
+
return tslib_1.__assign(tslib_1.__assign({}, first), { data: merged });
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Merges consecutive IncrementalSnapshot mutation events into a single event,
|
|
206
|
+
* reducing overall event count without changing replay semantics.
|
|
207
|
+
*
|
|
208
|
+
* isAttachIframe events are never merged — they carry a full iframe document
|
|
209
|
+
* tree and must remain isolated.
|
|
210
|
+
*/
|
|
211
|
+
function mergeMutationEvents(events) {
|
|
212
|
+
if (events.length <= 1)
|
|
213
|
+
return events;
|
|
214
|
+
var result = [];
|
|
215
|
+
var i = 0;
|
|
216
|
+
while (i < events.length) {
|
|
217
|
+
if (!isMergeableMutation(events[i])) {
|
|
218
|
+
result.push(events[i]);
|
|
219
|
+
i++;
|
|
220
|
+
continue;
|
|
221
|
+
}
|
|
222
|
+
var j = i + 1;
|
|
223
|
+
while (j < events.length && isMergeableMutation(events[j])) {
|
|
224
|
+
j++;
|
|
225
|
+
}
|
|
226
|
+
result.push(j > i + 1 ? mergeGroup(events.slice(i, j)) : events[i]);
|
|
227
|
+
i = j;
|
|
228
|
+
}
|
|
229
|
+
return result;
|
|
230
|
+
}
|
|
231
|
+
exports.mergeMutationEvents = mergeMutationEvents;
|
|
232
|
+
//# sourceMappingURL=merge-mutation-events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge-mutation-events.js","sourceRoot":"","sources":["../../../src/events/merge-mutation-events.ts"],"names":[],"mappings":";;;;AAAA,sDAAsE;AAGtE,SAAS,mBAAmB,CAAC,KAAoB;IAC/C,IAAI,KAAK,CAAC,IAAI,KAAK,uBAAS,CAAC,mBAAmB;QAAE,OAAO,KAAK,CAAC;IAC/D,IA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AC,sBAAsB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAlG,CAAkG,CAC1G;YACH,CAAC,CAAC,aAAa;KAClB,CAAC;IACF,OAAO,sCAAK,KAAK,KAAE,IAAI,EAAE,MAAM,GAAmB,CAAC;AACrD,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,mBAAmB,CAAC,MAAuB;IACzD,IAAI,MAAM,CAAC,MAAM,IAAI,CAAC;QAAE,OAAO,MAAM,CAAC;IAEtC,IAAM,MAAM,GAAoB,EAAE,CAAC;IACnC,IAAI,CAAC,GAAG,CAAC,CAAC;IAEV,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE;QACxB,IAAI,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE;YACnC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;YACvB,CAAC,EAAE,CAAC;YACJ,SAAS;SACV;QAED,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACd,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,IAAI,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE;YAC1D,CAAC,EAAE,CAAC;SACL;QAED,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QACpE,CAAC,GAAG,CAAC,CAAC;KACP;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAvBD,kDAuBC","sourcesContent":["import { EventType, IncrementalSource } from '@amplitude/rrweb-types';\nimport type { eventWithTime, mutationData } from '@amplitude/rrweb-types';\n\nfunction isMergeableMutation(event: eventWithTime): boolean {\n if (event.type !== EventType.IncrementalSnapshot) return false;\n const data = event.data as mutationData;\n return data.source === IncrementalSource.Mutation && !data.isAttachIframe;\n}\n\nfunction mergeGroup(events: eventWithTime[]): eventWithTime {\n const first = events[0];\n\n // Track first/last event index for each node's adds and removes.\n // lastParentById: final parent from most recent add (last-write-wins).\n const firstAddEventIndex = new Map<number, number>();\n const lastAddEventIndex = new Map<number, number>();\n const firstRemoveEventIndex = new Map<number, number>();\n const lastRemoveEventIndex = new Map<number, number>();\n const lastParentById = new Map<number, number>();\n events.forEach((e, i) => {\n const data = e.data as mutationData;\n for (const add of data.adds) {\n if (!firstAddEventIndex.has(add.node.id)) firstAddEventIndex.set(add.node.id, i);\n lastAddEventIndex.set(add.node.id, i);\n lastParentById.set(add.node.id, add.parentId);\n }\n for (const remove of data.removes) {\n if (!firstRemoveEventIndex.has(remove.id)) firstRemoveEventIndex.set(remove.id, i);\n lastRemoveEventIndex.set(remove.id, i);\n }\n });\n\n // Classify nodes that appear in both adds and removes within this window:\n //\n // Pure transient: created here (firstAddIdx < firstRemoveIdx) and ultimately removed\n // (lastAddIdx < lastRemoveIdx). Cancel all adds + all removes.\n //\n // Pre-existing transient: pre-existed in DOM (firstRemoveIdx < firstAddIdx — removed before\n // first add), then re-added, then removed again (lastAddIdx < lastRemoveIdx).\n // The rrweb replayer processes all removes first: the re-add would still\n // execute after both removes, leaving the node present when it should be\n // absent. Fix: cancel the re-add and all post-add removes; keep only the\n // pre-add removes (they represent the legitimate removal from the original\n // location).\n const transientIds = new Set<number>();\n const preExistingTransientIds = new Set<number>();\n\n for (const [id, firstAddIdx] of firstAddEventIndex) {\n const firstRemoveIdx = firstRemoveEventIndex.get(id);\n if (firstRemoveIdx === undefined) continue;\n const lastAddIdx = lastAddEventIndex.get(id)!;\n const lastRemoveIdx = lastRemoveEventIndex.get(id)!;\n if (lastAddIdx >= lastRemoveIdx) continue; // ultimately present — keep as-is\n\n if (firstAddIdx < firstRemoveIdx) {\n transientIds.add(id);\n } else if (firstRemoveIdx < firstAddIdx) {\n // firstRemoveIdx < firstAddIdx: pre-existing node removed, re-added, then removed again\n preExistingTransientIds.add(id);\n }\n // firstAddIdx === firstRemoveIdx: same-event move (remove+add in one rrweb event) followed\n // by a later remove — keep all operations so the move and final removal survive\n }\n\n // Cascade: nodes whose FINAL parent is effectively cancelled (transient or pre-existing-transient)\n // would be orphaned, so treat them as cancelled too.\n // Use lastParentById so a node moved away from a cancelled parent to a live one is not wrongly elided.\n //\n // Three cascade outcomes mirror the main-loop classification:\n // transientIds: no pre-existing removes (node created in window), or no remove/add overlap\n // preExistingTransientIds: nodeFirstRemoveIdx < nodeFirstAddIdx (pre-existing, removed before re-add)\n // cascadeDropAddsOnlyIds: nodeFirstRemoveIdx === nodeFirstAddIdx (same-event move to cancelled parent)\n // → drop adds but preserve removes from non-cancelled parents\n const cascadeDropAddsOnlyIds = new Set<number>();\n if (transientIds.size > 0 || preExistingTransientIds.size > 0) {\n let changed = true;\n while (changed) {\n changed = false;\n for (const [nodeId, parentId] of lastParentById) {\n if (\n !transientIds.has(nodeId) &&\n !preExistingTransientIds.has(nodeId) &&\n !cascadeDropAddsOnlyIds.has(nodeId) &&\n (transientIds.has(parentId) || preExistingTransientIds.has(parentId) || cascadeDropAddsOnlyIds.has(parentId))\n ) {\n const nodeFirstRemoveIdx = firstRemoveEventIndex.get(nodeId);\n const nodeFirstAddIdx = firstAddEventIndex.get(nodeId);\n if (\n nodeFirstRemoveIdx !== undefined &&\n nodeFirstAddIdx !== undefined &&\n nodeFirstRemoveIdx < nodeFirstAddIdx\n ) {\n preExistingTransientIds.add(nodeId);\n } else if (\n nodeFirstRemoveIdx !== undefined &&\n nodeFirstAddIdx !== undefined &&\n nodeFirstRemoveIdx === nodeFirstAddIdx\n ) {\n cascadeDropAddsOnlyIds.add(nodeId);\n } else {\n transientIds.add(nodeId);\n }\n changed = true;\n }\n }\n }\n }\n\n const needsFilter = transientIds.size > 0 || preExistingTransientIds.size > 0 || cascadeDropAddsOnlyIds.size > 0;\n\n // Build filtered removes by iterating per event so we know each remove's event index.\n // Pure transients: drop all removes.\n // Pre-existing transients: drop removes at eventIdx >= firstAddIdx (the cancelled re-add cycle);\n // keep removes at eventIdx < firstAddIdx (legitimate pre-window removal).\n // Cascade drop-adds-only: keep removes from non-cancelled parents; drop removes from cancelled parents\n // (the cancelled parent is never added in the replay, so a remove from it\n // would reference a non-existent node in the replayer).\n const filteredRemoves: mutationData['removes'][0][] = [];\n events.forEach((e, eventIdx) => {\n for (const r of (e.data as mutationData).removes) {\n if (transientIds.has(r.id)) continue;\n if (preExistingTransientIds.has(r.id) && eventIdx >= firstAddEventIndex.get(r.id)!) continue;\n if (\n cascadeDropAddsOnlyIds.has(r.id) &&\n (transientIds.has(r.parentId) ||\n preExistingTransientIds.has(r.parentId) ||\n cascadeDropAddsOnlyIds.has(r.parentId))\n )\n continue;\n filteredRemoves.push(r);\n }\n });\n\n const allAdds = events.flatMap((e) => (e.data as mutationData).adds);\n const allTexts = events.flatMap((e) => (e.data as mutationData).texts);\n const allAttributes = events.flatMap((e) => (e.data as mutationData).attributes);\n\n const merged: mutationData = {\n source: IncrementalSource.Mutation,\n removes: filteredRemoves,\n adds: needsFilter\n ? allAdds.filter(\n (a) =>\n !transientIds.has(a.node.id) &&\n !preExistingTransientIds.has(a.node.id) &&\n !cascadeDropAddsOnlyIds.has(a.node.id),\n )\n : allAdds,\n texts: needsFilter\n ? allTexts.filter(\n (t) => !transientIds.has(t.id) && !preExistingTransientIds.has(t.id) && !cascadeDropAddsOnlyIds.has(t.id),\n )\n : allTexts,\n attributes: needsFilter\n ? allAttributes.filter(\n (a) => !transientIds.has(a.id) && !preExistingTransientIds.has(a.id) && !cascadeDropAddsOnlyIds.has(a.id),\n )\n : allAttributes,\n };\n return { ...first, data: merged } as eventWithTime;\n}\n\n/**\n * Merges consecutive IncrementalSnapshot mutation events into a single event,\n * reducing overall event count without changing replay semantics.\n *\n * isAttachIframe events are never merged — they carry a full iframe document\n * tree and must remain isolated.\n */\nexport function mergeMutationEvents(events: eventWithTime[]): eventWithTime[] {\n if (events.length <= 1) return events;\n\n const result: eventWithTime[] = [];\n let i = 0;\n\n while (i < events.length) {\n if (!isMergeableMutation(events[i])) {\n result.push(events[i]);\n i++;\n continue;\n }\n\n let j = i + 1;\n while (j < events.length && isMergeableMutation(events[j])) {\n j++;\n }\n\n result.push(j > i + 1 ? mergeGroup(events.slice(i, j)) : events[i]);\n i = j;\n }\n\n return result;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-replay.d.ts","sourceRoot":"","sources":["../../src/session-replay.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,OAAO,EASR,MAAM,2BAA2B,CAAC;AAKnC,OAAO,EACL,aAAa,EACb,yBAAyB,EACzB,kCAAkC,EAInC,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAEL,gBAAgB,EASjB,MAAM,aAAa,CAAC;AAWrB,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAQ5D,OAAO,EACL,sBAAsB,EACtB,0BAA0B,IAAI,mCAAmC,EAIjE,kBAAkB,IAAI,mBAAmB,EACzC,oBAAoB,EACpB,2BAA2B,EAC5B,MAAM,0BAA0B,CAAC;AAOlC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpD,KAAK,WAAW,GAAG,CAAC,CAAC,EAAE,mBAAmB,GAAG,KAAK,KAAK,IAAI,CAAC;AAE5D,qBAAa,aAAc,YAAW,sBAAsB;IAC1D,IAAI,SAAuC;IAC3C,MAAM,EAAE,yBAAyB,GAAG,SAAS,CAAC;IAC9C,qBAAqB,EAAE,kCAAkC,GAAG,SAAS,CAAC;IACtE,WAAW,EAAE,mBAAmB,GAAG,SAAS,CAAC;IAC7C,aAAa,CAAC,EAAE,mCAAmC,CAAC,QAAQ,GAAG,aAAa,EAAE,MAAM,CAAC,CAAC;IACtF,cAAc,EAAE,OAAO,CAAC;IACxB,oBAAoB,EAAE,UAAU,CAAC,cAAc,CAAC,GAAG,IAAI,CAAQ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UX;IAEF;;;;OAIG;IACH,OAAO,CAAC,iBAAiB,CAIvB;IAEF,2BAA2B,oBACR,2BAA2B,mGA6F5C;IAEF,UAAU,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM;IAShC,UAAU,CAAC,sBAAsB,UAAQ;IAgB/C,YAAY;IAUZ,eAAe;IA+Df,iBAAiB,IAAI,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS;IAWlD,oBAAoB,IAAI,MAAM,GAAG,SAAS;IAgCpC,mBAAmB,CAAC,aAAa,EAAE,aAAa,GAAG,SAAS;YAyCpD,iBAAiB;IAezB,YAAY,CAAC,iBAAiB,UAAO;YAmB7B,aAAa;IAmH3B,mBAAmB,cACN,gBAAgB;;kDAmC3B;IAEF,mBAAmB,aAUjB;IAEF,WAAW;IAIX,YAAY;IAIN,KAAK,CAAC,QAAQ,UAAQ;IAI5B,QAAQ;IAOR,OAAO,CAAC,UAAU;IAYlB,OAAO,CAAC,WAAW;YAyBL,0BAA0B;CAUzC"}
|
|
@@ -810,6 +810,7 @@ var SessionReplay = /** @class */ (function () {
|
|
|
810
810
|
maskAttributeFn: (0, helpers_1.maskAttributeFn)(privacyConfig, function () { return _this.currentPageUrl; }),
|
|
811
811
|
maskTextSelector: this.getMaskTextSelectors(),
|
|
812
812
|
recordCanvas: false,
|
|
813
|
+
captureAdoptedStyleSheets: config.captureAdoptedStyleSheets,
|
|
813
814
|
slimDOMOptions: {
|
|
814
815
|
script: (_g = config.omitElementTags) === null || _g === void 0 ? void 0 : _g.script,
|
|
815
816
|
comment: (_h = config.omitElementTags) === null || _h === void 0 ? void 0 : _h.comment,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-replay.js","sourceRoot":"","sources":["../../src/session-replay.ts"],"names":[],"mappings":";;;;AAAA,4DAYmC;AAEnC,gFAAgF;AAChF,sDAAoG;AACpG,wDAAkF;AASlF,yCAWqB;AACrB,qCASmB;AACnB,8DAA4D;AAC5D,0DAAuF;AACv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SAAS,uBAAT,SAAS,CAAE,QAAQ,EAAE,EAAC,CAAC,CAAC,IAAA,iCAAgB,EAAC,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAE7F,IAAI,CAAC,QAAQ,GAAG;YACd,YAAY,cAAA;YACZ,WAAW,aAAA;YACX,YAAY,cAAA;YACZ,SAAS,WAAA;YACT,SAAS,WAAA;YACT,UAAU,EAAE,YAAY,CAAC,UAAU;YACnC,aAAa,EAAE,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;YACvC,gBAAgB,kBAAA;YAChB,iBAAiB,EAAE,mCAAmC;YACtD,oBAAoB,sBAAA;SACrB,CAAC;IACJ,CAAC;IAEa,kDAA0B,GAAxC;;;;;;;6BACM,CAAA,CAAA,MAAA,MAAA,MAAA,IAAI,CAAC,MAAM,0CAAE,aAAa,0CAAE,OAAO,0CAAE,OAAO,KAAI,CAAC,IAAI,CAAC,gBAAgB,CAAA,EAAtE,wBAAsE;;;;wBAElB,8FAAa,aAAa,QAAC;;wBAArD,qBAAqB,GAAK,CAAA,SAA2B,CAAA,iBAAhC;wBAC/C,IAAI,CAAC,gBAAgB,GAAG,IAAI,qBAAqB,EAAE,CAAC;;;;wBAEpD,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,mDAAmD,EAAE,OAAK,CAAC,CAAC;;;;;;KAG1F;IACH,oBAAC;AAAD,CAAC,AAl5BD,IAk5BC;AAl5BY,sCAAa","sourcesContent":["import {\n getAnalyticsConnector,\n getGlobalScope,\n ILogger,\n Logger,\n LogLevel,\n returnWrapper,\n SpecialEventType,\n generateHashCode,\n getOrCreateWindowMessenger,\n enableBackgroundCapture,\n AMPLITUDE_ORIGINS_MAP,\n} from '@amplitude/analytics-core';\n\n// Import only specific types to avoid pulling in the entire rrweb-types package\nimport { eventWithTime, EventType as RRWebEventType, scrollCallback } from '@amplitude/rrweb-types';\nimport { createSessionReplayJoinedConfigGenerator } from './config/joined-config';\nimport {\n LoggingConfig,\n SessionReplayJoinedConfig,\n SessionReplayJoinedConfigGenerator,\n SessionReplayLocalConfig,\n SessionReplayMetadata,\n SessionReplayRemoteConfig,\n} from './config/types';\nimport {\n BLOCK_CLASS,\n CustomRRwebEvent,\n DEFAULT_SESSION_REPLAY_PROPERTY,\n INTERACTION_MAX_INTERVAL,\n INTERACTION_MIN_INTERVAL,\n MASK_TEXT_CLASS,\n SESSION_REPLAY_DEBUG_PROPERTY,\n SESSION_REPLAY_EU_URL,\n SESSION_REPLAY_SERVER_URL,\n SESSION_REPLAY_STAGING_URL,\n} from './constants';\nimport {\n getServerUrl,\n getDebugConfig,\n getEffectiveMaskLevel,\n getPageUrl,\n getStorageSize,\n getCurrentUrl,\n maskFn,\n maskAttributeFn,\n} from './helpers';\nimport { EventCompressor } from './events/event-compressor';\nimport { createEventsManager, EventsManagerWithBeacon } from './events/events-manager';\nimport { MultiEventManager } from './events/multi-manager';\nimport { clickBatcher, ClickHandler, clickNonBatcher } from './hooks/click';\nimport { ScrollWatcher } from './hooks/scroll';\nimport { SessionIdentifiers } from './identifiers';\nimport { SafeLoggerProvider } from './logger';\nimport { evaluateTargetingAndStore } from './targeting/targeting-manager';\nimport {\n AmplitudeSessionReplay,\n SessionReplayEventsManager as AmplitudeSessionReplayEventsManager,\n DebugInfo,\n EventsManagerWithType,\n EventType,\n SessionIdentifiers as ISessionIdentifiers,\n SessionReplayOptions,\n SessionReplayTargetingInput,\n} from './typings/session-replay';\nimport { isSessionInSample } from './sampling';\nimport { VERSION } from './version';\n\n// Import only the type for NetworkRequestEvent to keep type safety\nimport type { NetworkObservers, NetworkRequestEvent } from './observers';\nimport { createUrlTrackingPlugin, subscribeToUrlChanges } from './plugins/url-tracking-plugin';\nimport type { RecordFunction } from './utils/rrweb';\n\ntype PageLeaveFn = (e: PageTransitionEvent | Event) => void;\n\nexport class SessionReplay implements AmplitudeSessionReplay {\n name = '@amplitude/session-replay-browser';\n config: SessionReplayJoinedConfig | undefined;\n joinedConfigGenerator: SessionReplayJoinedConfigGenerator | undefined;\n identifiers: ISessionIdentifiers | undefined;\n eventsManager?: AmplitudeSessionReplayEventsManager<'replay' | 'interaction', string>;\n loggerProvider: ILogger;\n recordCancelCallback: ReturnType<RecordFunction> | null = null;\n eventCount = 0;\n eventCompressor: EventCompressor | undefined;\n sessionTargetingMatch = false;\n private lastTargetingParams?: SessionReplayTargetingInput;\n private lastShouldRecordDecision?: boolean;\n\n // Visible for testing only\n pageLeaveFns: PageLeaveFn[] = [];\n private scrollHook?: scrollCallback;\n private clickHandler?: ClickHandler;\n private networkObservers?: NetworkObservers;\n private metadata: SessionReplayMetadata | undefined;\n\n // Cache the dynamically imported record function\n private recordFunction: RecordFunction | null = null;\n private recordEventsInFlight = false;\n\n /** Current page URL, kept in sync with SPA navigations for URL-based masking */\n private currentPageUrl = '';\n\n private recordEventsPendingShouldLogMetadata: boolean | null = null;\n\n /** Cleanup for URL change listener used to re-evaluate targeting on SPA route changes */\n private urlChangeCleanup: (() => void) | null = null;\n /** Monotonic counter to ignore stale URL-change targeting results */\n private latestUrlChangeTargetingEvaluationId = 0;\n\n constructor() {\n this.loggerProvider = new SafeLoggerProvider(new Logger());\n }\n\n init(apiKey: string, options: SessionReplayOptions) {\n return returnWrapper(this._init(apiKey, options));\n }\n\n private teardownEventListeners = (teardown: boolean) => {\n const globalScope = getGlobalScope();\n if (globalScope) {\n globalScope.removeEventListener('blur', this.blurListener);\n globalScope.removeEventListener('focus', this.focusListener);\n !teardown && globalScope.addEventListener('blur', this.blurListener);\n !teardown && globalScope.addEventListener('focus', this.focusListener);\n // prefer pagehide to unload events, this is the standard going forward. it is not\n // 100% reliable, but is bfcache-compatible.\n if (globalScope.self && 'onpagehide' in globalScope.self) {\n globalScope.removeEventListener('pagehide', this.pageLeaveListener);\n !teardown && globalScope.addEventListener('pagehide', this.pageLeaveListener);\n } else {\n // this has performance implications, but is the only way we can reliably send events\n // in browser that don't support pagehide.\n globalScope.removeEventListener('beforeunload', this.pageLeaveListener);\n !teardown && globalScope.addEventListener('beforeunload', this.pageLeaveListener);\n }\n }\n };\n\n /**\n * Subscribes to SPA URL changes via the URL tracking plugin. Always keeps\n * `currentPageUrl` in sync (needed for URL-based masking). When a targeting\n * config is present it also re-evaluates targeting on every navigation.\n */\n private setupUrlChangeListener(): void {\n // If init() runs multiple times, remove the previous URL-change subscription first\n // so we don't leak callbacks and trigger duplicate targeting evaluations.\n this.urlChangeCleanup?.();\n\n const globalScope = getGlobalScope() as Window | undefined;\n if (!globalScope?.location) {\n return;\n }\n\n const hasTargeting = !!this.config?.targetingConfig;\n\n const onUrlChange = (href: string): void => {\n this.currentPageUrl = href;\n\n if (hasTargeting) {\n const evaluationId = ++this.latestUrlChangeTargetingEvaluationId;\n void this.evaluateTargetingAndCapture(\n {\n userProperties: {},\n event: undefined,\n page: { url: href },\n },\n false,\n false,\n true,\n );\n this.loggerProvider.debug(`Queued URL-change targeting re-evaluation #${evaluationId} for ${href}.`);\n }\n };\n type UrlUnsubscribe = (scope: Window | undefined, cb: (href: string) => void) => () => void;\n const unsubscribe = (subscribeToUrlChanges as UrlUnsubscribe)(globalScope, onUrlChange);\n\n this.urlChangeCleanup = (): void => {\n unsubscribe();\n this.urlChangeCleanup = null;\n };\n }\n\n private getCurrentPageForTargeting(): SessionReplayTargetingInput['page'] {\n const currentUrl = getGlobalScope()?.location?.href;\n return currentUrl != null ? { url: currentUrl } : undefined;\n }\n\n protected async _init(apiKey: string, options: SessionReplayOptions) {\n // Re-init should always tear down any previous URL-change subscription, even when the\n // next config has no targeting config and we don't subscribe again.\n this.urlChangeCleanup?.();\n\n this.loggerProvider = new SafeLoggerProvider(options.loggerProvider || new Logger());\n Object.prototype.hasOwnProperty.call(options, 'logLevel') &&\n this.loggerProvider.enable(options.logLevel as LogLevel);\n this.currentPageUrl = getCurrentUrl();\n this.identifiers = new SessionIdentifiers({ sessionId: options.sessionId, deviceId: options.deviceId });\n this.joinedConfigGenerator = await createSessionReplayJoinedConfigGenerator(apiKey, options);\n const { joinedConfig, localConfig, remoteConfig } = await this.joinedConfigGenerator.generateJoinedConfig();\n this.config = joinedConfig;\n\n this.setMetadata(\n options.sessionId,\n joinedConfig,\n localConfig,\n remoteConfig,\n options.version?.version,\n VERSION,\n options.version?.type,\n );\n\n this.pageLeaveFns = [];\n\n if (options.sessionId && this.config.interactionConfig?.enabled) {\n const scrollWatcher = ScrollWatcher.default(\n {\n sessionId: options.sessionId,\n type: 'interaction',\n },\n this.config,\n );\n this.pageLeaveFns = [scrollWatcher.send(this.getDeviceId.bind(this)).bind(scrollWatcher)];\n this.scrollHook = scrollWatcher.hook.bind(scrollWatcher);\n this.clickHandler = new ClickHandler(this.loggerProvider, scrollWatcher);\n }\n\n const managers: EventsManagerWithType<EventType, string>[] = [];\n let { storeType } = this.config;\n if (storeType === 'idb' && !getGlobalScope()?.indexedDB) {\n storeType = 'memory';\n this.loggerProvider.warn('Could not use preferred indexedDB storage, reverting to in memory option.');\n }\n this.loggerProvider.log(`Using ${storeType} for event storage.`);\n let compressionWorkerScript: string | undefined;\n let trackDestinationWorkerScript: string | undefined;\n const globalScope = getGlobalScope();\n if (this.config.useWebWorker && globalScope && globalScope.Worker) {\n const { compressionScript, trackDestinationScript } = await import('./worker');\n compressionWorkerScript = compressionScript;\n trackDestinationWorkerScript = trackDestinationScript;\n }\n\n let rrwebEventManager: EventsManagerWithBeacon<'replay'> | undefined;\n try {\n rrwebEventManager = await createEventsManager<'replay'>({\n config: this.config,\n type: 'replay',\n storeType,\n trackDestinationWorkerScript,\n });\n managers.push({ name: 'replay', manager: rrwebEventManager });\n } catch (error) {\n const typedError = error as Error;\n this.loggerProvider.warn(`Error occurred while creating replay events manager: ${typedError.toString()}`);\n }\n\n if (this.config.interactionConfig?.enabled) {\n const payloadBatcher = this.config.interactionConfig.batch ? clickBatcher : clickNonBatcher;\n try {\n const interactionEventManager = await createEventsManager<'interaction'>({\n config: this.config,\n type: 'interaction',\n minInterval: this.config.interactionConfig.trackEveryNms ?? INTERACTION_MIN_INTERVAL,\n maxInterval: INTERACTION_MAX_INTERVAL,\n payloadBatcher,\n storeType,\n trackDestinationWorkerScript,\n });\n managers.push({ name: 'interaction', manager: interactionEventManager });\n } catch (error) {\n const typedError = error as Error;\n this.loggerProvider.warn(`Error occurred while creating interaction events manager: ${typedError.toString()}`);\n }\n }\n\n this.eventsManager = new MultiEventManager<'replay' | 'interaction', string>(...managers);\n // To prevent too many threads.\n if (this.eventCompressor) {\n this.eventCompressor.terminate();\n }\n\n this.eventCompressor = new EventCompressor(\n this.eventsManager,\n this.config,\n this.getDeviceId(),\n compressionWorkerScript,\n () => this.sendEvents(),\n );\n\n // Register beacon fallback for page exit. sendBeacon survives page unload\n // and delivers any incremental events that haven't been flushed via fetch yet.\n this.pageLeaveFns = [\n ...this.pageLeaveFns,\n () => {\n if (!this.config || !this.identifiers?.sessionId || !rrwebEventManager) return;\n const events = rrwebEventManager.getBeaconEvents();\n if (!events.length) return;\n const deviceId = this.getDeviceId();\n if (!deviceId) return;\n rrwebEventManager.trackDestination.sendBeacon({\n events,\n sessionId: this.identifiers.sessionId,\n deviceId,\n apiKey: this.config.apiKey,\n serverZone: this.config.serverZone,\n });\n },\n ];\n\n await this.initializeNetworkObservers();\n\n // Enable background capture when this page is opened by the Amplitude app\n // (window.opener exists). Uses the shared messenger singleton so that if\n // autocapture is also loaded, both share a single messenger and script load.\n if (getGlobalScope()?.opener) {\n const messenger = getOrCreateWindowMessenger();\n enableBackgroundCapture(messenger);\n messenger.setup({\n logger: this.loggerProvider,\n ...(this.config.serverZone && { endpoint: AMPLITUDE_ORIGINS_MAP[this.config.serverZone] }),\n });\n }\n\n this.loggerProvider.log('Installing @amplitude/session-replay-browser.');\n\n this.teardownEventListeners(false);\n\n await this.evaluateTargetingAndCapture(\n { userProperties: options.userProperties, page: this.getCurrentPageForTargeting() },\n true,\n );\n\n const needsUrlTracking = this.config.targetingConfig || (this.config.privacyConfig?.urlMaskLevels?.length ?? 0) > 0;\n if (needsUrlTracking) {\n this.setupUrlChangeListener();\n }\n }\n\n setSessionId(sessionId: string | number, deviceId?: string) {\n return returnWrapper(this.asyncSetSessionId(sessionId, deviceId));\n }\n\n async asyncSetSessionId(\n sessionId: string | number,\n deviceId?: string,\n options?: { userProperties?: { [key: string]: any } },\n ) {\n // Invalidate any in-flight URL-change re-evaluations from the previous session.\n this.latestUrlChangeTargetingEvaluationId++;\n this.sessionTargetingMatch = false;\n this.lastShouldRecordDecision = undefined; // Reset targeting decision for new session\n\n const previousSessionId = this.identifiers && this.identifiers.sessionId;\n if (previousSessionId) {\n this.sendEvents(previousSessionId);\n }\n\n const deviceIdForReplayId = deviceId || this.getDeviceId();\n this.identifiers = new SessionIdentifiers({\n sessionId: sessionId,\n deviceId: deviceIdForReplayId,\n });\n\n // If there is no previous session id, SDK is being initialized for the first time,\n // and config was just fetched in initialization, so no need to fetch it a second time\n if (this.joinedConfigGenerator && previousSessionId) {\n const { joinedConfig } = await this.joinedConfigGenerator.generateJoinedConfig();\n this.config = joinedConfig;\n }\n\n if (this.config?.targetingConfig) {\n await this.evaluateTargetingAndCapture(\n { userProperties: options?.userProperties, page: this.getCurrentPageForTargeting() },\n false,\n true,\n );\n } else {\n await this.recordEvents();\n }\n }\n\n getSessionReplayProperties() {\n const config = this.config;\n const identifiers = this.identifiers;\n if (!config || !identifiers) {\n this.loggerProvider.warn('Session replay init has not been called, cannot get session replay properties.');\n return {};\n }\n\n const shouldRecord = this.getShouldRecord();\n let eventProperties: { [key: string]: string | null } = {};\n\n if (shouldRecord) {\n eventProperties = {\n [DEFAULT_SESSION_REPLAY_PROPERTY]: identifiers.sessionReplayId ? identifiers.sessionReplayId : null,\n };\n if (config.debugMode) {\n eventProperties[SESSION_REPLAY_DEBUG_PROPERTY] = JSON.stringify({\n appHash: generateHashCode(config.apiKey).toString(),\n });\n }\n }\n\n void this.addCustomRRWebEvent(\n CustomRRwebEvent.GET_SR_PROPS,\n {\n shouldRecord,\n eventProperties: eventProperties,\n },\n this.eventCount === 10,\n );\n if (this.eventCount === 10) {\n this.eventCount = 0;\n }\n this.eventCount++;\n\n return eventProperties;\n }\n\n blurListener = () => {\n this.sendEvents();\n };\n\n focusListener = () => {\n if (this.recordCancelCallback && this.recordFunction) {\n try {\n this.recordFunction.takeFullSnapshot(true);\n } catch (error) {\n this.loggerProvider.warn('Failed to take full snapshot on focus:', error);\n }\n } else if (!this.recordEventsInFlight) {\n void this.recordEvents(false);\n }\n };\n\n /**\n * This is an instance member so that if init is called multiple times\n * it doesn't add another listener to the page leave event. This is to\n * prevent duplicate listener actions from firing.\n */\n private pageLeaveListener = (e: PageTransitionEvent | Event) => {\n this.pageLeaveFns.forEach((fn) => {\n fn(e);\n });\n };\n\n evaluateTargetingAndCapture = async (\n targetingParams: SessionReplayTargetingInput,\n isInit = false,\n forceRestart = false,\n forceTargetingReevaluation = false,\n ) => {\n if (!this.identifiers || !this.identifiers.sessionId || !this.config) {\n if (this.identifiers && !this.identifiers.sessionId) {\n this.loggerProvider.log('Session ID has not been set yet, cannot evaluate targeting for Session Replay.');\n } else {\n this.loggerProvider.warn('Session replay init has not been called, cannot evaluate targeting.');\n }\n return;\n }\n\n // Handle cases where there's no targeting config\n if (!this.config.targetingConfig) {\n if (isInit) {\n this.loggerProvider.log('Targeting config has not been set yet, cannot evaluate targeting.');\n } else {\n this.loggerProvider.log('No targeting config set, skipping initialization/recording for event.');\n return;\n }\n }\n\n // Store targeting parameters for use in getShouldRecord\n this.lastTargetingParams = targetingParams;\n\n // Re-evaluate only until we get the first match in this session.\n // Once matched, keep recording for the rest of the session.\n const targetingConfig = this.config.targetingConfig;\n const shouldReEvaluate = targetingConfig && !this.sessionTargetingMatch;\n if (shouldReEvaluate) {\n // Capture URL-change evaluation id so out-of-order async completions can be discarded.\n const urlChangeEvaluationId = forceTargetingReevaluation ? this.latestUrlChangeTargetingEvaluationId : undefined;\n let eventForTargeting = targetingParams.event;\n if (\n eventForTargeting &&\n Object.values(SpecialEventType).includes(eventForTargeting.event_type as SpecialEventType)\n ) {\n eventForTargeting = undefined;\n }\n\n const pageUrl = targetingParams.page?.url ?? getGlobalScope()?.location?.href ?? '';\n const pageForTargeting = targetingParams.page ?? (pageUrl !== '' ? { url: pageUrl } : undefined);\n\n const targetingMatch = await evaluateTargetingAndStore({\n sessionId: this.identifiers.sessionId,\n targetingConfig,\n loggerProvider: this.loggerProvider,\n apiKey: this.config.apiKey,\n targetingParams: {\n userProperties: targetingParams.userProperties,\n event: eventForTargeting,\n page: pageForTargeting,\n },\n urlChange: forceTargetingReevaluation,\n });\n\n if (\n forceTargetingReevaluation &&\n urlChangeEvaluationId !== undefined &&\n urlChangeEvaluationId !== this.latestUrlChangeTargetingEvaluationId\n ) {\n this.loggerProvider.debug(\n `Ignoring stale URL-change targeting result #${urlChangeEvaluationId}; latest is #${this.latestUrlChangeTargetingEvaluationId}.`,\n );\n return;\n }\n // Keep targeting match monotonic within a session: once true, always true.\n // This avoids races where an older in-flight evaluation resolves false after\n // a newer evaluation already resolved true.\n this.sessionTargetingMatch = this.sessionTargetingMatch || targetingMatch;\n\n this.loggerProvider.debug(\n JSON.stringify(\n {\n name: 'targeted replay capture config',\n sessionTargetingMatch: this.sessionTargetingMatch,\n event: eventForTargeting,\n targetingParams: targetingParams,\n },\n null,\n 2,\n ),\n );\n }\n\n if (isInit) {\n void this.initialize(true);\n } else if (forceRestart || !this.recordCancelCallback) {\n this.loggerProvider.log('Recording events for session due to forceRestart or no ongoing recording.');\n await this.recordEvents();\n }\n };\n\n sendEvents(sessionId?: string | number) {\n const sessionIdToSend = sessionId || this.identifiers?.sessionId;\n const deviceId = this.getDeviceId();\n this.eventsManager &&\n sessionIdToSend &&\n deviceId &&\n this.eventsManager.sendCurrentSequenceEvents({ sessionId: sessionIdToSend, deviceId });\n }\n\n async initialize(shouldSendStoredEvents = false) {\n if (!this.identifiers?.sessionId) {\n this.loggerProvider.log(`Session is not being recorded due to lack of session id.`);\n return Promise.resolve();\n }\n\n const deviceId = this.getDeviceId();\n if (!deviceId) {\n this.loggerProvider.log(`Session is not being recorded due to lack of device id.`);\n return Promise.resolve();\n }\n this.eventsManager && shouldSendStoredEvents && void this.eventsManager.sendStoredEvents({ deviceId });\n\n return this.recordEvents();\n }\n\n shouldOptOut() {\n let identityStoreOptOut: boolean | undefined;\n if (this.config?.instanceName) {\n const identityStore = getAnalyticsConnector(this.config.instanceName).identityStore;\n identityStoreOptOut = identityStore.getIdentity().optOut;\n }\n\n return identityStoreOptOut !== undefined ? identityStoreOptOut : this.config?.optOut;\n }\n\n getShouldRecord() {\n if (!this.identifiers || !this.config || !this.identifiers.sessionId) {\n this.loggerProvider.warn(`Session is not being recorded due to lack of config, please call sessionReplay.init.`);\n return false;\n }\n\n if (!this.config.captureEnabled) {\n this.loggerProvider.log(\n `Session ${this.identifiers.sessionId} not being captured due to capture being disabled for project or because the remote config could not be fetched.`,\n );\n return false;\n }\n\n if (this.shouldOptOut()) {\n this.loggerProvider.log(`Opting session ${this.identifiers.sessionId} out of recording due to optOut config.`);\n return false;\n }\n\n let shouldRecord = false;\n let message = '';\n let matched = false;\n\n // If targetingConfig exists, we'll use the sessionTargetingMatch to determine whether to record\n // Otherwise, we'll evaluate the session against the overall sample rate\n if (this.config.targetingConfig) {\n if (!this.sessionTargetingMatch) {\n message = `Not capturing replays for session ${this.identifiers.sessionId} due to not matching targeting conditions.`;\n this.loggerProvider.log(message);\n shouldRecord = false;\n matched = false;\n } else {\n message = `Capturing replays for session ${this.identifiers.sessionId} due to matching targeting conditions.`;\n this.loggerProvider.log(message);\n shouldRecord = true;\n matched = true;\n }\n } else {\n const isInSample = isSessionInSample(this.identifiers.sessionId, this.config.sampleRate);\n if (!isInSample) {\n message = `Opting session ${this.identifiers.sessionId} out of recording due to sample rate.`;\n this.loggerProvider.log(message);\n shouldRecord = false;\n matched = false;\n } else {\n shouldRecord = true;\n matched = true;\n }\n }\n\n // Only send custom rrweb event for targeting decision when the decision changes\n if (this.lastShouldRecordDecision !== shouldRecord && this.config.targetingConfig) {\n void this.addCustomRRWebEvent(CustomRRwebEvent.TARGETING_DECISION, {\n message,\n sessionId: this.identifiers.sessionId,\n matched,\n targetingParams: this.lastTargetingParams,\n });\n this.lastShouldRecordDecision = shouldRecord;\n }\n\n return shouldRecord;\n }\n\n getBlockSelectors(): string | string[] | undefined {\n // For some reason, this defaults to empty array ([]) if undefined in the compiled script.\n // Empty arrays cause errors when being evaluated in Safari.\n // Force the selector to be undefined if it's an empty array.\n const blockSelector = this.config?.privacyConfig?.blockSelector ?? [];\n if (blockSelector.length === 0) {\n return undefined;\n }\n return blockSelector;\n }\n\n getMaskTextSelectors(): string | undefined {\n const privacyConfig = this.config?.privacyConfig;\n const effectiveLevel = privacyConfig ? getEffectiveMaskLevel(this.currentPageUrl, privacyConfig) : undefined;\n\n if (effectiveLevel === 'conservative') {\n return '*';\n }\n\n // If any urlMaskLevels rule uses 'conservative', always route all text nodes\n // through maskTextFn so the dynamic URL getter can decide at call time.\n // Without this, rrweb's static maskTextSelector would miss text nodes when\n // the user navigates from a non-conservative page to a conservative one.\n if (privacyConfig?.urlMaskLevels?.some((rule) => rule.maskLevel === 'conservative')) {\n return '*';\n }\n\n // If defaultMaskLevel is 'conservative' and URL rules exist, always route text through\n // maskTextFn — a page matching no rule falls back to the conservative default, and\n // rrweb must be set up at start to call maskTextFn for those text nodes.\n const urlMaskLevels = privacyConfig?.urlMaskLevels;\n if (privacyConfig?.defaultMaskLevel === 'conservative' && urlMaskLevels && urlMaskLevels.length > 0) {\n return '*';\n }\n\n const maskSelector = privacyConfig?.maskSelector;\n if (!maskSelector) {\n return;\n }\n\n return maskSelector as unknown as string;\n }\n\n async getRecordingPlugins(loggingConfig: LoggingConfig | undefined) {\n const plugins = [];\n\n // Add URL tracking plugin\n try {\n const urlTrackingPlugin = createUrlTrackingPlugin({\n ugcFilterRules: this.config?.interactionConfig?.ugcFilterRules || [],\n enablePolling: this.config?.enableUrlChangePolling || false,\n pollingInterval: this.config?.urlChangePollingInterval,\n captureDocumentTitle: this.config?.captureDocumentTitle,\n });\n\n plugins.push(urlTrackingPlugin);\n } catch (error) {\n this.loggerProvider.warn('Failed to create URL tracking plugin:', error);\n }\n\n // Default plugin settings -\n // {\n // level: ['info', 'log', 'warn', 'error'],\n // lengthThreshold: 10000,\n // stringifyOptions: {\n // stringLengthLimit: undefined,\n // numOfKeysLimit: 50,\n // depthOfLimit: 4,\n // },\n // logger: window.console,\n // }\n if (loggingConfig?.console?.enabled) {\n try {\n // Dynamic import keeps console plugin separate and only loads when needed\n const { getRecordConsolePlugin } = await import('@amplitude/rrweb-plugin-console-record');\n plugins.push(getRecordConsolePlugin({ level: loggingConfig.console.levels }));\n } catch (error) {\n this.loggerProvider.warn('Failed to load console plugin:', error);\n }\n }\n\n return plugins.length > 0 ? plugins : undefined;\n }\n\n private async getRecordFunction(): Promise<RecordFunction | null> {\n if (this.recordFunction) {\n return this.recordFunction;\n }\n\n try {\n const { record } = await import('@amplitude/rrweb-record');\n this.recordFunction = record;\n return record;\n } catch (error) {\n this.loggerProvider.warn('Failed to load rrweb-record module:', error);\n return null;\n }\n }\n\n async recordEvents(shouldLogMetadata = true) {\n if (this.recordEventsInFlight) {\n this.recordEventsPendingShouldLogMetadata = shouldLogMetadata;\n return;\n }\n this.recordEventsInFlight = true;\n try {\n await this._recordEvents(shouldLogMetadata);\n while (this.recordEventsPendingShouldLogMetadata !== null) {\n const pendingArgs = this.recordEventsPendingShouldLogMetadata;\n this.recordEventsPendingShouldLogMetadata = null;\n await this._recordEvents(pendingArgs);\n }\n } finally {\n this.recordEventsInFlight = false;\n this.recordEventsPendingShouldLogMetadata = null;\n }\n }\n\n private async _recordEvents(shouldLogMetadata = true) {\n const config = this.config;\n const shouldRecord = this.getShouldRecord();\n const sessionId = this.identifiers?.sessionId;\n if (!shouldRecord || !sessionId || !config) {\n return;\n }\n this.stopRecordingEvents();\n\n const recordFunction = await this.getRecordFunction();\n\n // May be undefined if cannot import rrweb-record\n if (!recordFunction) {\n return;\n }\n\n await this.initializeNetworkObservers();\n\n const networkLoggingConfig = config.loggingConfig?.network;\n const trackUrl = getServerUrl(config.serverZone, config.trackServerUrl);\n const ignoredUrls = [SESSION_REPLAY_SERVER_URL, SESSION_REPLAY_EU_URL, SESSION_REPLAY_STAGING_URL, trackUrl];\n this.networkObservers?.start((event: NetworkRequestEvent) => {\n if (ignoredUrls.some((url) => event.url.startsWith(url))) return;\n void this.addCustomRRWebEvent(CustomRRwebEvent.FETCH_REQUEST, event);\n }, networkLoggingConfig);\n const { privacyConfig, interactionConfig, loggingConfig } = config;\n\n const hooks = interactionConfig?.enabled\n ? {\n mouseInteraction:\n this.eventsManager &&\n this.clickHandler?.createHook({\n eventsManager: this.eventsManager,\n sessionId,\n deviceIdFn: this.getDeviceId.bind(this),\n mirror: recordFunction.mirror,\n ugcFilterRules: interactionConfig.ugcFilterRules ?? [],\n performanceOptions: config.performanceConfig?.interaction,\n }),\n scroll: this.scrollHook,\n }\n : {};\n\n const ugcFilterRules =\n interactionConfig?.enabled && interactionConfig.ugcFilterRules ? interactionConfig.ugcFilterRules : [];\n\n this.loggerProvider.log(`Session Replay capture beginning for ${sessionId}.`);\n\n try {\n this.recordCancelCallback = recordFunction({\n emit: (event: eventWithTime) => {\n if (this.shouldOptOut()) {\n this.loggerProvider.log(`Opting session ${sessionId} out of recording due to optOut config.`);\n this.stopRecordingEvents();\n this.sendEvents();\n return;\n }\n\n if (event.type === RRWebEventType.Meta) {\n event.data.href = getPageUrl(event.data.href, ugcFilterRules);\n }\n\n if (this.eventCompressor) {\n // Schedule processing during idle time if the browser supports requestIdleCallback\n this.eventCompressor.enqueueEvent(event, sessionId);\n }\n },\n inlineStylesheet: config.shouldInlineStylesheet,\n hooks,\n maskAllInputs: true,\n maskTextClass: MASK_TEXT_CLASS,\n blockClass: BLOCK_CLASS,\n blockSelector: this.getBlockSelectors() as string | undefined,\n applyBackgroundColorToBlockedElements: config.applyBackgroundColorToBlockedElements,\n maskInputFn: maskFn('input', privacyConfig, () => this.currentPageUrl),\n maskTextFn: maskFn('text', privacyConfig, () => this.currentPageUrl),\n maskAttributeFn: maskAttributeFn(privacyConfig, () => this.currentPageUrl),\n maskTextSelector: this.getMaskTextSelectors(),\n recordCanvas: false,\n slimDOMOptions: {\n script: config.omitElementTags?.script,\n comment: config.omitElementTags?.comment,\n },\n errorHandler: (error: unknown) => {\n const typedError = error as Error & { _external_?: boolean };\n\n // styled-components relies on this error being thrown and bubbled up, rrweb is otherwise suppressing it\n if (typedError.message.includes('insertRule') && typedError.message.includes('CSSStyleSheet')) {\n throw typedError;\n }\n\n // rrweb does monkey patching on certain window functions such as CSSStyleSheet.proptype.insertRule,\n // and errors from external clients calling these functions can get suppressed. Styled components depend\n // on these errors being re-thrown.\n if (typedError._external_) {\n throw typedError;\n }\n\n this.loggerProvider.warn('Error while capturing replay: ', typedError.toString());\n // Return true so that we don't clutter user's consoles with internal rrweb errors\n return true;\n },\n plugins: await this.getRecordingPlugins(loggingConfig),\n });\n\n void this.addCustomRRWebEvent(CustomRRwebEvent.DEBUG_INFO);\n if (shouldLogMetadata) {\n void this.addCustomRRWebEvent(CustomRRwebEvent.METADATA, this.metadata);\n }\n } catch (error) {\n this.loggerProvider.warn('Failed to initialize session replay:', error);\n }\n }\n\n addCustomRRWebEvent = async (\n eventName: CustomRRwebEvent,\n eventData: { [key: string]: any } = {},\n addStorageInfo = true,\n ) => {\n try {\n let debugInfo: DebugInfo | undefined = undefined;\n const config = this.config;\n // Only add debug info for non-metadata events\n if (config && eventName !== CustomRRwebEvent.METADATA) {\n debugInfo = {\n config: getDebugConfig(config),\n version: VERSION,\n };\n if (addStorageInfo) {\n const storageSizeData = await getStorageSize();\n debugInfo = {\n ...storageSizeData,\n ...debugInfo,\n };\n }\n }\n // Check first to ensure we are recording\n if (this.recordCancelCallback && this.recordFunction) {\n this.recordFunction.addCustomEvent(eventName, {\n ...eventData,\n ...debugInfo,\n });\n } else {\n this.loggerProvider.debug(\n `Not able to add custom replay capture event ${eventName} due to no ongoing recording.`,\n );\n }\n } catch (e) {\n this.loggerProvider.debug('Error while adding custom replay capture event: ', e);\n }\n };\n\n stopRecordingEvents = () => {\n try {\n this.loggerProvider.log('Session Replay capture stopping.');\n this.recordCancelCallback && this.recordCancelCallback();\n this.recordCancelCallback = null;\n this.networkObservers?.stop();\n } catch (error) {\n const typedError = error as Error;\n this.loggerProvider.warn(`Error occurred while stopping replay capture: ${typedError.toString()}`);\n }\n };\n\n getDeviceId() {\n return this.identifiers?.deviceId;\n }\n\n getSessionId() {\n return this.identifiers?.sessionId;\n }\n\n async flush(useRetry = false) {\n return this.eventsManager?.flush(useRetry);\n }\n\n shutdown() {\n this.urlChangeCleanup?.();\n this.teardownEventListeners(true);\n this.stopRecordingEvents();\n this.sendEvents();\n }\n\n private mapSDKType(sdkType: string | undefined) {\n if (sdkType === 'plugin') {\n return '@amplitude/plugin-session-replay-browser';\n }\n\n if (sdkType === 'segment') {\n return '@amplitude/segment-session-replay-plugin';\n }\n\n return null;\n }\n\n private setMetadata(\n sessionId: string | number | undefined,\n joinedConfig: SessionReplayJoinedConfig,\n localConfig: SessionReplayLocalConfig,\n remoteConfig: SessionReplayRemoteConfig | undefined,\n replaySDKVersion: string | undefined,\n standaloneSDKVersion: string | undefined,\n sdkType: string | undefined,\n ) {\n const hashValue = sessionId?.toString() ? generateHashCode(sessionId.toString()) : undefined;\n\n this.metadata = {\n joinedConfig,\n localConfig,\n remoteConfig,\n sessionId,\n hashValue,\n sampleRate: joinedConfig.sampleRate,\n replaySDKType: this.mapSDKType(sdkType),\n replaySDKVersion,\n standaloneSDKType: '@amplitude/session-replay-browser',\n standaloneSDKVersion,\n };\n }\n\n private async initializeNetworkObservers(): Promise<void> {\n if (this.config?.loggingConfig?.network?.enabled && !this.networkObservers) {\n try {\n const { NetworkObservers: NetworkObserversClass } = await import('./observers');\n this.networkObservers = new NetworkObserversClass();\n } catch (error) {\n this.loggerProvider.warn('Failed to import or instantiate NetworkObservers:', error);\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,\n LogLevel,\n returnWrapper,\n SpecialEventType,\n generateHashCode,\n getOrCreateWindowMessenger,\n enableBackgroundCapture,\n AMPLITUDE_ORIGINS_MAP,\n} from '@amplitude/analytics-core';\n\n// Import only specific types to avoid pulling in the entire rrweb-types package\nimport { eventWithTime, EventType as RRWebEventType, scrollCallback } from '@amplitude/rrweb-types';\nimport { createSessionReplayJoinedConfigGenerator } from './config/joined-config';\nimport {\n LoggingConfig,\n SessionReplayJoinedConfig,\n SessionReplayJoinedConfigGenerator,\n SessionReplayLocalConfig,\n SessionReplayMetadata,\n SessionReplayRemoteConfig,\n} from './config/types';\nimport {\n BLOCK_CLASS,\n CustomRRwebEvent,\n DEFAULT_SESSION_REPLAY_PROPERTY,\n INTERACTION_MAX_INTERVAL,\n INTERACTION_MIN_INTERVAL,\n MASK_TEXT_CLASS,\n SESSION_REPLAY_DEBUG_PROPERTY,\n SESSION_REPLAY_EU_URL,\n SESSION_REPLAY_SERVER_URL,\n SESSION_REPLAY_STAGING_URL,\n} from './constants';\nimport {\n getServerUrl,\n getDebugConfig,\n getEffectiveMaskLevel,\n getPageUrl,\n getStorageSize,\n getCurrentUrl,\n maskFn,\n maskAttributeFn,\n} from './helpers';\nimport { EventCompressor } from './events/event-compressor';\nimport { createEventsManager, EventsManagerWithBeacon } from './events/events-manager';\nimport { MultiEventManager } from './events/multi-manager';\nimport { clickBatcher, ClickHandler, clickNonBatcher } from './hooks/click';\nimport { ScrollWatcher } from './hooks/scroll';\nimport { SessionIdentifiers } from './identifiers';\nimport { SafeLoggerProvider } from './logger';\nimport { evaluateTargetingAndStore } from './targeting/targeting-manager';\nimport {\n AmplitudeSessionReplay,\n SessionReplayEventsManager as AmplitudeSessionReplayEventsManager,\n DebugInfo,\n EventsManagerWithType,\n EventType,\n SessionIdentifiers as ISessionIdentifiers,\n SessionReplayOptions,\n SessionReplayTargetingInput,\n} from './typings/session-replay';\nimport { isSessionInSample } from './sampling';\nimport { VERSION } from './version';\n\n// Import only the type for NetworkRequestEvent to keep type safety\nimport type { NetworkObservers, NetworkRequestEvent } from './observers';\nimport { createUrlTrackingPlugin, subscribeToUrlChanges } from './plugins/url-tracking-plugin';\nimport type { RecordFunction } from './utils/rrweb';\n\ntype PageLeaveFn = (e: PageTransitionEvent | Event) => void;\n\nexport class SessionReplay implements AmplitudeSessionReplay {\n name = '@amplitude/session-replay-browser';\n config: SessionReplayJoinedConfig | undefined;\n joinedConfigGenerator: SessionReplayJoinedConfigGenerator | undefined;\n identifiers: ISessionIdentifiers | undefined;\n eventsManager?: AmplitudeSessionReplayEventsManager<'replay' | 'interaction', string>;\n loggerProvider: ILogger;\n recordCancelCallback: ReturnType<RecordFunction> | null = null;\n eventCount = 0;\n eventCompressor: EventCompressor | undefined;\n sessionTargetingMatch = false;\n private lastTargetingParams?: SessionReplayTargetingInput;\n private lastShouldRecordDecision?: boolean;\n\n // Visible for testing only\n pageLeaveFns: PageLeaveFn[] = [];\n private scrollHook?: scrollCallback;\n private clickHandler?: ClickHandler;\n private networkObservers?: NetworkObservers;\n private metadata: SessionReplayMetadata | undefined;\n\n // Cache the dynamically imported record function\n private recordFunction: RecordFunction | null = null;\n private recordEventsInFlight = false;\n\n /** Current page URL, kept in sync with SPA navigations for URL-based masking */\n private currentPageUrl = '';\n\n private recordEventsPendingShouldLogMetadata: boolean | null = null;\n\n /** Cleanup for URL change listener used to re-evaluate targeting on SPA route changes */\n private urlChangeCleanup: (() => void) | null = null;\n /** Monotonic counter to ignore stale URL-change targeting results */\n private latestUrlChangeTargetingEvaluationId = 0;\n\n constructor() {\n this.loggerProvider = new SafeLoggerProvider(new Logger());\n }\n\n init(apiKey: string, options: SessionReplayOptions) {\n return returnWrapper(this._init(apiKey, options));\n }\n\n private teardownEventListeners = (teardown: boolean) => {\n const globalScope = getGlobalScope();\n if (globalScope) {\n globalScope.removeEventListener('blur', this.blurListener);\n globalScope.removeEventListener('focus', this.focusListener);\n !teardown && globalScope.addEventListener('blur', this.blurListener);\n !teardown && globalScope.addEventListener('focus', this.focusListener);\n // prefer pagehide to unload events, this is the standard going forward. it is not\n // 100% reliable, but is bfcache-compatible.\n if (globalScope.self && 'onpagehide' in globalScope.self) {\n globalScope.removeEventListener('pagehide', this.pageLeaveListener);\n !teardown && globalScope.addEventListener('pagehide', this.pageLeaveListener);\n } else {\n // this has performance implications, but is the only way we can reliably send events\n // in browser that don't support pagehide.\n globalScope.removeEventListener('beforeunload', this.pageLeaveListener);\n !teardown && globalScope.addEventListener('beforeunload', this.pageLeaveListener);\n }\n }\n };\n\n /**\n * Subscribes to SPA URL changes via the URL tracking plugin. Always keeps\n * `currentPageUrl` in sync (needed for URL-based masking). When a targeting\n * config is present it also re-evaluates targeting on every navigation.\n */\n private setupUrlChangeListener(): void {\n // If init() runs multiple times, remove the previous URL-change subscription first\n // so we don't leak callbacks and trigger duplicate targeting evaluations.\n this.urlChangeCleanup?.();\n\n const globalScope = getGlobalScope() as Window | undefined;\n if (!globalScope?.location) {\n return;\n }\n\n const hasTargeting = !!this.config?.targetingConfig;\n\n const onUrlChange = (href: string): void => {\n this.currentPageUrl = href;\n\n if (hasTargeting) {\n const evaluationId = ++this.latestUrlChangeTargetingEvaluationId;\n void this.evaluateTargetingAndCapture(\n {\n userProperties: {},\n event: undefined,\n page: { url: href },\n },\n false,\n false,\n true,\n );\n this.loggerProvider.debug(`Queued URL-change targeting re-evaluation #${evaluationId} for ${href}.`);\n }\n };\n type UrlUnsubscribe = (scope: Window | undefined, cb: (href: string) => void) => () => void;\n const unsubscribe = (subscribeToUrlChanges as UrlUnsubscribe)(globalScope, onUrlChange);\n\n this.urlChangeCleanup = (): void => {\n unsubscribe();\n this.urlChangeCleanup = null;\n };\n }\n\n private getCurrentPageForTargeting(): SessionReplayTargetingInput['page'] {\n const currentUrl = getGlobalScope()?.location?.href;\n return currentUrl != null ? { url: currentUrl } : undefined;\n }\n\n protected async _init(apiKey: string, options: SessionReplayOptions) {\n // Re-init should always tear down any previous URL-change subscription, even when the\n // next config has no targeting config and we don't subscribe again.\n this.urlChangeCleanup?.();\n\n this.loggerProvider = new SafeLoggerProvider(options.loggerProvider || new Logger());\n Object.prototype.hasOwnProperty.call(options, 'logLevel') &&\n this.loggerProvider.enable(options.logLevel as LogLevel);\n this.currentPageUrl = getCurrentUrl();\n this.identifiers = new SessionIdentifiers({ sessionId: options.sessionId, deviceId: options.deviceId });\n this.joinedConfigGenerator = await createSessionReplayJoinedConfigGenerator(apiKey, options);\n const { joinedConfig, localConfig, remoteConfig } = await this.joinedConfigGenerator.generateJoinedConfig();\n this.config = joinedConfig;\n\n this.setMetadata(\n options.sessionId,\n joinedConfig,\n localConfig,\n remoteConfig,\n options.version?.version,\n VERSION,\n options.version?.type,\n );\n\n this.pageLeaveFns = [];\n\n if (options.sessionId && this.config.interactionConfig?.enabled) {\n const scrollWatcher = ScrollWatcher.default(\n {\n sessionId: options.sessionId,\n type: 'interaction',\n },\n this.config,\n );\n this.pageLeaveFns = [scrollWatcher.send(this.getDeviceId.bind(this)).bind(scrollWatcher)];\n this.scrollHook = scrollWatcher.hook.bind(scrollWatcher);\n this.clickHandler = new ClickHandler(this.loggerProvider, scrollWatcher);\n }\n\n const managers: EventsManagerWithType<EventType, string>[] = [];\n let { storeType } = this.config;\n if (storeType === 'idb' && !getGlobalScope()?.indexedDB) {\n storeType = 'memory';\n this.loggerProvider.warn('Could not use preferred indexedDB storage, reverting to in memory option.');\n }\n this.loggerProvider.log(`Using ${storeType} for event storage.`);\n let compressionWorkerScript: string | undefined;\n let trackDestinationWorkerScript: string | undefined;\n const globalScope = getGlobalScope();\n if (this.config.useWebWorker && globalScope && globalScope.Worker) {\n const { compressionScript, trackDestinationScript } = await import('./worker');\n compressionWorkerScript = compressionScript;\n trackDestinationWorkerScript = trackDestinationScript;\n }\n\n let rrwebEventManager: EventsManagerWithBeacon<'replay'> | undefined;\n try {\n rrwebEventManager = await createEventsManager<'replay'>({\n config: this.config,\n type: 'replay',\n storeType,\n trackDestinationWorkerScript,\n });\n managers.push({ name: 'replay', manager: rrwebEventManager });\n } catch (error) {\n const typedError = error as Error;\n this.loggerProvider.warn(`Error occurred while creating replay events manager: ${typedError.toString()}`);\n }\n\n if (this.config.interactionConfig?.enabled) {\n const payloadBatcher = this.config.interactionConfig.batch ? clickBatcher : clickNonBatcher;\n try {\n const interactionEventManager = await createEventsManager<'interaction'>({\n config: this.config,\n type: 'interaction',\n minInterval: this.config.interactionConfig.trackEveryNms ?? INTERACTION_MIN_INTERVAL,\n maxInterval: INTERACTION_MAX_INTERVAL,\n payloadBatcher,\n storeType,\n trackDestinationWorkerScript,\n });\n managers.push({ name: 'interaction', manager: interactionEventManager });\n } catch (error) {\n const typedError = error as Error;\n this.loggerProvider.warn(`Error occurred while creating interaction events manager: ${typedError.toString()}`);\n }\n }\n\n this.eventsManager = new MultiEventManager<'replay' | 'interaction', string>(...managers);\n // To prevent too many threads.\n if (this.eventCompressor) {\n this.eventCompressor.terminate();\n }\n\n this.eventCompressor = new EventCompressor(\n this.eventsManager,\n this.config,\n this.getDeviceId(),\n compressionWorkerScript,\n () => this.sendEvents(),\n );\n\n // Register beacon fallback for page exit. sendBeacon survives page unload\n // and delivers any incremental events that haven't been flushed via fetch yet.\n this.pageLeaveFns = [\n ...this.pageLeaveFns,\n () => {\n if (!this.config || !this.identifiers?.sessionId || !rrwebEventManager) return;\n const events = rrwebEventManager.getBeaconEvents();\n if (!events.length) return;\n const deviceId = this.getDeviceId();\n if (!deviceId) return;\n rrwebEventManager.trackDestination.sendBeacon({\n events,\n sessionId: this.identifiers.sessionId,\n deviceId,\n apiKey: this.config.apiKey,\n serverZone: this.config.serverZone,\n });\n },\n ];\n\n await this.initializeNetworkObservers();\n\n // Enable background capture when this page is opened by the Amplitude app\n // (window.opener exists). Uses the shared messenger singleton so that if\n // autocapture is also loaded, both share a single messenger and script load.\n if (getGlobalScope()?.opener) {\n const messenger = getOrCreateWindowMessenger();\n enableBackgroundCapture(messenger);\n messenger.setup({\n logger: this.loggerProvider,\n ...(this.config.serverZone && { endpoint: AMPLITUDE_ORIGINS_MAP[this.config.serverZone] }),\n });\n }\n\n this.loggerProvider.log('Installing @amplitude/session-replay-browser.');\n\n this.teardownEventListeners(false);\n\n await this.evaluateTargetingAndCapture(\n { userProperties: options.userProperties, page: this.getCurrentPageForTargeting() },\n true,\n );\n\n const needsUrlTracking = this.config.targetingConfig || (this.config.privacyConfig?.urlMaskLevels?.length ?? 0) > 0;\n if (needsUrlTracking) {\n this.setupUrlChangeListener();\n }\n }\n\n setSessionId(sessionId: string | number, deviceId?: string) {\n return returnWrapper(this.asyncSetSessionId(sessionId, deviceId));\n }\n\n async asyncSetSessionId(\n sessionId: string | number,\n deviceId?: string,\n options?: { userProperties?: { [key: string]: any } },\n ) {\n // Invalidate any in-flight URL-change re-evaluations from the previous session.\n this.latestUrlChangeTargetingEvaluationId++;\n this.sessionTargetingMatch = false;\n this.lastShouldRecordDecision = undefined; // Reset targeting decision for new session\n\n const previousSessionId = this.identifiers && this.identifiers.sessionId;\n if (previousSessionId) {\n this.sendEvents(previousSessionId);\n }\n\n const deviceIdForReplayId = deviceId || this.getDeviceId();\n this.identifiers = new SessionIdentifiers({\n sessionId: sessionId,\n deviceId: deviceIdForReplayId,\n });\n\n // If there is no previous session id, SDK is being initialized for the first time,\n // and config was just fetched in initialization, so no need to fetch it a second time\n if (this.joinedConfigGenerator && previousSessionId) {\n const { joinedConfig } = await this.joinedConfigGenerator.generateJoinedConfig();\n this.config = joinedConfig;\n }\n\n if (this.config?.targetingConfig) {\n await this.evaluateTargetingAndCapture(\n { userProperties: options?.userProperties, page: this.getCurrentPageForTargeting() },\n false,\n true,\n );\n } else {\n await this.recordEvents();\n }\n }\n\n getSessionReplayProperties() {\n const config = this.config;\n const identifiers = this.identifiers;\n if (!config || !identifiers) {\n this.loggerProvider.warn('Session replay init has not been called, cannot get session replay properties.');\n return {};\n }\n\n const shouldRecord = this.getShouldRecord();\n let eventProperties: { [key: string]: string | null } = {};\n\n if (shouldRecord) {\n eventProperties = {\n [DEFAULT_SESSION_REPLAY_PROPERTY]: identifiers.sessionReplayId ? identifiers.sessionReplayId : null,\n };\n if (config.debugMode) {\n eventProperties[SESSION_REPLAY_DEBUG_PROPERTY] = JSON.stringify({\n appHash: generateHashCode(config.apiKey).toString(),\n });\n }\n }\n\n void this.addCustomRRWebEvent(\n CustomRRwebEvent.GET_SR_PROPS,\n {\n shouldRecord,\n eventProperties: eventProperties,\n },\n this.eventCount === 10,\n );\n if (this.eventCount === 10) {\n this.eventCount = 0;\n }\n this.eventCount++;\n\n return eventProperties;\n }\n\n blurListener = () => {\n this.sendEvents();\n };\n\n focusListener = () => {\n if (this.recordCancelCallback && this.recordFunction) {\n try {\n this.recordFunction.takeFullSnapshot(true);\n } catch (error) {\n this.loggerProvider.warn('Failed to take full snapshot on focus:', error);\n }\n } else if (!this.recordEventsInFlight) {\n void this.recordEvents(false);\n }\n };\n\n /**\n * This is an instance member so that if init is called multiple times\n * it doesn't add another listener to the page leave event. This is to\n * prevent duplicate listener actions from firing.\n */\n private pageLeaveListener = (e: PageTransitionEvent | Event) => {\n this.pageLeaveFns.forEach((fn) => {\n fn(e);\n });\n };\n\n evaluateTargetingAndCapture = async (\n targetingParams: SessionReplayTargetingInput,\n isInit = false,\n forceRestart = false,\n forceTargetingReevaluation = false,\n ) => {\n if (!this.identifiers || !this.identifiers.sessionId || !this.config) {\n if (this.identifiers && !this.identifiers.sessionId) {\n this.loggerProvider.log('Session ID has not been set yet, cannot evaluate targeting for Session Replay.');\n } else {\n this.loggerProvider.warn('Session replay init has not been called, cannot evaluate targeting.');\n }\n return;\n }\n\n // Handle cases where there's no targeting config\n if (!this.config.targetingConfig) {\n if (isInit) {\n this.loggerProvider.log('Targeting config has not been set yet, cannot evaluate targeting.');\n } else {\n this.loggerProvider.log('No targeting config set, skipping initialization/recording for event.');\n return;\n }\n }\n\n // Store targeting parameters for use in getShouldRecord\n this.lastTargetingParams = targetingParams;\n\n // Re-evaluate only until we get the first match in this session.\n // Once matched, keep recording for the rest of the session.\n const targetingConfig = this.config.targetingConfig;\n const shouldReEvaluate = targetingConfig && !this.sessionTargetingMatch;\n if (shouldReEvaluate) {\n // Capture URL-change evaluation id so out-of-order async completions can be discarded.\n const urlChangeEvaluationId = forceTargetingReevaluation ? this.latestUrlChangeTargetingEvaluationId : undefined;\n let eventForTargeting = targetingParams.event;\n if (\n eventForTargeting &&\n Object.values(SpecialEventType).includes(eventForTargeting.event_type as SpecialEventType)\n ) {\n eventForTargeting = undefined;\n }\n\n const pageUrl = targetingParams.page?.url ?? getGlobalScope()?.location?.href ?? '';\n const pageForTargeting = targetingParams.page ?? (pageUrl !== '' ? { url: pageUrl } : undefined);\n\n const targetingMatch = await evaluateTargetingAndStore({\n sessionId: this.identifiers.sessionId,\n targetingConfig,\n loggerProvider: this.loggerProvider,\n apiKey: this.config.apiKey,\n targetingParams: {\n userProperties: targetingParams.userProperties,\n event: eventForTargeting,\n page: pageForTargeting,\n },\n urlChange: forceTargetingReevaluation,\n });\n\n if (\n forceTargetingReevaluation &&\n urlChangeEvaluationId !== undefined &&\n urlChangeEvaluationId !== this.latestUrlChangeTargetingEvaluationId\n ) {\n this.loggerProvider.debug(\n `Ignoring stale URL-change targeting result #${urlChangeEvaluationId}; latest is #${this.latestUrlChangeTargetingEvaluationId}.`,\n );\n return;\n }\n // Keep targeting match monotonic within a session: once true, always true.\n // This avoids races where an older in-flight evaluation resolves false after\n // a newer evaluation already resolved true.\n this.sessionTargetingMatch = this.sessionTargetingMatch || targetingMatch;\n\n this.loggerProvider.debug(\n JSON.stringify(\n {\n name: 'targeted replay capture config',\n sessionTargetingMatch: this.sessionTargetingMatch,\n event: eventForTargeting,\n targetingParams: targetingParams,\n },\n null,\n 2,\n ),\n );\n }\n\n if (isInit) {\n void this.initialize(true);\n } else if (forceRestart || !this.recordCancelCallback) {\n this.loggerProvider.log('Recording events for session due to forceRestart or no ongoing recording.');\n await this.recordEvents();\n }\n };\n\n sendEvents(sessionId?: string | number) {\n const sessionIdToSend = sessionId || this.identifiers?.sessionId;\n const deviceId = this.getDeviceId();\n this.eventsManager &&\n sessionIdToSend &&\n deviceId &&\n this.eventsManager.sendCurrentSequenceEvents({ sessionId: sessionIdToSend, deviceId });\n }\n\n async initialize(shouldSendStoredEvents = false) {\n if (!this.identifiers?.sessionId) {\n this.loggerProvider.log(`Session is not being recorded due to lack of session id.`);\n return Promise.resolve();\n }\n\n const deviceId = this.getDeviceId();\n if (!deviceId) {\n this.loggerProvider.log(`Session is not being recorded due to lack of device id.`);\n return Promise.resolve();\n }\n this.eventsManager && shouldSendStoredEvents && void this.eventsManager.sendStoredEvents({ deviceId });\n\n return this.recordEvents();\n }\n\n shouldOptOut() {\n let identityStoreOptOut: boolean | undefined;\n if (this.config?.instanceName) {\n const identityStore = getAnalyticsConnector(this.config.instanceName).identityStore;\n identityStoreOptOut = identityStore.getIdentity().optOut;\n }\n\n return identityStoreOptOut !== undefined ? identityStoreOptOut : this.config?.optOut;\n }\n\n getShouldRecord() {\n if (!this.identifiers || !this.config || !this.identifiers.sessionId) {\n this.loggerProvider.warn(`Session is not being recorded due to lack of config, please call sessionReplay.init.`);\n return false;\n }\n\n if (!this.config.captureEnabled) {\n this.loggerProvider.log(\n `Session ${this.identifiers.sessionId} not being captured due to capture being disabled for project or because the remote config could not be fetched.`,\n );\n return false;\n }\n\n if (this.shouldOptOut()) {\n this.loggerProvider.log(`Opting session ${this.identifiers.sessionId} out of recording due to optOut config.`);\n return false;\n }\n\n let shouldRecord = false;\n let message = '';\n let matched = false;\n\n // If targetingConfig exists, we'll use the sessionTargetingMatch to determine whether to record\n // Otherwise, we'll evaluate the session against the overall sample rate\n if (this.config.targetingConfig) {\n if (!this.sessionTargetingMatch) {\n message = `Not capturing replays for session ${this.identifiers.sessionId} due to not matching targeting conditions.`;\n this.loggerProvider.log(message);\n shouldRecord = false;\n matched = false;\n } else {\n message = `Capturing replays for session ${this.identifiers.sessionId} due to matching targeting conditions.`;\n this.loggerProvider.log(message);\n shouldRecord = true;\n matched = true;\n }\n } else {\n const isInSample = isSessionInSample(this.identifiers.sessionId, this.config.sampleRate);\n if (!isInSample) {\n message = `Opting session ${this.identifiers.sessionId} out of recording due to sample rate.`;\n this.loggerProvider.log(message);\n shouldRecord = false;\n matched = false;\n } else {\n shouldRecord = true;\n matched = true;\n }\n }\n\n // Only send custom rrweb event for targeting decision when the decision changes\n if (this.lastShouldRecordDecision !== shouldRecord && this.config.targetingConfig) {\n void this.addCustomRRWebEvent(CustomRRwebEvent.TARGETING_DECISION, {\n message,\n sessionId: this.identifiers.sessionId,\n matched,\n targetingParams: this.lastTargetingParams,\n });\n this.lastShouldRecordDecision = shouldRecord;\n }\n\n return shouldRecord;\n }\n\n getBlockSelectors(): string | string[] | undefined {\n // For some reason, this defaults to empty array ([]) if undefined in the compiled script.\n // Empty arrays cause errors when being evaluated in Safari.\n // Force the selector to be undefined if it's an empty array.\n const blockSelector = this.config?.privacyConfig?.blockSelector ?? [];\n if (blockSelector.length === 0) {\n return undefined;\n }\n return blockSelector;\n }\n\n getMaskTextSelectors(): string | undefined {\n const privacyConfig = this.config?.privacyConfig;\n const effectiveLevel = privacyConfig ? getEffectiveMaskLevel(this.currentPageUrl, privacyConfig) : undefined;\n\n if (effectiveLevel === 'conservative') {\n return '*';\n }\n\n // If any urlMaskLevels rule uses 'conservative', always route all text nodes\n // through maskTextFn so the dynamic URL getter can decide at call time.\n // Without this, rrweb's static maskTextSelector would miss text nodes when\n // the user navigates from a non-conservative page to a conservative one.\n if (privacyConfig?.urlMaskLevels?.some((rule) => rule.maskLevel === 'conservative')) {\n return '*';\n }\n\n // If defaultMaskLevel is 'conservative' and URL rules exist, always route text through\n // maskTextFn — a page matching no rule falls back to the conservative default, and\n // rrweb must be set up at start to call maskTextFn for those text nodes.\n const urlMaskLevels = privacyConfig?.urlMaskLevels;\n if (privacyConfig?.defaultMaskLevel === 'conservative' && urlMaskLevels && urlMaskLevels.length > 0) {\n return '*';\n }\n\n const maskSelector = privacyConfig?.maskSelector;\n if (!maskSelector) {\n return;\n }\n\n return maskSelector as unknown as string;\n }\n\n async getRecordingPlugins(loggingConfig: LoggingConfig | undefined) {\n const plugins = [];\n\n // Add URL tracking plugin\n try {\n const urlTrackingPlugin = createUrlTrackingPlugin({\n ugcFilterRules: this.config?.interactionConfig?.ugcFilterRules || [],\n enablePolling: this.config?.enableUrlChangePolling || false,\n pollingInterval: this.config?.urlChangePollingInterval,\n captureDocumentTitle: this.config?.captureDocumentTitle,\n });\n\n plugins.push(urlTrackingPlugin);\n } catch (error) {\n this.loggerProvider.warn('Failed to create URL tracking plugin:', error);\n }\n\n // Default plugin settings -\n // {\n // level: ['info', 'log', 'warn', 'error'],\n // lengthThreshold: 10000,\n // stringifyOptions: {\n // stringLengthLimit: undefined,\n // numOfKeysLimit: 50,\n // depthOfLimit: 4,\n // },\n // logger: window.console,\n // }\n if (loggingConfig?.console?.enabled) {\n try {\n // Dynamic import keeps console plugin separate and only loads when needed\n const { getRecordConsolePlugin } = await import('@amplitude/rrweb-plugin-console-record');\n plugins.push(getRecordConsolePlugin({ level: loggingConfig.console.levels }));\n } catch (error) {\n this.loggerProvider.warn('Failed to load console plugin:', error);\n }\n }\n\n return plugins.length > 0 ? plugins : undefined;\n }\n\n private async getRecordFunction(): Promise<RecordFunction | null> {\n if (this.recordFunction) {\n return this.recordFunction;\n }\n\n try {\n const { record } = await import('@amplitude/rrweb-record');\n this.recordFunction = record;\n return record;\n } catch (error) {\n this.loggerProvider.warn('Failed to load rrweb-record module:', error);\n return null;\n }\n }\n\n async recordEvents(shouldLogMetadata = true) {\n if (this.recordEventsInFlight) {\n this.recordEventsPendingShouldLogMetadata = shouldLogMetadata;\n return;\n }\n this.recordEventsInFlight = true;\n try {\n await this._recordEvents(shouldLogMetadata);\n while (this.recordEventsPendingShouldLogMetadata !== null) {\n const pendingArgs = this.recordEventsPendingShouldLogMetadata;\n this.recordEventsPendingShouldLogMetadata = null;\n await this._recordEvents(pendingArgs);\n }\n } finally {\n this.recordEventsInFlight = false;\n this.recordEventsPendingShouldLogMetadata = null;\n }\n }\n\n private async _recordEvents(shouldLogMetadata = true) {\n const config = this.config;\n const shouldRecord = this.getShouldRecord();\n const sessionId = this.identifiers?.sessionId;\n if (!shouldRecord || !sessionId || !config) {\n return;\n }\n this.stopRecordingEvents();\n\n const recordFunction = await this.getRecordFunction();\n\n // May be undefined if cannot import rrweb-record\n if (!recordFunction) {\n return;\n }\n\n await this.initializeNetworkObservers();\n\n const networkLoggingConfig = config.loggingConfig?.network;\n const trackUrl = getServerUrl(config.serverZone, config.trackServerUrl);\n const ignoredUrls = [SESSION_REPLAY_SERVER_URL, SESSION_REPLAY_EU_URL, SESSION_REPLAY_STAGING_URL, trackUrl];\n this.networkObservers?.start((event: NetworkRequestEvent) => {\n if (ignoredUrls.some((url) => event.url.startsWith(url))) return;\n void this.addCustomRRWebEvent(CustomRRwebEvent.FETCH_REQUEST, event);\n }, networkLoggingConfig);\n const { privacyConfig, interactionConfig, loggingConfig } = config;\n\n const hooks = interactionConfig?.enabled\n ? {\n mouseInteraction:\n this.eventsManager &&\n this.clickHandler?.createHook({\n eventsManager: this.eventsManager,\n sessionId,\n deviceIdFn: this.getDeviceId.bind(this),\n mirror: recordFunction.mirror,\n ugcFilterRules: interactionConfig.ugcFilterRules ?? [],\n performanceOptions: config.performanceConfig?.interaction,\n }),\n scroll: this.scrollHook,\n }\n : {};\n\n const ugcFilterRules =\n interactionConfig?.enabled && interactionConfig.ugcFilterRules ? interactionConfig.ugcFilterRules : [];\n\n this.loggerProvider.log(`Session Replay capture beginning for ${sessionId}.`);\n\n try {\n this.recordCancelCallback = recordFunction({\n emit: (event: eventWithTime) => {\n if (this.shouldOptOut()) {\n this.loggerProvider.log(`Opting session ${sessionId} out of recording due to optOut config.`);\n this.stopRecordingEvents();\n this.sendEvents();\n return;\n }\n\n if (event.type === RRWebEventType.Meta) {\n event.data.href = getPageUrl(event.data.href, ugcFilterRules);\n }\n\n if (this.eventCompressor) {\n // Schedule processing during idle time if the browser supports requestIdleCallback\n this.eventCompressor.enqueueEvent(event, sessionId);\n }\n },\n inlineStylesheet: config.shouldInlineStylesheet,\n hooks,\n maskAllInputs: true,\n maskTextClass: MASK_TEXT_CLASS,\n blockClass: BLOCK_CLASS,\n blockSelector: this.getBlockSelectors() as string | undefined,\n applyBackgroundColorToBlockedElements: config.applyBackgroundColorToBlockedElements,\n maskInputFn: maskFn('input', privacyConfig, () => this.currentPageUrl),\n maskTextFn: maskFn('text', privacyConfig, () => this.currentPageUrl),\n maskAttributeFn: maskAttributeFn(privacyConfig, () => this.currentPageUrl),\n maskTextSelector: this.getMaskTextSelectors(),\n recordCanvas: false,\n captureAdoptedStyleSheets: config.captureAdoptedStyleSheets,\n slimDOMOptions: {\n script: config.omitElementTags?.script,\n comment: config.omitElementTags?.comment,\n },\n errorHandler: (error: unknown) => {\n const typedError = error as Error & { _external_?: boolean };\n\n // styled-components relies on this error being thrown and bubbled up, rrweb is otherwise suppressing it\n if (typedError.message.includes('insertRule') && typedError.message.includes('CSSStyleSheet')) {\n throw typedError;\n }\n\n // rrweb does monkey patching on certain window functions such as CSSStyleSheet.proptype.insertRule,\n // and errors from external clients calling these functions can get suppressed. Styled components depend\n // on these errors being re-thrown.\n if (typedError._external_) {\n throw typedError;\n }\n\n this.loggerProvider.warn('Error while capturing replay: ', typedError.toString());\n // Return true so that we don't clutter user's consoles with internal rrweb errors\n return true;\n },\n plugins: await this.getRecordingPlugins(loggingConfig),\n });\n\n void this.addCustomRRWebEvent(CustomRRwebEvent.DEBUG_INFO);\n if (shouldLogMetadata) {\n void this.addCustomRRWebEvent(CustomRRwebEvent.METADATA, this.metadata);\n }\n } catch (error) {\n this.loggerProvider.warn('Failed to initialize session replay:', error);\n }\n }\n\n addCustomRRWebEvent = async (\n eventName: CustomRRwebEvent,\n eventData: { [key: string]: any } = {},\n addStorageInfo = true,\n ) => {\n try {\n let debugInfo: DebugInfo | undefined = undefined;\n const config = this.config;\n // Only add debug info for non-metadata events\n if (config && eventName !== CustomRRwebEvent.METADATA) {\n debugInfo = {\n config: getDebugConfig(config),\n version: VERSION,\n };\n if (addStorageInfo) {\n const storageSizeData = await getStorageSize();\n debugInfo = {\n ...storageSizeData,\n ...debugInfo,\n };\n }\n }\n // Check first to ensure we are recording\n if (this.recordCancelCallback && this.recordFunction) {\n this.recordFunction.addCustomEvent(eventName, {\n ...eventData,\n ...debugInfo,\n });\n } else {\n this.loggerProvider.debug(\n `Not able to add custom replay capture event ${eventName} due to no ongoing recording.`,\n );\n }\n } catch (e) {\n this.loggerProvider.debug('Error while adding custom replay capture event: ', e);\n }\n };\n\n stopRecordingEvents = () => {\n try {\n this.loggerProvider.log('Session Replay capture stopping.');\n this.recordCancelCallback && this.recordCancelCallback();\n this.recordCancelCallback = null;\n this.networkObservers?.stop();\n } catch (error) {\n const typedError = error as Error;\n this.loggerProvider.warn(`Error occurred while stopping replay capture: ${typedError.toString()}`);\n }\n };\n\n getDeviceId() {\n return this.identifiers?.deviceId;\n }\n\n getSessionId() {\n return this.identifiers?.sessionId;\n }\n\n async flush(useRetry = false) {\n return this.eventsManager?.flush(useRetry);\n }\n\n shutdown() {\n this.urlChangeCleanup?.();\n this.teardownEventListeners(true);\n this.stopRecordingEvents();\n this.sendEvents();\n }\n\n private mapSDKType(sdkType: string | undefined) {\n if (sdkType === 'plugin') {\n return '@amplitude/plugin-session-replay-browser';\n }\n\n if (sdkType === 'segment') {\n return '@amplitude/segment-session-replay-plugin';\n }\n\n return null;\n }\n\n private setMetadata(\n sessionId: string | number | undefined,\n joinedConfig: SessionReplayJoinedConfig,\n localConfig: SessionReplayLocalConfig,\n remoteConfig: SessionReplayRemoteConfig | undefined,\n replaySDKVersion: string | undefined,\n standaloneSDKVersion: string | undefined,\n sdkType: string | undefined,\n ) {\n const hashValue = sessionId?.toString() ? generateHashCode(sessionId.toString()) : undefined;\n\n this.metadata = {\n joinedConfig,\n localConfig,\n remoteConfig,\n sessionId,\n hashValue,\n sampleRate: joinedConfig.sampleRate,\n replaySDKType: this.mapSDKType(sdkType),\n replaySDKVersion,\n standaloneSDKType: '@amplitude/session-replay-browser',\n standaloneSDKVersion,\n };\n }\n\n private async initializeNetworkObservers(): Promise<void> {\n if (this.config?.loggingConfig?.network?.enabled && !this.networkObservers) {\n try {\n const { NetworkObservers: NetworkObserversClass } = await import('./observers');\n this.networkObservers = new NetworkObserversClass();\n } catch (error) {\n this.loggerProvider.warn('Failed to import or instantiate NetworkObservers:', error);\n }\n }\n }\n}\n"]}
|
package/lib/cjs/utils/rrweb.d.ts
CHANGED
|
@@ -28,6 +28,12 @@ export type RecordFunction = {
|
|
|
28
28
|
errorHandler?: (error: unknown) => boolean;
|
|
29
29
|
plugins?: any[];
|
|
30
30
|
applyBackgroundColorToBlockedElements?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* When true (default), adoptedStyleSheets CSS rules are serialized inline in the full snapshot
|
|
33
|
+
* rather than emitted as separate incremental events that can be dropped in transit.
|
|
34
|
+
* Set to false to revert to the legacy incremental-event path if snapshot size is a concern.
|
|
35
|
+
*/
|
|
36
|
+
captureAdoptedStyleSheets?: boolean;
|
|
31
37
|
}): (() => void) | undefined;
|
|
32
38
|
addCustomEvent: (eventName: string, eventData: any) => void;
|
|
33
39
|
takeFullSnapshot: (isCheckout?: boolean) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rrweb.d.ts","sourceRoot":"","sources":["../../../src/utils/rrweb.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAI5E,wBAAgB,iBAAiB,IAAI,MAAM,CAG1C;AAED,wBAAgB,gBAAgB,IAAI,MAAM,CAGzC;AAED,MAAM,MAAM,MAAM,GAAG;IACnB,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,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