@sentry/replay 10.66.0 → 10.67.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/build/npm/cjs/index.js +14 -2
- package/build/npm/cjs/index.js.map +1 -1
- package/build/npm/esm/index.js +14 -2
- package/build/npm/esm/index.js.map +1 -1
- package/build/npm/esm/package.json +1 -1
- package/build/npm/types/integration.d.ts +12 -1
- package/build/npm/types/integration.d.ts.map +1 -1
- package/build/npm/types-ts3.8/integration.d.ts +12 -1
- package/package.json +4 -4
package/build/npm/cjs/index.js
CHANGED
|
@@ -8292,12 +8292,24 @@ class Replay {
|
|
|
8292
8292
|
/**
|
|
8293
8293
|
* Currently, this needs to be manually called (e.g. for tests). Sentry SDK
|
|
8294
8294
|
* does not support a teardown
|
|
8295
|
+
*
|
|
8296
|
+
* @param options.flush - Whether to flush the pending replay segment when stopping.
|
|
8297
|
+
* When recording in `session` mode, `stop()` flushes the buffered-but-unsent segment by
|
|
8298
|
+
* default (`flush: true`), matching the previous behavior. Pass `flush: false` to stop
|
|
8299
|
+
* recording without sending that pending segment — useful when a user withdraws consent
|
|
8300
|
+
* and no further data should leave the browser.
|
|
8301
|
+
*
|
|
8302
|
+
* Note: `flush: false` only prevents the *pending* (final) segment from being sent. It does
|
|
8303
|
+
* **not** retract segments that were already sent earlier during `session` recording.
|
|
8295
8304
|
*/
|
|
8296
|
-
stop() {
|
|
8305
|
+
stop(options) {
|
|
8297
8306
|
if (!this._replay) {
|
|
8298
8307
|
return Promise.resolve();
|
|
8299
8308
|
}
|
|
8300
|
-
return this._replay.stop({
|
|
8309
|
+
return this._replay.stop({
|
|
8310
|
+
forceFlush: options?.flush ?? this._replay.recordingMode === "session",
|
|
8311
|
+
reason: "manual"
|
|
8312
|
+
});
|
|
8301
8313
|
}
|
|
8302
8314
|
/**
|
|
8303
8315
|
* If not in "session" recording mode, flush event buffer which will create a new replay.
|