Subchapter 38.7
references/rum-other-frameworks.mdMarkdown2 KBView on GitHub
Read rum-core.md first. These targets use @datadog/browser-rum without a framework integration package.
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.
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.
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.
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.
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.