Socket
Socket
Sign inDemoInstall

@datadog/browser-rum

Package Overview
Dependencies
3
Maintainers
1
Versions
240
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@datadog/browser-rum

Datadog Real User Monitoring (RUM) enables you to visualize and analyze the real-time performance and user journeys of your application's individual users.


Version published
Maintainers
1
Weekly downloads
1,344,096
decreased by-8.68%

Weekly downloads

Package description

What is @datadog/browser-rum?

The @datadog/browser-rum package is a Real User Monitoring (RUM) solution provided by Datadog. It allows developers to collect and analyze performance and user behavior data from their web applications in real-time. This data can be used to identify and troubleshoot issues, improve user experience, and monitor application performance.

What are @datadog/browser-rum's main functionalities?

Real User Monitoring

Initializes the RUM SDK to start collecting data from the user's browser, including session replay recording.

import { datadogRum } from '@datadog/browser-rum';

datadogRum.init({
  applicationId: 'YOUR_APPLICATION_ID',
  clientToken: 'YOUR_CLIENT_TOKEN',
  site: 'datadoghq.com',
  service:'your-service-name',
  // Specify a version number to identify the deployed version of your application in Datadog
  version: '1.0.0',
  sampleRate: 100,
  trackInteractions: true,
});

datadogRum.startSessionReplayRecording();

Custom User Actions

Records custom user actions, such as button clicks, with additional context.

datadogRum.addAction('button_click', { buttonId: 'my-button' });

Logging Errors

Logs errors manually with additional context to help with debugging.

datadogRum.addError(new Error('Something went wrong'), {
  context: {
    productId: 123
  }
});

User Tracking

Sets user information to track user-specific data and associate it with the collected RUM data.

datadogRum.setUser({
  id: '1234',
  name: 'John Doe',
  email: 'john.doe@example.com',
  // User-defined attributes
  plan_type: 'premium',
});

Other packages similar to @datadog/browser-rum

Readme

Source

RUM Browser Monitoring

Datadog Real User Monitoring (RUM) enables you to visualize and analyze the real-time performance and user journeys of your application's individual users.

See the dedicated datadog documentation for more details.

Usage

To start collecting events, add @datadog/browser-rum to your package.json file, then initialize it with:

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

datadogRum.init({
  applicationId: '<DATADOG_APPLICATION_ID>',
  clientToken: '<DATADOG_CLIENT_TOKEN>',
  site: '<DATADOG_SITE>',
  //  service: 'my-web-application',
  //  env: 'production',
  //  version: '1.0.0',
  sessionSampleRate: 100,
  sessionReplaySampleRate: 100,
  trackResources: true,
  trackLongTasks: true,
  trackUserInteractions: true,
})

Note: The trackUserInteractions parameter enables the automatic collection of user clicks in your application. Sensitive and private data contained in your pages may be included to identify the elements interacted with.

FAQs

Last updated on 26 Mar 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc