Follow this checklist when connecting this boilerplate to a Sentry project.
- Create or access a Sentry account and organization.
- Create a Sentry project for this Next.js application.
- Copy the project DSN from the Sentry project settings.
- Add the required public variables to
.env.local. Add the optional private variables only when source-map uploads should run during production builds.NEXT_PUBLIC_ENABLE_SENTRY=true NEXT_PUBLIC_SENTRY_DSN=https://your-public-dsn@sentry.io/project-id # Optional: enable source-map uploads for production builds. SENTRY_ORG=your-org-slug SENTRY_PROJECT=your-project-slug SENTRY_AUTH_TOKEN=your-auth-token - Restart the dev server or rebuild the app after changing environment variables.
- Validate the integration in non-production from /internal/sentry-example-page.
- Keep
SENTRY_AUTH_TOKENsecret. Disable Sentry by settingNEXT_PUBLIC_ENABLE_SENTRY=falseor leavingNEXT_PUBLIC_SENTRY_DSNempty.
This guide only describes setup. Runtime behavior stays controlled by the existing Sentry configuration in this project.