Session Replay records what a user saw and did, so you can watch a bug happen instead of guessing from a stack trace. It is included in @atatus/browser-rum and loads its recorder only when a session is selected for replay, so it costs nothing on sessions you do not record. This page covers turning replay on, choosing how much to record, and masking sensitive content.

Turn on recording

Set a replay sample rate when you initialize the agent:
These are the options that affect replay:
Replay sampling applies to sessions that sessionSampleRate already kept, so the two multiply. A session rate of 50 with a replay rate of 30 records replay for 15% of all sessions.

Record only the sessions you need

A flat sample rate records a slice of everything, including sessions where nothing went wrong. If you would rather keep the sessions that matter, start recording yourself:
Then start recording when something interesting happens, such as an error or a user opening a support form:
To link to the current session from your own tooling, ask for its replay URL:
Calling startSessionReplayRecording() inside an error boundary captures replay only for sessions that actually broke. You get the recordings you want at a fraction of the volume.

Privacy

Replay records the DOM, so treat masking as the default on any screen that shows customer data, personal information, or payment details. Set the level for the whole application with defaultPrivacyLevel: mask-user-input is a good starting point for most applications: the page stays readable in the replay, while anything a user typed is hidden.

Override the level on one element

You can raise or lower the level on any element and everything inside it, with either an attribute or a class:

Mask action names

Action names are built from the text of the element a user clicked, so a button labelled with a customer name leaks that name into the action. Turn on enablePrivacyForActionName to mask them:
Then give the elements that matter a safe name with data-atatus-action-name, which the agent reads by default:
To read the name from your own attribute instead, set actionNameAttribute. The agent checks it in addition to the default:

Redact URLs

Credentials often end up in query strings, and those appear on views and resources. Strip them in beforeSend, which runs just before an event is sent:

Next steps