🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more

@sentry/nextjs

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
s

@sentry/nextjs

Official Sentry SDK for Next.js

96

Supply Chain Security

100

Vulnerability

90

Quality

100

Maintenance

100

License

Version
9.28.1
Version published
Weekly downloads
2.2M
-1.63%
Maintainers
10
Weekly downloads
 
Created
Issues + PRs
407

Sentry

Official Sentry SDK for Next.js

npm version npm dm npm dt

See the Official Sentry Next.js SDK Docs to get started.

Compatibility

Currently, the minimum supported version of Next.js is 13.2.0.

Installation

To get started installing the SDK, use the Sentry Next.js Wizard by running the following command in your terminal or read the Getting Started Docs:

npx @sentry/wizard@latest -i nextjs

The wizard will prompt you to log in to Sentry. After the wizard setup is completed, the SDK will automatically capture unhandled errors, and monitor performance.

Custom Usage

To set context information or to send manual events, you can use @sentry/nextjs as follows:

import * as Sentry from '@sentry/nextjs';

// Set user information, as well as tags and further extras
Sentry.setTag('user_mode', 'admin');
Sentry.setUser({ id: '4711' });
Sentry.setContext('application_area', { location: 'checkout' });

// Add a breadcrumb for future events
Sentry.addBreadcrumb({
  message: '"Add to cart" clicked',
  // ...
});

// Capture exceptions or messages
Sentry.captureException(new Error('Oh no.'));
Sentry.captureMessage('Hello, world!');

FAQs

Package last updated on 11 Jun 2025

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