Skip to content
Merged
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 @@ -222,18 +222,52 @@ Enables the use of the [`runAfterProductionCompile` hook from Next.js](https://n

</SdkOption>

<SdkOption name="disableManifestInjection" type="boolean|undefined" defaultValue="false">
<SdkOption name="routeManifestInjection" type="boolean|object" defaultValue="true">

Disables automatic injection of the route manifest into the client bundle.
<AvailableSince version="10.34.0" />

The route manifest is a build-time generated mapping of your Next.js App Router routes that enables Sentry to group transactions by parameterized route names (e.g., `/users/:id` instead of `/users/123`, `/users/456`, etc.).
<Alert level="info" title="App Router only">
`routeManifestInjection` option is only supported in the App Router.
</Alert>

Controls injection and filtering of the route manifest in the client bundle.

The route manifest is a build-time generated mapping of your Next.js App Router routes that enables Sentry to group transactions by parameterized route names (for example, `/users/:id` instead of `/users/123` or `/users/456`).

You can set this option to `false` to disable the route manifest injection.

**Disable this option if:**

- You want to minimize client bundle size
- You're experiencing build issues related to route scanning
- You prefer raw URLs in transaction names
- You're only using the Pages Router (this feature is only supported in the App Router)

You can also pass in an object with an `exclude` property to control which routes should be excluded from the route manifest. The `exclude` property accepts an array of strings or regular expressions, or a function that returns `true` to exclude a route.

```javascript
withSentryConfig(nextConfig, {
// Exclude specific routes using an array of strings or RegExps
routeManifestInjection: {
exclude: ["/api/health", "/api/excluded/[parameter]", /^\/internal\//],
},
});
```

```javascript
withSentryConfig(nextConfig, {
// Or use a function for dynamic exclusion
routeManifestInjection: {
exclude: (route) => route.includes("/excluded"),
},
});
```

Excluded routes will appear as raw URLs in transaction names instead of parameterized routes.

**Use `exclude` if:**

- You want to hide internal or unreleased routes from appearing in the client bundle
- You want to reduce bundle size by excluding routes that don't benefit from parameterized grouping (for example, static routes with no dynamic segments)

</SdkOption>

Expand Down