Skip to content

Commit b5cd45c

Browse files
authored
feat(nextjs): Add information about enable next instrumentation (#11140)
1 parent 5785558 commit b5cd45c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

docs/platforms/javascript/guides/nextjs/manual-setup.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,8 @@ We recommend you include your DSN directly in these three files. Alternatively y
142142

143143
While the client initialization code will be injected into your application's client bundle by `withSentryConfig` which we set up earlier,
144144
the configuration for the server and edge runtime needs to be imported from a [Next.js Instrumentation file](https://nextjs.org/docs/app/building-your-application/optimizing/instrumentation).
145-
To set up this file, add a `instrumentation.ts` file to the root directory of your Next.js application (or inside the `src` folder if you're using one) and add the following content:
145+
To set up this file, enable the Next.js instrumentation hook by setting the [`experimental.instrumentationHook`](https://nextjs.org/docs/app/api-reference/next-config-js/instrumentationHook) to `true` in your `next.config.js`.
146+
Then add a `instrumentation.ts` file to the root directory of your Next.js application (or inside the `src` folder if you're using one) and add the following content:
146147

147148
```javascript {filename:instrumentation.(js|ts)}
148149
export async function register() {

0 commit comments

Comments
 (0)