Install or upgrade the Datadog Browser SDK to v5 or later: `npm install @datadog/browser-rum`.
Initialize the SDK with `datadogRum.init({...})` including `sessionReplaySampleRate` set to a value greater than 0 to enable replay recording.
The default `defaultPrivacyLevel` in SDK v5+ is `'mask'` — all HTML text, inputs, images, and `data-*` attributes are masked by default without any additional configuration.
To relax masking for specific elements, override `defaultPrivacyLevel` to `'mask-user-input'` or `'allow'` in `datadogRum.init()`, or apply element-level overrides via `data-dd-privacy` HTML attributes.
Validate masking in the Datadog Session Replay player — inspect replayed sessions to confirm that PII fields are masked before enabling in production.
Known gotchas
SDK v5+ defaults to `mask` privacy level — all user data is masked unless you explicitly loosen it; earlier SDK versions defaulted to `allow`, so upgrading from v4 or below may change replay appearance.
Masking only applies to the Session Replay recording — RUM events (clicks, errors, performance metrics) are still collected and may contain text from element names or URLs; review your RUM event payloads separately.
Using `allow` privacy level in production may capture PII in replay recordings; ensure compliance with GDPR, CCPA, and your privacy policy before using any non-mask level.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp