Skip to main content

How do replay sample rates control whether a Session Replay attaches to User Feedback?

Issue

I want to understand how replaysSessionSampleRate and replaysOnErrorSampleRate determine whether a Session Replay is attached to a User Feedback submission.

Applies To

  • All SaaS Customers and Self-Hosted Users

  • User Feedback

  • Session Replay

Resolution

For a Session Replay to attach to a User Feedback submission, the Replay SDK must be recording. That requires replaysSessionSampleRate > 0 or replaysOnErrorSampleRate > 0. In buffer mode (replaysOnErrorSampleRate), the SDK buffers up to 60 seconds of the user's session, which it can attach when the user opens the User Feedback widget.

If you do not want to record session replays in general, but only want them for user feedback, set both rates to 0 and start buffering manually:

const replay = Sentry.getReplay();
replay.startBuffering();

startBuffering() records in buffer mode regardless of your sample rates. For more detail, see the Session Replay documentation.

Did this answer your question?