Configuration

Reference for Session Replay options in the Ours Privacy Web SDK - tokens, masking, sampling, and event triggers.

Configuration

This page documents the session_replay options used with the Ours Privacy Web SDK. For sampling and event triggers, see Sampling and triggers.


Web SDK options

These go inside the session_replay config block of ours('init', ...).

OptionTypeDefaultDescription
tokenstringRequired. Session Replay token from your account team.
mask_all_textbooleanfalseMask every visible text node. See Privacy and masking.
sampleRatenumber10.01.0. Fraction of sessions to record. The decision is sticky for the session lifetime.
alwaysRecordEventsstring[][]Event names that bypass sampling. See Sampling and triggers.
block_selectorstringCSS selector. Matching elements are replaced with a placeholder box — no content captured, position and dimensions preserved.
ignore_selectorstringCSS selector. Matching elements bypass masking — text is captured unredacted even when mask_all_text is true.
mask_text_selectorstringCSS selector. Text inside matching elements is masked. No effect when mask_all_text is true.

Behavior

  • When a replay token is present, the Web SDK loads Session Replay automatically.
  • Recording starts automatically by default.
  • To prevent default recording without removing the token, set sampleRate: 0.
  • To capture only specific sessions, combine sampleRate: 0 with alwaysRecordEvents.

Domain whitelisting

After enabling Session Replay, whitelist the domains where it will run:

  • Add your site's domain to the allowed-domains list in the dashboard
  • For the strongest first-party trust, use the same custom domain you use for the Web SDK

Next steps

How is this guide?

On this page