From 73f19ba04e1e58f758d4b879934c2a9cbef3504c Mon Sep 17 00:00:00 2001 From: Abdelrahman Awad Date: Mon, 19 Jan 2026 14:57:34 -0500 Subject: [PATCH 1/7] docs(nextjs): document the route manifest injection option --- .../guides/nextjs/configuration/build/index.mdx | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/docs/platforms/javascript/guides/nextjs/configuration/build/index.mdx b/docs/platforms/javascript/guides/nextjs/configuration/build/index.mdx index 09c9944489632..c52b43462a39e 100644 --- a/docs/platforms/javascript/guides/nextjs/configuration/build/index.mdx +++ b/docs/platforms/javascript/guides/nextjs/configuration/build/index.mdx @@ -222,12 +222,14 @@ Enables the use of the [`runAfterProductionCompile` hook from Next.js](https://n - + -Disables automatic injection of the route manifest into the client bundle. +Controls the behavior of the route manifest injection into 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 (e.g., `/users/:id` instead of `/users/123`, `/users/456`, etc.). +You can set this option to `false` to disable the route manifest injection. + **Disable this option if:** - You want to minimize client bundle size @@ -235,6 +237,16 @@ The route manifest is a build-time generated mapping of your Next.js App Router - 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 to control which routes should be excluded from the route manifest. + +```javascript +routeManifestInjection: { + exclude: ["/api/health", "/api/excluded/[parameter]", /^\/internal\//], + // or a function that return `true` to exclude the route + exclude: (route) => route.includes("/excluded"), +}, +``` + ## Next.js Webpack Options From 011617a5b763c530a93d6f80666e43a0fb621717 Mon Sep 17 00:00:00 2001 From: Abdelrahman Awad Date: Mon, 19 Jan 2026 15:08:34 -0500 Subject: [PATCH 2/7] docs: added a couple of lines --- .../javascript/guides/nextjs/configuration/build/index.mdx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/platforms/javascript/guides/nextjs/configuration/build/index.mdx b/docs/platforms/javascript/guides/nextjs/configuration/build/index.mdx index c52b43462a39e..40fe1fcba25d3 100644 --- a/docs/platforms/javascript/guides/nextjs/configuration/build/index.mdx +++ b/docs/platforms/javascript/guides/nextjs/configuration/build/index.mdx @@ -224,6 +224,8 @@ Enables the use of the [`runAfterProductionCompile` hook from Next.js](https://n + + Controls the behavior of the route manifest injection into 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 (e.g., `/users/:id` instead of `/users/123`, `/users/456`, etc.). @@ -237,7 +239,7 @@ You can set this option to `false` to disable the route manifest injection. - 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 to control which routes should be excluded from the route manifest. +You can also pass in an object to control which routes should be excluded from the route manifest: ```javascript routeManifestInjection: { @@ -247,6 +249,8 @@ routeManifestInjection: { }, ``` +Excluding specific routes can be useful if you have routes with unreleased features or private routes that you don't want to be included in the route manifest. + ## Next.js Webpack Options From d3ba1b1c1eaecca3f078292ba5193d98efbb4451 Mon Sep 17 00:00:00 2001 From: Abdelrahman Awad Date: Mon, 19 Jan 2026 21:09:24 +0100 Subject: [PATCH 3/7] docs: spelling Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../javascript/guides/nextjs/configuration/build/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/platforms/javascript/guides/nextjs/configuration/build/index.mdx b/docs/platforms/javascript/guides/nextjs/configuration/build/index.mdx index 40fe1fcba25d3..8233a416c771f 100644 --- a/docs/platforms/javascript/guides/nextjs/configuration/build/index.mdx +++ b/docs/platforms/javascript/guides/nextjs/configuration/build/index.mdx @@ -244,7 +244,7 @@ You can also pass in an object to control which routes should be excluded from t ```javascript routeManifestInjection: { exclude: ["/api/health", "/api/excluded/[parameter]", /^\/internal\//], - // or a function that return `true` to exclude the route + // or a function that returns `true` to exclude the route exclude: (route) => route.includes("/excluded"), }, ``` From 632eae15f5bffeb9bf5d585854b3b4f76fdd6af6 Mon Sep 17 00:00:00 2001 From: Abdelrahman Awad Date: Tue, 20 Jan 2026 14:33:13 +0100 Subject: [PATCH 4/7] docs: cleanup Co-authored-by: Sarah Mischinger --- .../javascript/guides/nextjs/configuration/build/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/platforms/javascript/guides/nextjs/configuration/build/index.mdx b/docs/platforms/javascript/guides/nextjs/configuration/build/index.mdx index 8233a416c771f..027d682e942b9 100644 --- a/docs/platforms/javascript/guides/nextjs/configuration/build/index.mdx +++ b/docs/platforms/javascript/guides/nextjs/configuration/build/index.mdx @@ -228,7 +228,7 @@ Enables the use of the [`runAfterProductionCompile` hook from Next.js](https://n Controls the behavior of the route manifest injection into 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 (e.g., `/users/:id` instead of `/users/123`, `/users/456`, etc.). +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. From e0b6e6e40cc6e8e99d2e532aee6a0896535b7a71 Mon Sep 17 00:00:00 2001 From: Abdelrahman Awad Date: Tue, 20 Jan 2026 14:33:49 +0100 Subject: [PATCH 5/7] docs: make option description more explicit Co-authored-by: Sarah Mischinger --- .../javascript/guides/nextjs/configuration/build/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/platforms/javascript/guides/nextjs/configuration/build/index.mdx b/docs/platforms/javascript/guides/nextjs/configuration/build/index.mdx index 027d682e942b9..db5fc56602e97 100644 --- a/docs/platforms/javascript/guides/nextjs/configuration/build/index.mdx +++ b/docs/platforms/javascript/guides/nextjs/configuration/build/index.mdx @@ -226,7 +226,7 @@ Enables the use of the [`runAfterProductionCompile` hook from Next.js](https://n -Controls the behavior of the route manifest injection into the client bundle. +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`). From 2d5cf765c4983b1f2de88a207a36a6cc1cef7420 Mon Sep 17 00:00:00 2001 From: Abdelrahman Awad Date: Tue, 20 Jan 2026 08:44:19 -0500 Subject: [PATCH 6/7] docs: several updates --- .../guides/nextjs/configuration/build/index.mdx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/platforms/javascript/guides/nextjs/configuration/build/index.mdx b/docs/platforms/javascript/guides/nextjs/configuration/build/index.mdx index db5fc56602e97..ec402adf8eb2a 100644 --- a/docs/platforms/javascript/guides/nextjs/configuration/build/index.mdx +++ b/docs/platforms/javascript/guides/nextjs/configuration/build/index.mdx @@ -226,6 +226,10 @@ Enables the use of the [`runAfterProductionCompile` hook from Next.js](https://n + + `routeManifestInjection` option is only supported in the App Router. + + 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`). @@ -237,9 +241,8 @@ You can set this option to `false` to disable the route manifest injection. - 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 to control which routes should be excluded from the route manifest: +You can also pass in an object with an `exclude` property to control which routes should be excluded from the route manifest: ```javascript routeManifestInjection: { @@ -249,7 +252,10 @@ routeManifestInjection: { }, ``` -Excluding specific routes can be useful if you have routes with unreleased features or private routes that you don't want to be included in the route manifest. +**Use this if:** + +- You want to exclude routes that are not yet released or should not be publicly accessible. +- You want to reduce the size of the route manifest by excluding routes that do not require parameterized grouping. From 8fe2db770a1cef02a9e2bcbc0d84cfe2faf9dc2e Mon Sep 17 00:00:00 2001 From: Abdelrahman Awad Date: Tue, 20 Jan 2026 08:47:05 -0500 Subject: [PATCH 7/7] docs: better wording --- .../nextjs/configuration/build/index.mdx | 30 +++++++++++++------ 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/docs/platforms/javascript/guides/nextjs/configuration/build/index.mdx b/docs/platforms/javascript/guides/nextjs/configuration/build/index.mdx index ec402adf8eb2a..aa5685ec3fa41 100644 --- a/docs/platforms/javascript/guides/nextjs/configuration/build/index.mdx +++ b/docs/platforms/javascript/guides/nextjs/configuration/build/index.mdx @@ -242,20 +242,32 @@ You can set this option to `false` to disable the route manifest injection. - You're experiencing build issues related to route scanning - You prefer raw URLs in transaction names -You can also pass in an object with an `exclude` property to control which routes should be excluded from the route manifest: +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 -routeManifestInjection: { - exclude: ["/api/health", "/api/excluded/[parameter]", /^\/internal\//], - // or a function that returns `true` to exclude the route - exclude: (route) => route.includes("/excluded"), -}, +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"), + }, +}); ``` -**Use this if:** +Excluded routes will appear as raw URLs in transaction names instead of parameterized routes. + +**Use `exclude` if:** -- You want to exclude routes that are not yet released or should not be publicly accessible. -- You want to reduce the size of the route manifest by excluding routes that do not require parameterized grouping. +- 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)