
Product
Socket Now Supports pylock.toml Files
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
@bugsnag/core
Advanced tools
@bugsnag/core is a core library for the Bugsnag error monitoring service. It provides the essential functionality for capturing and reporting errors in your applications. This package is typically used as a dependency for other Bugsnag notifier packages that are specific to different platforms (e.g., JavaScript, React Native, etc.).
Initializing Bugsnag
This code initializes the Bugsnag client with your API key, allowing you to start capturing and reporting errors.
const Bugsnag = require('@bugsnag/core');
const bugsnagClient = Bugsnag.createClient({ apiKey: 'YOUR_API_KEY' });
Notifying Errors
This code sends a notification to Bugsnag about an error. This is useful for capturing and reporting errors that occur in your application.
bugsnagClient.notify(new Error('Test error'));
Adding Metadata
This code adds custom metadata to the error report, which can be useful for providing additional context about the error.
bugsnagClient.notify(new Error('Test error'), event => {
event.addMetadata('account', {
id: 123,
name: 'Acme Co'
});
});
Breadcrumbs
This code leaves a breadcrumb, which is a log of actions that happened before an error occurred. Breadcrumbs help in understanding the sequence of events leading up to an error.
bugsnagClient.leaveBreadcrumb('User clicked button', { buttonName: 'Submit' });
Sentry is another popular error tracking and monitoring service. It provides similar functionalities to Bugsnag, such as capturing and reporting errors, adding metadata, and breadcrumbs. Sentry also offers additional features like performance monitoring and release tracking.
Rollbar is an error monitoring service that provides real-time error tracking and debugging tools. It offers similar functionalities to Bugsnag, including error notification, metadata addition, and breadcrumbs. Rollbar also provides features like deployment tracking and error grouping.
Airbrake is an error monitoring service that helps you track and fix errors in your applications. It offers similar functionalities to Bugsnag, such as error notification, metadata addition, and breadcrumbs. Airbrake also provides features like performance monitoring and error grouping.
This package contains the core classes and utilities common to the Bugsnag notifier for any JS-based platform:
Client
classEvent
classBreadcrumb
classSession
classconfig
scheme and utilsUnless you are writing your own notifier, it is unlikely that you want to install this module – for the universal error reporting client, see @bugsnag/js.
This package is free software released under the MIT License. See LICENSE.txt for details.
FAQs
Core classes and utilities for Bugsnag notifiers
The npm package @bugsnag/core receives a total of 621,615 weekly downloads. As such, @bugsnag/core popularity was classified as popular.
We found that @bugsnag/core 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.
Product
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
Security News
Research
Socket uncovered two npm packages that register hidden HTTP endpoints to delete all files on command.
Research
Security News
Malicious Ruby gems typosquat Fastlane plugins to steal Telegram bot tokens, messages, and files, exploiting demand after Vietnam’s Telegram ban.