Sentry integration
Integrate Sentry to monitor errors from a Supabase client
You can use Sentry to monitor errors thrown from a Supabase JavaScript client. Install the Supabase Sentry integration to get started.
The Sentry integration supports browser, Node, and edge environments.
Installation
Install the Sentry integration using your package manager:
Use
If you are using Sentry JavaScript SDK v7, reference supabase-community/sentry-integration-js
repository instead.
To use the Supabase Sentry integration, add it to your integrations
list when initializing your Sentry client.
You can supply either the Supabase Client constructor or an already-initiated instance of a Supabase Client.
All available configuration options are available in our supabase-community/sentry-integration-js
repository.
Deduplicating spans
If you're already monitoring HTTP errors in Sentry, for example with the Http, Fetch, or Undici integrations, you will get duplicate spans for Supabase calls. You can deduplicate the spans by skipping them in your other integration:
Example Next.js configuration
See this example for a setup with Next.js to cover browser, server, and edge environments. First, run through the Sentry Next.js wizard to generate the base Next.js configuration. Then add the Supabase Sentry Integration to all your Sentry.init
calls with the appropriate filters.
Afterward build your application (npm run build
) and start it locally (npm run start
). You will now see the transactions being logged in the terminal when making supabase-js requests.