Sentry is an observability platform that helps you monitor your application's performance and errors. In this guide, you'll learn how to configure Sentry in your Next.js Supabase SaaS kit.
To use Sentry to capture exceptions and performance metrics of your app, please define the below variables:
NEXT_PUBLIC_MONITORING_PROVIDER=sentry
NEXT_PUBLIC_SENTRY_DSN=your_dsn
Please install the package @sentry/nextjs
in apps/web/package.json
as a dependency.
pnpm i @sentry/nextjs --filter web
Finally, update the Next.js configuration in your next.config.js
file:
next.config.mjs
import { withSentryConfig } from '@sentry/nextjs';
// wrap your Next.js configuration with the Sentry configuration
withSentryConfig(nextConfig);
You can find your Sentry DSN in the Sentry dashboard.