All skills
datadog-labs avatar

/dd-instrument-rum

@659ea9a official

Instrument browser-based web applications with Datadog Browser RUM. Detect the application framework, router, package manager, bundler, entrypoint, credentials, and existing RUM setup; add or safely complete classic Browser RUM instrumentation for React, Next.js App or Pages Router, Angular, Vue, Nuxt, Svelte, vanilla JavaScript, SPAs, and iframe-hosted apps; avoid duplicate initialization; and verify the application still builds. Use when asked to add, set up, instrument, repair, or verify Datadog RUM, Browser Monitoring, Session Replay, or framework-specific Browser RUM plugins.

Use this Skill: https://skilld.dev/gh/datadog-labs/agent-skills/dd-instrument-rum

This session only. Nothing lands on disk.

referencesrum-other-frameworks.md

≈631 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Core-only browser frameworks

Read rum-core.md first. These targets use @datadog/browser-rum without a framework integration package.

Svelte and SvelteKit

For a client-only Svelte/Vite application, initialize at module scope in the browser entry before mounting the root component.

For SvelteKit, keep initialization out of server execution. Create a small module guarded by $app/environment and import it once from the root layout:

import { browser } from '$app/environment'
import { datadogRum } from '@datadog/browser-rum'

if (browser) {
  datadogRum.init({
    // ...canonical fields from rum-core.md...
  })
}

Import that module once from the root +layout.svelte script. Do not call init from onMount, a component render, or both server and browser contexts. If the project has no package manager/bundler and only serves generated HTML, use the CDN path instead.

Vanilla or generic SPA with a bundler

Install @datadog/browser-rum and put the canonical init at module scope in the earliest browser entry referenced by the HTML or bundler configuration. Do not create a React/Vue-style plugin abstraction for a frameworkless app.

Unmanaged vanilla HTML

When there is no package manifest or bundler, add the async CDN loader from rum-core.md near the start of <head> in every HTML entry page. Do not create package.json, add imports the browser cannot resolve, or introduce a build system.

SPA routing without a supported Datadog framework plugin

Classic RUM automatically observes URL changes, but it cannot infer every application's parameterized route names. Do not add manual startView behavior as part of basic onboarding unless the user explicitly requests custom view naming and provides the route semantics.

Iframe-hosted applications

Treat an application that runs inside an iframe as its own browser application and initialize RUM once inside that application's document/bundle. A host page and an embedded application are separate instrumentation targets.

  • If the target repository owns only the iframe application, instrument only that application.
  • If it owns only a host that embeds a third-party or cross-origin iframe, do not inject code into content it does not control.
  • If it owns both host and iframe applications, do not initialize both under one ambiguous request; ask which surface or surfaces need separate RUM applications/configuration.
  • Do not add parent/child cross-window messaging or specialized Shopify/Salesforce bundles.

Source: SKILL.md on GitHub

No alerts1mo3 checks · Risk SAFE
  • Gen Agent Trust Hub1mo

    The skill performs automated instrumentation of web applications using Datadog Browser RUM. It executes standard build and installation commands and ingests project source files, presenting a standard attack surface for indirect prompt injection common to developer tools.

  • Socket1mo

    No alerts

  • Snyk1mo

    Risk: LOW · No issues

Signed by skilld at 659ea9a. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated last month
Other metadata
metadata
{
  "version": "0.1.0",
  "author": "datadog-labs",
  "repository": "https://github.com/datadog-labs/agent-skills",
  "tags": "datadog,rum,browser-rum,instrumentation,session-replay,react,nextjs,angular,vue,nuxt,svelte",
  "alwaysApply": "false"
}

README badge

README badge for datadog-labs/agent-skills/dd-instrument-rum