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.
@bugsnag/js
Advanced tools
Universal Javascript error reporting. Automatically detect JavaScript errors in the browser and Node.js, with plugins for React, Vue, Angular, Express, Restify and Koa.
@bugsnag/js is a JavaScript error monitoring and reporting tool that helps developers detect, diagnose, and resolve errors in their applications. It provides real-time error tracking, detailed error reports, and integrations with various platforms and frameworks.
Error Reporting
This feature allows you to report errors to Bugsnag. The code sample initializes Bugsnag with an API key and reports a test error.
const Bugsnag = require('@bugsnag/js');
Bugsnag.start({ apiKey: 'YOUR_API_KEY' });
try {
throw new Error('Test error');
} catch (e) {
Bugsnag.notify(e);
}
Breadcrumbs
Breadcrumbs are logs of user actions or application events that lead up to an error. This code sample shows how to leave a breadcrumb when a user clicks a button.
const Bugsnag = require('@bugsnag/js');
Bugsnag.start({ apiKey: 'YOUR_API_KEY' });
Bugsnag.leaveBreadcrumb('User clicked button', { buttonId: 'submit' });
Custom Metadata
You can add custom metadata to error reports for more context. This code sample demonstrates adding account information to an error report.
const Bugsnag = require('@bugsnag/js');
Bugsnag.start({ apiKey: 'YOUR_API_KEY' });
Bugsnag.notify(new Error('Test error'), event => {
event.addMetadata('account', {
id: 123,
name: 'Acme Co'
});
});
Session Tracking
Session tracking helps you understand the stability of your application by tracking user sessions. This code sample shows how to start a session.
const Bugsnag = require('@bugsnag/js');
Bugsnag.start({ apiKey: 'YOUR_API_KEY' });
Bugsnag.startSession();
Sentry is a popular error tracking and performance monitoring tool. It provides similar functionalities to Bugsnag, such as real-time error reporting, breadcrumbs, and custom metadata. Sentry also offers performance monitoring features that help track application performance issues.
Rollbar is another error monitoring service that provides real-time error tracking, detailed error reports, and integrations with various platforms. It offers features like error grouping, custom metadata, and breadcrumbs, similar to Bugsnag.
Airbrake is an error monitoring tool that provides real-time error tracking and detailed error reports. It offers features like error grouping, custom metadata, and breadcrumbs, similar to Bugsnag. Airbrake also integrates with various development tools and platforms.
Universal JavaScript notifier.
This package contains both @bugsnag/browser
and @bugsnag/node
and the appropriate one will be included in your application.
In Node, importing '@bugsnag/js'
will provide the @bugsnag/node
module.
In various bundlers, importing '@bugsnag/js'
will provide the @bugsnag/browser
module.
Bundler | Support |
---|---|
Browserify | Supports the package.json "browser" field by default |
Webpack | Supports the package.json "browser" field by default |
Rollup | Set browser: true in the node-resolve plugin |
Note: by using this browser-specific entrypoint, none of the node-specific code will be included in your bundle.
MIT
FAQs
Universal Javascript error reporting. Automatically detect JavaScript errors in the browser and Node.js, with plugins for React, Vue, Angular, Express, Restify and Koa.
The npm package @bugsnag/js receives a total of 523,552 weekly downloads. As such, @bugsnag/js popularity was classified as popular.
We found that @bugsnag/js demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 9 open source maintainers 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.