NPM

We recommend installing the SDK through our installation wizard:

Copied
npx @sentry/wizard@latest -i nextjs

The wizard will prompt you to log in to Sentry. It will then automatically do the following steps for you:

  • create config files with the default Sentry.init() calls for each runtime (node, browser, edge)
  • create or update your Next.js config with the default Sentry configuration
  • create .sentryclirc with an auth token to upload source maps (this file is automatically added to .gitignore)
  • add an example page to your app to verify your Sentry setup

After the wizard setup is completed, the SDK will automatically capture unhandled errors, and monitor performance. You can also manually capture errors.

To learn how to connect your app to Sentry and deploy it on Vercel, see the Vercel integration.

Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").