New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More

@sentry/browser

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sentry/browser - npm Package Versions

2345
60
sentry-bot
published 9.10.0 •

Changelog

Source

9.10.0

Important Changes

  • feat: Add support for logs

    • feat(node): Add logging public APIs to Node SDKs (#15764)
    • feat(core): Add support for beforeSendLog (#15814)
    • feat(core): Add support for parameterizing logs (#15812)
    • fix: Remove critical log severity level (#15824)

    All JavaScript SDKs other than @sentry/cloudflare and @sentry/deno now support sending logs via dedicated methods as part of Sentry's upcoming logging product.

    Logging is gated by an experimental option, _experiments.enableLogs.

    Sentry.init({
      dsn: 'PUBLIC_DSN',
      // `enableLogs` must be set to true to use the logging features
      _experiments: { enableLogs: true },
    });
    
    const { trace, debug, info, warn, error, fatal, fmt } = Sentry.logger;
    
    trace('Starting database connection', { database: 'users' });
    debug('Cache miss for user', { userId: 123 });
    error('Failed to process payment', { orderId: 'order_123', amount: 99.99 });
    fatal('Database connection pool exhausted', { database: 'users', activeConnections: 100 });
    
    // Structured logging via the `fmt` helper function. When you use `fmt`, the string template and parameters are sent separately so they can be queried independently in Sentry.
    
    info(fmt(`Updated profile for user ${userId}`));
    warn(fmt(`Rate limit approaching for endpoint ${endpoint}. Requests: ${requests}, Limit: ${limit}`));
    

    With server-side SDKs like @sentry/node, @sentry/bun or server-side of @sentry/nextjs or @sentry/sveltekit, you can do structured logging without needing the fmt helper function.

    const { info, warn } = Sentry.logger;
    
    info('User %s logged in successfully', [123]);
    warn('Failed to load user %s data', [123], { errorCode: 404 });
    

    To filter logs, or update them before they are sent to Sentry, you can use the _experiments.beforeSendLog option.

  • feat(browser): Add diagnoseSdkConnectivity() function to programmatically detect possible connectivity issues (#15821)

    The diagnoseSdkConnectivity() function can be used to programmatically detect possible connectivity issues with the Sentry SDK.

    const result = await Sentry.diagnoseSdkConnectivity();
    

    The result will be an object with the following properties:

    • "no-client-active": There was no active client when the function was called. This possibly means that the SDK was not initialized yet.
    • "sentry-unreachable": The Sentry SaaS servers were not reachable. This likely means that there is an ad blocker active on the page or that there are other connection issues.
    • undefined: The SDK is working as expected.
  • SDK Tracing Performance Improvements for Node SDKs

    • feat: Stop using dropUndefinedKeys (#15796)
    • feat(node): Only add span listeners for instrumentation when used (#15802)
    • ref: Avoid dropUndefinedKeys for spanToJSON calls (#15792)
    • ref: Avoid using SentryError for PromiseBuffer control flow (#15822)
    • ref: Stop using dropUndefinedKeys in SpanExporter (#15794)
    • ref(core): Avoid using SentryError for event processing control flow (#15823)
    • ref(node): Avoid dropUndefinedKeys in Node SDK init (#15797)
    • ref(opentelemetry): Avoid sampling work for non-root spans (#15820)

    We've been hard at work making performance improvements to the Sentry Node SDKs (@sentry/node, @sentry/aws-serverless, @sentry/nestjs, etc.). We've seen that upgrading from 9.7.0 to 9.10.0 leads to 30-40% improvement in request latency for HTTP web-server applications that use tracing with high sample rates. Non web-server applications and non-tracing applications will see smaller improvements.

Other Changes

  • chore(deps): Bump rrweb to 2.35.0 (#15825)
  • deps: Bump bundler plugins to 3.2.3 (#15829)
  • feat: Always truncate stored breadcrumb messages to 2kb (#15819)
  • feat(nextjs): Disable server webpack-handling for static builds (#15751)
  • fix(nuxt): Don't override Nuxt options if undefined (#15795)
sentry-bot
published 9.9.0 •
sentry-bot
published 9.8.0 •
sentry-bot
published 9.7.0 •
sentry-bot
published 9.7.0-alpha.0 •
sentry-bot
published 9.6.1 •

Changelog

Source

9.6.1

  • feat(deps): bump @prisma/instrumentation from 6.4.1 to 6.5.0 (#15714)
  • feat(deps): bump @sentry/cli from 2.42.2 to 2.42.3 (#15711)
  • fix(nextjs): Re-patch router if it is overridden by Next.js (#15721)
  • fix(nuxt): Add Nitro Rollup plugin to inject Sentry server config (#15710)
  • chore(deps): Bump rollup to 4.35.0 (#15651)
sentry-bot
published 9.6.0 •

Changelog

Source

9.6.0

Important Changes

  • feat(tanstackstart): Add @sentry/tanstackstart-react package and make @sentry/tanstackstart package a utility package (#15629)

    Since TanStack Start is supposed to be a generic framework that supports libraries like React and Solid, the @sentry/tanstackstart SDK package was renamed to @sentry/tanstackstart-react to reflect that the SDK is specifically intended to be used for React TanStack Start applications. Note that the TanStack Start SDK is still in alpha status and may be subject to breaking changes in non-major package updates.

Other Changes

  • feat(astro): Accept all vite-plugin options (#15638)
  • feat(deps): bump @sentry/webpack-plugin from 3.2.1 to 3.2.2 (#15627)
  • feat(tanstackstart): Refine initial API (#15574)
  • fix(core): Ensure fill only patches functions (#15632)
  • fix(nextjs): Consider pageExtensions when looking for instrumentation file (#15701)
  • fix(remix): Null-check options (#15610)
  • fix(sveltekit): Correctly parse angle bracket type assertions for auto instrumentation (#15578)
  • fix(sveltekit): Guard process variable (#15605)

Work in this release was contributed by @angelikatyborska and @nwalters512. Thank you for your contributions!

sentry-bot
published 9.6.0-alpha.0 •
sentry-bot
published 9.5.0 •

Changelog

Source

9.5.0

Important Changes

We found some issues with the new feedback screenshot annotation where screenshots are not being generated properly. Due to this issue, we are reverting the feature.

  • Revert "feat(feedback) Allowing annotation via highlighting & masking (#15484)" (#15609)

Other Changes

  • Add cloudflare adapter detection and path generation (#15603)
  • deps(nextjs): Bump rollup to 4.34.9 (#15589)
  • feat(bun): Automatically add performance integrations (#15586)
  • feat(replay): Bump rrweb to 2.34.0 (#15580)
  • fix(browser): Call original function on early return from patched history API (#15576)
  • fix(nestjs): Copy metadata in custom decorators (#15598)
  • fix(react-router): Fix config type import (#15583)
  • fix(remix): Use correct types export for @sentry/remix/cloudflare (#15599)
  • fix(vue): Attach Pinia state only once per event (#15588)

Work in this release was contributed by @msurdi-a8c, @namoscato, and @rileyg98. Thank you for your contributions!

sentry-bot
published 9.5.0-alpha.0 •
2345
60