SIGN IN SIGN UP

feat(replay): add beforeErrorSampling callback to Session Replay (#5214)

* feat(replay): add `beforeErrorSampling` callback to Session Replay

Add a BeforeErrorSamplingCallback to SentryReplayOptions that lets
developers filter which errors trigger replay capture. The callback
runs before the onErrorSampleRate dice roll - returning false skips
captureReplay entirely.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* docs: add changelog entry for beforeErrorSampling callback

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* docs: use any{} in changelog example

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Apply suggestion from @romtsn

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
R
Roman Zavarnitsyn committed
55aaf9b86d6887b277ff7ca70e3ccf1d2e143092
Parent: d345880
Committed by GitHub <noreply@github.com> on 3/20/2026, 11:03:11 AM