Socket
Socket
Sign inDemoInstall

@bugsnag/node

Package Overview
Dependencies
6
Maintainers
9
Versions
113
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bugsnag/node


Version published
Maintainers
9
Install size
463 kB
Created

Package description

What is @bugsnag/node?

@bugsnag/node is a comprehensive error monitoring and reporting tool for Node.js applications. It helps developers detect, diagnose, and resolve errors in real-time, ensuring a smoother user experience and more stable application performance.

What are @bugsnag/node's main functionalities?

Error Reporting

This feature allows you to report errors to Bugsnag. By initializing Bugsnag with your API key and using the `notify` method, you can send error details to the Bugsnag dashboard for further analysis.

const Bugsnag = require('@bugsnag/node');
Bugsnag.start({ apiKey: 'YOUR_API_KEY' });

try {
  throw new Error('Something went wrong!');
} catch (e) {
  Bugsnag.notify(e);
}

Breadcrumbs

Breadcrumbs are logs of events that lead up to an error, providing context for debugging. This feature allows you to leave breadcrumbs that will be sent along with error reports.

const Bugsnag = require('@bugsnag/node');
Bugsnag.start({ apiKey: 'YOUR_API_KEY' });

Bugsnag.leaveBreadcrumb('User clicked button', { buttonId: 'submit' });

try {
  throw new Error('Something went wrong!');
} catch (e) {
  Bugsnag.notify(e);
}

Custom Metadata

This feature allows you to add custom metadata to your error reports. This can include any additional information that might be useful for debugging, such as user account details or application state.

const Bugsnag = require('@bugsnag/node');
Bugsnag.start({ apiKey: 'YOUR_API_KEY' });

try {
  throw new Error('Something went wrong!');
} catch (e) {
  Bugsnag.notify(e, event => {
    event.addMetadata('account', {
      id: 1234,
      name: 'Acme Co'
    });
  });
}

Session Tracking

Session tracking helps you understand the stability of your application from the perspective of your users. By starting a session, you can track errors that occur during that session and get insights into user experience.

const Bugsnag = require('@bugsnag/node');
Bugsnag.start({ apiKey: 'YOUR_API_KEY' });

Bugsnag.startSession();

try {
  throw new Error('Something went wrong!');
} catch (e) {
  Bugsnag.notify(e);
}

Other packages similar to @bugsnag/node

Readme

Source

@bugsnag/node

This package contains the Node.js implementation of the Bugsnag notifier for JavaScript. The normal use case is to install this package via @bugsnag/js, but you can install it directly if you want to.

License

This package is free software released under the MIT License. See LICENSE.txt for details.

FAQs

Last updated on 16 May 2024

Did you know?

Socket

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc