What is @sentry/core?
The @sentry/core package is part of the Sentry SDK for JavaScript, which is designed for real-time monitoring and tracking of application health, errors, and performance issues. It provides the core functionalities needed for initializing and configuring Sentry in your application, handling exceptions, and capturing messages and events.
What are @sentry/core's main functionalities?
Initialization and Configuration
This feature allows you to initialize Sentry in your application with your project's DSN (Data Source Name). It is the first step in integrating Sentry into your project for error tracking and performance monitoring.
Sentry.init({ dsn: 'YOUR_DSN_HERE' });
Capturing Exceptions
This feature enables you to capture exceptions in your code and send them to Sentry for monitoring and analysis. It helps in identifying and debugging errors in your application.
try { myFunction(); } catch (e) { Sentry.captureException(e); }
Capturing Messages
This feature allows you to capture custom messages or log messages in Sentry. It can be used for tracking custom events or information that is not necessarily an error.
Sentry.captureMessage('Something went wrong');
Other packages similar to @sentry/core
logrocket
LogRocket is a frontend application monitoring and product analytics tool that provides session replay, performance monitoring, and error tracking. It offers a more visual approach to debugging by allowing you to replay problems as if you were in your user's shoes. Compared to @sentry/core, LogRocket focuses more on the user experience aspect alongside error tracking.
bugsnag
Bugsnag provides error monitoring and application stability management. It offers features for capturing and tracking errors, diagnosing issues, and improving app stability. Bugsnag is similar to @sentry/core in its core functionalities of error tracking and reporting but also emphasizes application stability metrics and trends.
Sentry JavaScript SDK Core
![npm dt](https://img.shields.io/npm/dt/@sentry/core.svg)
Links
General
This package contains interface definitions, base classes and utilities for building Sentry JavaScript SDKs, like
@sentry/node
or @sentry/browser
.
Please consider all classes and exported functions and interfaces internal
.
For Node.js >= 18.19.0
node --import=@sentry/node/import app.js
- **feat(node): Do not exit process by default when other `onUncaughtException` handlers are registered in
`onUncaughtExceptionIntegration` (#11532)**
In v8, we will no longer exit the node process by default if other uncaught exception handlers have been registered by
the user.
- **Better handling of transaction name for errors**
We improved the way we keep the transaction name for error events, even when spans are not sampled or performance is
disabled.
- feat(fastify): Update scope `transactionName` when handling request (#11447)
- feat(hapi): Update scope `transactionName` when handling request (#11448)
- feat(koa): Update scope `transactionName` when creating router span (#11476)
- feat(sveltekit): Update scope transactionName when handling server-side request (#11511)
- feat(nestjs): Update scope transaction name with parameterized route (#11510)
### Removal/Refactoring of deprecated functionality
- feat(core): Remove `getCurrentHub` from `AsyncContextStrategy` (#11581)
- feat(core): Remove `getGlobalHub` export (#11565)
- feat(core): Remove `Hub` class export (#11560)
- feat(core): Remove most Hub class exports (#11536)
- feat(nextjs): Remove webpack 4 support (#11605)
- feat(vercel-edge): Stop using hub (#11539)
### Other Changes
- feat: Hoist `getCurrentHub` shim to core as `getCurrentHubShim` (#11537)
- feat(core): Add default behaviour for `rewriteFramesIntegration` in browser (#11535)
- feat(core): Ensure replay envelopes are sent in order when offline (#11413)
- feat(core): Extract errors from props in unkown inputs (#11526)
- feat(core): Update metric normalization (#11518)
- feat(feedback): Customize feedback placeholder text color (#11417)
- feat(feedback): Maintain v7 compat in the @sentry-internal/feedback package (#11461)
- feat(next): Handle existing root spans for isolation scope (#11479)
- feat(node): Ensure tracing without performance (TWP) works (#11564)
- feat(opentelemetry): Export `getRequestSpanData` (#11508)
- feat(opentelemetry): Remove otel.attributes in context (#11604)
- feat(ratelimit): Add metrics rate limit (#11538)
- feat(remix): Skip span creation for `OPTIONS` and `HEAD` requests. (#11149)
- feat(replay): Merge packages together & ensure bundles are built (#11552)
- feat(tracing): Adds span envelope and datacategory (#11534)
- fix(browser): Ensure pageload trace remains active after pageload span finished (#11600)
- fix(browser): Ensure tracing without performance (TWP) works (#11561)
- fix(nextjs): Fix `tunnelRoute` matching logic for hybrid cloud (#11576)
- fix(nextjs): Remove Http integration from Next.js (#11304)
- fix(node): Ensure isolation scope is correctly cloned for non-recording spans (#11503)
- fix(node): Make fastify types more broad (#11544)
- fix(node): Send ANR events without scope if event loop blocked indefinitely (#11578)
- fix(tracing): Fixes latest route name and source not updating correctly (#11533)
- ref(browser): Move browserTracing into browser pkg (#11484)
- ref(feedback): Configure font size (#11437)
- ref(feedback): Refactor Feedback types into @sentry/types and reduce the exported surface area (#11355)