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', ...).
| Option | Type | Default | Description |
|---|---|---|---|
token | string | — | Required. Session Replay token from your account team. |
mask_all_text | boolean | false | Mask every visible text node. See Privacy and masking. |
sampleRate | number | 1 | 0.0–1.0. Fraction of sessions to record. The decision is sticky for the session lifetime. |
alwaysRecordEvents | string[] | [] | Event names that bypass sampling. See Sampling and triggers. |
block_selector | string | — | CSS selector. Matching elements are replaced with a placeholder box — no content captured, position and dimensions preserved. |
ignore_selector | string | — | CSS selector. Matching elements bypass masking — text is captured unredacted even when mask_all_text is true. |
mask_text_selector | string | — | CSS selector. Text inside matching elements is masked. No effect when mask_all_text is true. |
Behavior
- When a replay
tokenis 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: 0withalwaysRecordEvents.
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
- Sampling and triggers —
sampleRateandalwaysRecordEvents - Privacy and masking — selectors and CSS classes
How is this guide?