Skip to content

Commit

Permalink
feat(nextjs): Add information about enable next instrumentation
Browse files Browse the repository at this point in the history
  • Loading branch information
s1gr1d committed Aug 26, 2024
1 parent 96e0273 commit 684b74a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/platforms/javascript/guides/nextjs/manual-setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ We recommend you include your DSN directly in these three files. Alternatively y

While the client initialization code will be injected into your application's client bundle by `withSentryConfig` which we set up earlier,
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).
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:
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`.
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:

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

0 comments on commit 684b74a

Please sign in to comment.