Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ supported:
- javascript.react-router
- javascript.astro
- javascript.bun
- javascript.deno
- javascript.cloudflare
- javascript.tanstackstart-react
---

Expand All @@ -40,15 +42,13 @@ You need to have both the Sentry SDK and the Supabase library installed. For Sup
This is the preferred method for most use cases. and follows Sentry's standard integration pattern.

```javascript
import * as Sentry from '@sentry/browser';
import { createClient } from '@supabase/supabase-js';

const supabaseClient = createClient('YOUR_SUPABASE_URL', 'YOUR_SUPABASE_KEY');

Sentry.init({
dsn: 'YOUR_DSN',
integrations: [
Sentry.browserTracingIntegration(),
Sentry.supabaseIntegration({ supabaseClient })
],
tracesSampleRate: 1.0,
Comment on lines 49 to 54

This comment was marked as outdated.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine, we just want to show how the integration should be added to any Sentry.init call.

Comment on lines 49 to 54
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Supabase integration documentation code example is missing the Sentry import, leading to a ReferenceError.
Severity: CRITICAL | Confidence: 1.00

🔍 Detailed Analysis

The code example for Supabase integration in docs/platforms/javascript/common/configuration/integrations/supabase.mdx (lines 42-54) is missing the import * as Sentry from '@sentry/browser'; statement. This omission causes any code following the example to throw a ReferenceError: Sentry is not defined when Sentry.init() or Sentry.supabaseIntegration() are called, preventing the integration from being initialized and used.

💡 Suggested Fix

Restore the Sentry import statement in the Supabase integration code example. Consider using PlatformSection components to provide platform-specific imports (e.g., @sentry/node, @sentry/deno) for broader compatibility.

🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location:
docs/platforms/javascript/common/configuration/integrations/supabase.mdx#L42-L54

Potential issue: The code example for Supabase integration in
`docs/platforms/javascript/common/configuration/integrations/supabase.mdx` (lines 42-54)
is missing the `import * as Sentry from '@sentry/browser';` statement. This omission
causes any code following the example to throw a `ReferenceError: Sentry is not defined`
when `Sentry.init()` or `Sentry.supabaseIntegration()` are called, preventing the
integration from being initialized and used.

Did we get this right? 👍 / 👎 to inform future reviews.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed to showcase how to setup the supabase integration.

Expand Down Expand Up @@ -108,4 +108,4 @@ The integration automatically:

## Supported Versions

- `@supabase/supabase-js`: `>=2.0.0`
- `@supabase/supabase-js`: `>=2.0.0`
28 changes: 28 additions & 0 deletions docs/platforms/react-native/integrations/plugin.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,31 @@ We'll use `bundles/bundle1.js` as an example full path to your file for the tabl
| `RewriteFrames()` | `app:///bundle1.js` | The default behavior is to replace the absolute path, minus the filename, and add the default prefix (`app:///`). |
| `RewriteFrames({root: '/bundles'})` | `app:///bundle1.js` | The `root` is defined as `/bundles`. Only that part is trimmed from the beginning of the path. |
| `RewriteFrames({iteratee: () => {} })` | `app:///bundle.js` | The number at the end of a bundle can be a file hash. This is common in Expo apps. You can remove it in the `iteratee` callback. |

### Supabase

_Import name: `Sentry.supabaseIntegration`_

The `supabaseIntegration` adds instrumentation for the Supabase client to capture spans for both authentication and database operations.

You need to have both the Sentry React Native SDK and the Supabase library installed. For Supabase installation instructions, refer to the [Supabase JavaScript documentation](https://supabase.com/docs/reference/javascript/introduction).

#### Configuration

This is the preferred method for most use cases. and follows Sentry's standard integration pattern.

```javascript
import * as Sentry from "@sentry/react-native";
import { createClient } from '@supabase/supabase-js';

const supabaseClient = createClient('YOUR_SUPABASE_URL', 'YOUR_SUPABASE_KEY');

Sentry.init({
dsn: "___PUBLIC_DSN___",
integrations: [
Sentry.supabaseIntegration({ supabaseClient })
],
});
```

For more information, please refer to [the Supabase integration documentation for the JavaScript SDK](/platforms/javascript/configuration/integrations/supabase/).
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@
| [`captureConsoleIntegration`](./captureconsole) | | | | | ✓ |
| [`extraErrorDataIntegration`](./extraerrordata) | | | | | ✓ |
| [`rewriteFramesIntegration`](./rewriteframes) | | ✓ | | | |
| [`supabaseIntegration`](./supabase) | | ✓ | ✓ | | |
| [`honoIntegration`](./hono) | ✓ | ✓ | | | |
Loading