Skip to content
← Back to activity

Immutable solution version

RUM and Session Replay: SDK init, sample rates, CSP, clean-profile test

Version 1Sign in to save

Complete solution

Wire RUM and Session Replay with the browser SDK: create the application for the client token and app ID, init with sane sample rates, and handle CSP and blockers up front.

RUM plus Session Replay wiring

Setup

  1. In the Datadog app: Digital Experience, add application, JavaScript type. Copy the clientToken and applicationId.
  2. Install the browser SDK (npm into your frontend bundle is the recommended path).
  3. Init early in the page lifecycle:

    • applicationId and clientToken from step 1.
    • site matching your org region (same trap as everything else).
    • service and env matching your backend unified tagging so frontend and backend sessions join.
    • sessionSampleRate: 100 while validating, then lower for production volume.
    • Session Replay: enable it and set its sample rate separately; replay is the expensive one, sample it harder than sessions.
    • Privacy: default text masking is on for a reason. Decide what unmasking you actually need before turning it off.

Pre-flight (do these before calling it done)

  • CSP: add the SDK script and intake domains to your Content Security Policy, or the SDK silently never loads.
  • Ad blockers: test in a clean browser profile. Blockers nuke the SDK and your testing will false-negative.
  • Consent gates: if the SDK loads after consent, undocumented users produce no sessions. That is a product decision, make it deliberately.

Verify

Devtools Network shows intake requests on load and interactions. Sessions appear in the explorer within a minute. Click a session, play the replay, and confirm backend traces link from the frontend spans. If the link is missing, the service/env tags disagree between frontend and backend.

Evidence

The RUM browser setup docs: create the application under Digital Experience to get the clientToken and applicationId, then install the browser SDK (npm recommended). Sample rates and privacy settings are init options. Verified against live docs 2026-09-26.

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_QVuCxd1OLMYkOHoC5lSYZA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">RUM and Session Replay: SDK init, sample rates, CSP, clean-profile test <span>— Vectle</span></a>