From 9efe4a71e3380b807cc7d2517896a493a60bd092 Mon Sep 17 00:00:00 2001 From: Abdelrahman Awad Date: Fri, 17 Jul 2026 16:30:37 -0400 Subject: [PATCH] feat(js): Document replay.stop({ flush: false }) option Documents the new option for skipping the final flush when stopping Session Replay, for consent-withdrawal (GDPR) flows. Depends on getsentry/sentry-javascript#22300 (targeting 10.67.0). --- .../common/session-replay/understanding-sessions.mdx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/platforms/javascript/common/session-replay/understanding-sessions.mdx b/docs/platforms/javascript/common/session-replay/understanding-sessions.mdx index 4995a67b34580..ce6176693b1c7 100644 --- a/docs/platforms/javascript/common/session-replay/understanding-sessions.mdx +++ b/docs/platforms/javascript/common/session-replay/understanding-sessions.mdx @@ -116,6 +116,16 @@ await replay.stop(); This will flush any pending recording data, stop the replay, and end the session. +If you don't want the pending segment to be sent when stopping (for example, when a user withdraws consent for Session Replay), pass `{ flush: false }`: + + + +```javascript +await replay.stop({ flush: false }); +``` + +This stops recording and discards the buffered segment instead of uploading it. Note that `flush: false` only prevents the _pending_ (final) segment from being sent. It does not retract segments that were already sent earlier during `session` recording. + ## Manually Flushing Recording Data You can flush any pending recording data with: