Skip to content

Latest commit

 

History

History
100 lines (70 loc) · 2.57 KB

File metadata and controls

100 lines (70 loc) · 2.57 KB

RUM Plugin

Note

This feature is in beta and may misbehave in edgiest cases.

Interact with Real User Monitoring (RUM) directly from your build system.

Table of content

Configuration

Full configuration
rum?: {
    enable?: boolean;
    sdk?: {
        applicationId: string;
        clientToken?: string;
        // [...] See https://docs.datadoghq.com/real_user_monitoring/browser/setup/client?tab=rum#configuration for all options.
    };
}

Minimal configuration:

rum: {
    sdk: {
        applicationId: 'your_application_id',
    }
}

Browser SDK Injection

Automatically inject the RUM SDK v6 into your application and initialize it.

Full documentation can be found in the Datadog documentation.

Using global DD_RUM

You can use the global DD_RUM object to interact with the RUM SDK.

Note

You don't need to use DD_RUM.onReady() to wrap your code, the plugin makes sure the SDK is loaded before executing your code.

For TypeScript projects, you can declare the global type using the types bundled with the plugin:

import type { RumTypes } from '@datadog/webpack-plugin'; // or rollup-plugin, vite-plugin, etc.

declare global {
    interface Window {
        DD_RUM?: RumTypes['RumPublicApi'];
    }
}

You can also configure eslint to recognize the global DD_RUM object:

{
    "globals": {
        "DD_RUM": "readonly"
    }
}

rum.sdk.applicationId

required

The RUM application ID. Create a new application if necessary.

rum.sdk.clientToken

optional, will be fetched if missing

A Datadog client token.

Note

If not provided, the plugin will attempt to fetch the client token using the API. You need to provide both auth.apiKey and auth.appKey with the rum_apps_read permission.