Datadog Adapter
Send captured errors to Datadog using both RUM and Logs.
Install
yarn add @datadog/browser-rum @datadog/browser-logs
Both packages are required — the adapter wires up RUM and Logs together.
Activate
import { initialize, useAdapter } from 'unified-error-handling';
initialize();
await useAdapter('datadog', {
applicationId: 'your-application-id',
clientToken: 'your-client-token',
site: 'datadoghq.com',
service: 'web-app',
env: 'production',
});
Config
| Field | Purpose |
|---|---|
applicationId | Datadog RUM application ID. |
clientToken | Datadog client token. |
site | Your Datadog site (e.g. datadoghq.com, datadoghq.eu). |
service | Service name. |
env | Environment label. |
The adapter dynamically imports @datadog/browser-rum and @datadog/browser-logs, initializes both, and forwards captured errors to them.
Notes
- If either package is missing, activation throws
Failed to load DataDog SDK…with the original error preserved ascause. - Datadog already does its own network monitoring via RUM; you may keep the store's
enableNetworkCaptureoff to avoid double-reporting failed requests.