Skip to content

Commit 605273f

Browse files
matejminarbitsandfoxes
authored andcommitted
feat(vercel-ai): Nextjs backend callout (#14169)
1 parent b997caf commit 605273f

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

docs/platforms/javascript/common/configuration/integrations/vercelai.mdx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,7 @@ This integration only works in the Node.js and Bun runtimes. Requires SDK versio
3333

3434
<PlatformSection supported={["javascript.nextjs"]}>
3535

36-
<Alert level="info">
37-
38-
For Next.js applications, the Vercel AI integration can only be added to `sentry.server.config.ts` (server-side configuration). It is not supported in edge configurations (`sentry.edge.config.ts`) or browser configurations (`instrumentation-client.ts`).
39-
40-
</Alert>
36+
<Include name="nextjs-server-only" />
4137

4238
</PlatformSection>
4339

docs/product/insights/agents/getting-started.mdx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,12 @@ The Sentry JavaScript SDK supports AI agent monitoring through the Vercel AI int
114114

115115
#### Quick Start with Vercel AI SDK
116116

117+
<Include name="nextjs-server-only" />
118+
117119
```javascript
118120
import { Sentry } from "@sentry/node";
119-
import { generateText } from "ai";
120-
import { openai } from "@ai-sdk/openai";
121121

122+
// Sentry init needs to be above everything else
122123
Sentry.init({
123124
tracesSampleRate: 1.0,
124125
integrations: [
@@ -129,6 +130,9 @@ Sentry.init({
129130
],
130131
});
131132

133+
import { generateText } from "ai";
134+
import { openai } from "@ai-sdk/openai";
135+
132136
// Your AI agent function
133137
async function aiAgent(userQuery) {
134138
const result = await generateText({

includes/nextjs-server-only.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<Alert level="info">
2+
3+
For Next.js applications, the Vercel AI integration can only be added to `sentry.server.config.ts` (server-side configuration). It is not supported in edge configurations (`sentry.edge.config.ts`) or browser configurations (`instrumentation-client.ts`).
4+
5+
</Alert>

0 commit comments

Comments
 (0)