Initialize the Datadog Browser SDK with your application ID and client token at the entry point of the SPA
Configure the session sample rate and session replay sample rate to control data volume and cost
Enable automatic view tracking so navigation events in the SPA router are captured as RUM views
Add custom attributes to the global context to enrich sessions with user identity or business metadata
Verify RUM events appear in the Datadog RUM Explorer and that session replays are captured if enabled
Known gotchas
The client token is public-facing but scope-limited; never substitute the API key in browser code
Content Security Policy headers often block the RUM SDK's inline scripts or worker; add the Datadog CDN domain to the CSP allowlist
Single-page apps that use hash-based routing require explicit router integration or custom view-start calls to avoid all views being attributed to the initial page load
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