Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
@datadog/browser-rum
Advanced tools
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.
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',
});
Raygun4js is a JavaScript SDK for Raygun, providing error tracking and real user monitoring. It captures errors and performance data from the browser, offering a feature set that competes with @datadog/browser-rum, with a focus on error diagnosis and resolution.
rum
Datadog browser rum library.
import { Datacenter, datadogRum } from '@datadog/browser-rum'
datadogRum.init({
applicationId: 'XXX',
clientToken: 'XXX',
datacenter: Datacenter.US,
resourceSampleRate: 100,
sampleRate: 100
})
<script src = 'https://www.datadoghq-browser-agent.com/datadog-rum-us.js'>
<script>
window.DD_RUM.init({
applicationId: 'XXX',
clientToken: 'XXX',
datacenter: 'us',
resourceSampleRate: 100,
sampleRate: 100
});
</script>
Init must be called to start the tracking. Configurable options:
sampleRate
: percentage of sessions to track. Only tracked sessions send rum events.resourceSampleRate
: percentage of tracked sessions with resources collection.datacenter
: defined to which datacenter we'll send collected data ('us' | 'eu')silentMultipleInit
: prevent logging errors while having multiple InittrackInteractions
: collect actions initiated by user interactionsservice
: name of the corresponding serviceenv
: environment of the serviceversion
: version of the serviceinit(configuration: {
applicationId: string,
clientToken: string,
datacenter?: string,
resourceSampleRate?: number
sampleRate?: number,
silentMultipleInit?: boolean,
trackInteractions?: boolean,
service?: string,
env?: string,
version?: string,
})
Modify the global context
addRumGlobalContext (key: string, value: any) # add one key-value to the default context
setRumGlobalContext (context: Context) # entirely replace the default context
Add user action
addUserAction (name: string, context: Context)
The RUM library is using various strategies to get a name for click actions, but if you want more
control, you can define a data-dd-action-name
attribute on clickable elements (or any of their
parents) that will be used to name the action. Examples:
<a class="btn btn-default" href="#" role="button" data-dd-action-name="Login button">Try it out!</a>
<div class="alert alert-danger" role="alert" data-dd-action-name="Dismiss alert">
<span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
<span class="sr-only">Error:</span>
Enter a valid email address
</div>
Types are compatible with TypeScript >= 3.0. For earlier version, you can import js sources and use global variable to avoid any compilation issue:
import '@datadog/browser-rum/bundle/datadog-rum-us';
window.DD_RUM.init({
applicationId: 'XXX',
clientToken: 'XXX',
datacenter: 'us',
resourceSampleRate: 100,
sampleRate: 100
});
v1.14.0
FAQs
Unknown package
The npm package @datadog/browser-rum receives a total of 1,364,251 weekly downloads. As such, @datadog/browser-rum popularity was classified as popular.
We found that @datadog/browser-rum demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
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.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.