Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
@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.
This package is free software released under the MIT License. See LICENSE.txt for details.
v7.10.0 (2021-05-18)
This release adds @bugsnag/electron
, a notifier for use on apps that are built using Electron.
@bugsnag/electron
and related plugins/
as the path separatorFAQs
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 263,371 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.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.