From b5cd45c290eff87689efb6df555775532f6d55d8 Mon Sep 17 00:00:00 2001 From: Sigrid Huemer <32902192+s1gr1d@users.noreply.github.com> Date: Mon, 2 Sep 2024 09:19:07 +0200 Subject: [PATCH] feat(nextjs): Add information about enable next instrumentation (#11140) --- docs/platforms/javascript/guides/nextjs/manual-setup.mdx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/platforms/javascript/guides/nextjs/manual-setup.mdx b/docs/platforms/javascript/guides/nextjs/manual-setup.mdx index e2785a6fadfa0..ad9c6d6af053e 100644 --- a/docs/platforms/javascript/guides/nextjs/manual-setup.mdx +++ b/docs/platforms/javascript/guides/nextjs/manual-setup.mdx @@ -142,7 +142,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() {