diff --git a/docs/platforms/javascript/common/session-replay/understanding-sessions.mdx b/docs/platforms/javascript/common/session-replay/understanding-sessions.mdx index 4995a67b345803..ce6176693b1c7a 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: