Skip to content

Commit b4c6ddb

Browse files
authored
Fix captureRouterTransitionStart for Next.js (#13347)
1 parent 29429b3 commit b4c6ddb

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -94,35 +94,35 @@ Create three files in your application's root directory: `sentry.server.config.(
9494
slightly different, so copy them carefully.
9595
</Alert>
9696

97-
```javascript {tabTitle:Client} {filename:instrumentation-client.(js|ts)} {"onboardingOptions": {"performance": "7-13", "session-replay": "5-6, 14-20"}}
97+
```javascript {tabTitle:Client} {filename:instrumentation-client.(js|ts)} {"onboardingOptions": {"performance": "5-10, 26-28", "session-replay": "11-19"}}
9898
import * as Sentry from "@sentry/nextjs";
9999

100-
// This export will instrument router navigations. `captureRouterTransitionStart` is available from SDK version 9.12.0 onwards - upgrade if necessary!
101-
export const onRouterTransitionStart = Sentry.captureRouterTransitionStart;
102-
103100
Sentry.init({
104101
dsn: "___PUBLIC_DSN___",
105-
// Replay may only be enabled for the client-side
106-
integrations: [Sentry.replayIntegration()],
107-
108102
// Set tracesSampleRate to 1.0 to capture 100%
109103
// of transactions for tracing.
110104
// We recommend adjusting this value in production
111105
// Learn more at
112106
// https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate
113107
tracesSampleRate: 1.0,
114-
108+
// Replay may only be enabled for the client-side
109+
integrations: [Sentry.replayIntegration()],
110+
115111
// Capture Replay for 10% of all sessions,
116112
// plus for 100% of sessions with an error
117113
// Learn more at
118114
// https://docs.sentry.io/platforms/javascript/session-replay/configuration/#general-integration-configuration
119115
replaysSessionSampleRate: 0.1,
120116
replaysOnErrorSampleRate: 1.0,
121-
117+
122118
// Note: if you want to override the automatic release value, do not set a
123119
// `release` value here - use the environment variable `SENTRY_RELEASE`, so
124120
// that it will also get attached to your source maps
125121
});
122+
123+
// This export will instrument router navigations, and is only relevant if you enable tracing.
124+
// `captureRouterTransitionStart` is available from SDK version 9.12.0 onwards
125+
export const onRouterTransitionStart = Sentry.captureRouterTransitionStart;
126126
```
127127

128128
```javascript {tabTitle:Server} {filename:sentry.server.config.(js|ts)} {"onboardingOptions": {"performance": "5-11"}}

0 commit comments

Comments
 (0)