Note
This feature is in beta and may misbehave in edgiest cases.
Interact with Real User Monitoring (RUM) directly from your build system.
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',
}
}Automatically inject the RUM SDK v6 into your application and initialize it.
Full documentation can be found in the Datadog documentation.
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"
}
}required
The RUM application ID. Create a new application if necessary.
optional, will be fetched if missing
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.