Blog Post

How to use Sentry.io with NextJS

Setting up Sentry for NextJS is really straightforward and can be very useful for debugging your NextJS application.

LoggingNodeJSNextJS

Sentry.io is a great platform for logging your application's errors.

Assuming you are using npm, run:

npm install --save @sentry/nextjs  

Sentry has a wizard script that configures your config files automatically:

npx @sentry/wizard -i nextjs

Make sure to put your CLI auth token into .sentryclirc

Your next.config.js should now export it's config with the withSentryConfig directive

You can read more about it in Sentry.io's Documentation:

https://docs.sentry.io/platforms/javascript/guides/nextjs/