Skip to content

Commit cb27fb3

Browse files
add docs for supabase integration (#13545)
Docs for supabase support based on getsentry/sentry-javascript#15436, and adding a coming soon to reference the work here getsentry/sentry-javascript#14611 --------- Co-authored-by: Onur Temizkan <[email protected]>
1 parent a000651 commit cb27fb3

16 files changed

+140
-14
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
---
2+
title: Supabase
3+
description: "Adds instrumentation for Supabase client operations."
4+
supported:
5+
- javascript.browser
6+
- javascript.node
7+
- javascript.aws-lambda
8+
- javascript.azure-functions
9+
- javascript.connect
10+
- javascript.express
11+
- javascript.fastify
12+
- javascript.gcp-functions
13+
- javascript.hapi
14+
- javascript.hono
15+
- javascript.koa
16+
- javascript.nestjs
17+
- javascript.electron
18+
- javascript.nextjs
19+
- javascript.nuxt
20+
- javascript.solidstart
21+
- javascript.sveltekit
22+
- javascript.remix
23+
- javascript.react-router
24+
- javascript.astro
25+
- javascript.bun
26+
- javascript.tanstackstart-react
27+
---
28+
29+
_Import name: `Sentry.supabaseIntegration`_
30+
31+
The `supabaseIntegration` adds instrumentation for the Supabase client to capture spans for both authentication and database operations.
32+
33+
## Installation
34+
35+
You need to have both the Sentry SDK and the Supabase library installed. For Supabase installation instructions, refer to the [Supabase JavaScript documentation](https://supabase.com/docs/reference/javascript/introduction).
36+
37+
38+
## Configuration
39+
40+
This is the preferred method for most use cases. and follows Sentry's standard integration pattern.
41+
42+
```javascript
43+
import * as Sentry from '@sentry/browser';
44+
import { createClient } from '@supabase/supabase-js';
45+
46+
const supabaseClient = createClient('YOUR_SUPABASE_URL', 'YOUR_SUPABASE_KEY');
47+
48+
Sentry.init({
49+
dsn: 'YOUR_DSN',
50+
integrations: [
51+
Sentry.browserTracingIntegration(),
52+
Sentry.supabaseIntegration({ supabaseClient })
53+
],
54+
tracesSampleRate: 1.0,
55+
});
56+
```
57+
58+
## Generated Spans
59+
60+
The integration provides comprehensive monitoring for both authentication and database operations:
61+
62+
### Authentication Spans
63+
64+
The integration automatically instruments the following auth operations:
65+
- `signInWithPassword`
66+
- `signOut`
67+
- `signInAnonymously`
68+
- `signInWithOAuth`
69+
- `signInWithIdToken`
70+
- `signInWithOtp`
71+
- `signInWithSSO`
72+
- `signUp`
73+
- `verifyOtp`
74+
- `reauthenticate`
75+
76+
Admin operations are also instrumented:
77+
- `createUser`
78+
- `deleteUser`
79+
- `listUsers`
80+
- `getUserById`
81+
- `updateUserById`
82+
- `inviteUserByEmail`
83+
84+
### Database Operation Spans
85+
86+
These spans are used to populate Sentry's [Query Insights](/product/insights/backend/queries/) feature, which provides performance metrics and analysis for your database operations. With Query Insights, you can identify slow queries, track query frequency, and optimize your database interactions.
87+
88+
- `db.table`: The table being queried
89+
- `db.schema`: The database schema
90+
- `db.url`: The Supabase instance URL
91+
- `db.sdk`: Client information
92+
- `db.system`: Set to 'postgresql'
93+
- `db.query`: The query parameters
94+
- `db.body`: The request body (for mutations)
95+
96+
### Queue Operation Spans (in progress)
97+
98+
Coming soon, the Sentry SDK will also support generating spans for interactions with Supabase queues. For more information, please follow [this GitHub issue](https://github.com/getsentry/sentry-javascript/issues/14611).
99+
100+
101+
## Error Tracking
102+
103+
The integration automatically:
104+
- Captures errors from failed operations
105+
- Adds breadcrumbs for database operations
106+
- Includes detailed context about the operation that failed
107+
108+
109+
## Supported Versions
110+
111+
- `@supabase/supabase-js`: `>=2.0.0`

platform-includes/configuration/integrations/javascript.astro.mdx

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ Depending on whether an integration enhances the functionality of a particular r
4040
| [`replayIntegration`](./replay) | | | |||
4141
| [`reportingObserverIntegration`](./reportingobserver) | || | | |
4242
| [`statsigIntegration`](./statsig) | | | | ||
43+
| [`supabaseIntegration`](./supabase) | ||| | |
4344
| [`unleashIntegration`](./unleash) | | | | ||
4445

4546
### Node.js Integrations

platform-includes/configuration/integrations/javascript.bun.mdx

+1
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,5 @@
3434
| [`knexIntegration`](./knex) | | || |
3535
| [`prismaIntegration`](./prisma) | | || |
3636
| [`rewriteFramesIntegration`](./rewriteframes) | || | |
37+
| [`supabaseIntegration`](./supabase) | ||| | |
3738
| [`trpcMiddleware`](./trpc) | ||||

platform-includes/configuration/integrations/javascript.deno.mdx

+1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@
1414
| [`denoCronIntegration`](./denocron) | | | || |
1515
| [`extraErrorDataIntegration`](./extraerrordata) | | | | ||
1616
| [`rewriteFramesIntegration`](./rewriteframes) | || | | |
17+
| [`supabaseIntegration`](./supabase) | ||| | |
1718
| [`trpcMiddleware`](./trpc) | ||| ||

platform-includes/configuration/integrations/javascript.fastify.mdx

+2-1
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,5 @@
3939
| [`nodeProfilingIntegration`](./nodeprofiling) | | || |
4040
| [`prismaIntegration`](./prisma) | | || |
4141
| [`rewriteFramesIntegration`](./rewriteframes) | || | |
42-
| [`trpcMiddleware`](./trpc) | ||||
42+
| [`supabaseIntegration`](./supabase) | ||| | |
43+
| [`trpcMiddleware`](./trpc) | ||||

platform-includes/configuration/integrations/javascript.gatsby.mdx

+1
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@
2222
| [`replayIntegration`](./replay) | | | |||
2323
| [`replayCanvasIntegration`](./replaycanvas) | | | || |
2424
| [`reportingObserverIntegration`](./reportingobserver) | || | | |
25+
| [`supabaseIntegration`](./supabase) | ||| | |

platform-includes/configuration/integrations/javascript.gcp-functions.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@
4040
| [`requestDataIntegration`](./requestdata) | | || |
4141
| [`rewriteFramesIntegration`](./rewriteframes) | || | |
4242
| [`tediousIntegration`](./tedious) | | || |
43-
| [`trpcMiddleware`](./trpc) | ||||
43+
| [`trpcMiddleware`](./trpc) | ||||

platform-includes/configuration/integrations/javascript.hapi.mdx

+1
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,5 @@
3939
| [`nodeProfilingIntegration`](./nodeprofiling) | | || |
4040
| [`prismaIntegration`](./prisma) | | || |
4141
| [`rewriteFramesIntegration`](./rewriteframes) | || | |
42+
| [`supabaseIntegration`](./supabase) | ||| | |
4243
| [`trpcMiddleware`](./trpc) | ||||

platform-includes/configuration/integrations/javascript.mdx

+1
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,5 @@
2626
| [`reportingObserverIntegration`](./reportingobserver) | || | | |
2727
| [`rewriteFramesIntegration`](./rewriteframes) | || | | |
2828
| [`statsigIntegration`](./statsig) | | | | ||
29+
| [`supabaseIntegration`](./supabase) | ||| | |
2930
| [`unleashIntegration`](./unleash) | | | | ||

platform-includes/configuration/integrations/javascript.nestjs.mdx

+2
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,6 @@
3939
| [`nodeProfilingIntegration`](./nodeprofiling) | | || |
4040
| [`prismaIntegration`](./prisma) | | || |
4141
| [`rewriteFramesIntegration`](./rewriteframes) | || | |
42+
| [`supabaseIntegration`](./supabase) | ||| | |
4243
| [`trpcMiddleware`](./trpc) | ||||
44+
| [`unleashIntegration`](./unleash) | | | | ||

platform-includes/configuration/integrations/javascript.nextjs.mdx

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ Depending on whether an integration enhances the functionality of a particular r
4040
| [`replayIntegration`](./replay) | | | |||
4141
| [`reportingObserverIntegration`](./reportingobserver) | || | | |
4242
| [`statsigIntegration`](./statsig) | | | | ||
43+
| [`supabaseIntegration`](./supabase) | ||| | |
4344
| [`unleashIntegration`](./unleash) | | | | ||
4445

4546
### Server (Node.js, Edge) Integrations

platform-includes/configuration/integrations/javascript.node.mdx

+13-12
Original file line numberDiff line numberDiff line change
@@ -3,39 +3,40 @@
33
| | **Auto Enabled** | **Errors** | **Tracing** | **Additional Context** |
44
| --------------------------------------------------------- | :--------------: | :--------: | :---------: | :--------------------: |
55
| [`amqplibIntegration`](./amqplib) || || |
6+
| [`anrIntegration`](./anr) | || | |
7+
| [`captureConsoleIntegration`](./captureconsole) | | | ||
8+
| [`childProcessIntegration`](./childProcess) || | ||
69
| [`consoleIntegration`](./console) || | ||
710
| [`contextLinesIntegration`](./contextlines) ||| | |
11+
| [`dataloaderIntegration`](./dataloader) | | || |
812
| [`dedupeIntegration`](./dedupe) ||| | |
13+
| [`extraErrorDataIntegration`](./extraerrordata) | | | ||
14+
| [`fsIntegration`](./fs) | | || |
915
| [`functionToStringIntegration`](./functiontostring) || | | |
1016
| [`genericPoolIntegration`](./genericpool) || || |
1117
| [`graphqlIntegration`](./graphql) || || |
1218
| [`httpIntegration`](./http) |||||
1319
| [`inboundFiltersIntegration`](./inboundfilters) ||| | |
1420
| [`kafkaIntegration`](./kafka) || || |
21+
| [`knexIntegration`](./knex) | | || |
1522
| [`linkedErrorsIntegration`](./linkederrors) ||| | |
23+
| [`localVariablesIntegration`](./localvariables) | || | |
1624
| [`lruMemoizerIntegration`](./lrumemoizer) || || |
1725
| [`modulesIntegration`](./modules) || | ||
1826
| [`mongoIntegration`](./mongo) || || |
1927
| [`mongooseIntegration`](./mongoose) || || |
2028
| [`mysqlIntegration`](./mysql) || || |
2129
| [`mysql2Integration`](./mysql2) || || |
22-
| [`nodeContextIntegration`](./nodecontext) || | ||
2330
| [`nativeNodeFetchIntegration`](./nodefetch) || |||
31+
| [`nodeContextIntegration`](./nodecontext) || | ||
32+
| [`nodeProfilingIntegration`](./nodeprofiling) | | || |
2433
| [`onUncaughtExceptionIntegration`](./onuncaughtexception) ||| | |
2534
| [`onUnhandledRejectionIntegration`](./unhandledrejection) ||| | |
2635
| [`postgresIntegration`](./postgres) || || |
36+
| [`prismaIntegration`](./prisma) | | || |
2737
| [`redisIntegration`](./redis) || || |
2838
| [`requestDataIntegration`](./requestdata) || || |
29-
| [`tediousIntegration`](./tedious) || || |
30-
| [`childProcessIntegration`](./childProcess) || | ||
31-
| [`anrIntegration`](./anr) | || | |
32-
| [`captureConsoleIntegration`](./captureconsole) | | | ||
33-
| [`dataloaderIntegration`](./dataloader) | | || |
34-
| [`extraErrorDataIntegration`](./extraerrordata) | | | ||
35-
| [`fsIntegration`](./fs) | | || |
36-
| [`knexIntegration`](./knex) | | || |
37-
| [`localVariablesIntegration`](./localvariables) | || | |
38-
| [`nodeProfilingIntegration`](./nodeprofiling) | | || |
39-
| [`prismaIntegration`](./prisma) | | || |
4039
| [`rewriteFramesIntegration`](./rewriteframes) | || | |
40+
| [`supabaseIntegration`](./supabase) | ||| |
41+
| [`tediousIntegration`](./tedious) || || |
4142
| [`trpcMiddleware`](./trpc) | ||||

platform-includes/configuration/integrations/javascript.nuxt.mdx

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ Depending on whether an integration enhances the functionality of a particular r
3939
| [`replayIntegration`](./replay) | | | |||
4040
| [`reportingObserverIntegration`](./reportingobserver) | || | | |
4141
| [`statsigIntegration`](./statsig) | | | | ||
42+
| [`supabaseIntegration`](./supabase) | ||| | |
4243
| [`unleashIntegration`](./unleash) | | | | ||
4344

4445
### Node.js Integrations

platform-includes/configuration/integrations/javascript.remix.mdx

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ Depending on whether an integration enhances the functionality of a particular r
3939
| [`replayIntegration`](./replay) | | | |||
4040
| [`reportingObserverIntegration`](./reportingobserver) | || | | |
4141
| [`statsigIntegration`](./statsig) | | | | ||
42+
| [`supabaseIntegration`](./supabase) | ||| | |
4243
| [`unleashIntegration`](./unleash) | | | | ||
4344

4445
### Node.js Integrations

0 commit comments

Comments
 (0)