Skip to content

Update sentry build options documentation #14555

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
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 @@ -268,6 +268,30 @@ The route manifest is a build-time generated mapping of your Next.js App Router

</SdkOption>

<SdkOption name="reactComponentAnnotation" type="object | undefined">

Enables React component name tracking. When enabled, it annotates React components with data attributes that allow Sentry to track which components users interacted with in features like Session Replay and breadcrumbs.

This option accepts an object with the following property:

- `enabled` (boolean): Whether to enable React component annotation. Defaults to `false`.

```javascript
withSentryConfig(nextConfig, {
reactComponentAnnotation: {
enabled: true,
},
});
```

When enabled, the Sentry Metro plugin applies `@sentry/babel-plugin-component-annotate`, which parses your application's JSX source code at build time and adds `data-sentry-component` and `data-sentry-source-file` attributes to your components. This helps identify exactly which React component was interacted with, removing ambiguity from generic element names.

<Alert level="info">
This feature requires components to be in `.jsx` or `.tsx` file formats. Only components in your project (outside of `node_modules`) are annotated by default.
</Alert>

</SdkOption>

<SdkOption
name="unstable_sentryWebpackPluginOptions"
type="SentryWebpackPluginOptions"
Expand Down