Skip to content

Commit 0c86023

Browse files
committed
add alerts for next14 case
1 parent 88dba8b commit 0c86023

File tree

4 files changed

+23
-1
lines changed

4 files changed

+23
-1
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ export default withSentryConfig(nextConfig, {
8585
});
8686
```
8787

88+
<Include name="nextjs-app-router-14-config" />
89+
8890
### Initialize Sentry Client-Side and Server-Side SDKs
8991

9092
Create three files in your application's root directory:
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<Expandable title="Additional Configuration for App Router on Next.js 14" level="warning">
2+
In order to enable distributed tracing for App Router on Next.js 14 you need to add or modify the `generateMetadata` function of your root layout:
3+
```typescript {filename:app/layout.tsx}
4+
import * as Sentry from '@sentry/nextjs';
5+
import type { Metadata } from 'next';
6+
7+
export function generateMetadata(): Metadata {
8+
return {
9+
// ... your existing metadata
10+
other: {
11+
...Sentry.getTraceData(),
12+
}
13+
}
14+
};
15+
```
16+
</Expandable>

platform-includes/distributed-tracing/how-to-use/javascript.nextjs.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
If you're using the current version of our Next.js SDK, distributed tracing will work out of the box for the client, server, and edge runtimes.
22

3+
<Include name="nextjs-app-router-14-config" />
4+
35
For client-side, when you are interacting with other external API systems, you might have to define `tracePropagationTargets` to get around possible [Browser CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) issues.
46

57
<Alert>

platform-includes/performance/configure-sample-rate/javascript.nextjs.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,6 @@ Sentry.init({
4242
tracesSampleRate: 1.0,
4343
// ... rest of your config
4444
});
45-
```
45+
```
46+
47+
<Include name="nextjs-app-router-14-config" />

0 commit comments

Comments
 (0)