From 2ec2ec1ca5f21fb5ab8a817db2cbd3867dd3b9bc Mon Sep 17 00:00:00 2001 From: Priscila Oliveira Date: Fri, 30 Jan 2026 09:57:14 +0100 Subject: [PATCH] ref(agents): Add code comment with explanations --- .../javascript/agentMonitoring.tsx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/static/app/gettingStartedDocs/javascript/agentMonitoring.tsx b/static/app/gettingStartedDocs/javascript/agentMonitoring.tsx index 1082a91bae7847..0e6277e285266f 100644 --- a/static/app/gettingStartedDocs/javascript/agentMonitoring.tsx +++ b/static/app/gettingStartedDocs/javascript/agentMonitoring.tsx @@ -349,7 +349,13 @@ const response = await client.responses.create({ } /** - * Browser instructions for agent monitoring configuration. + * This function is primarily intended for browser-only instructions. + * However, due to current technical limitations under investigation, + * some meta frameworks also rely on it. + * + * Since these frameworks support Vercel AI / Mastra options, + * we return server-side instructions from the Node.js agent + * monitoring function as well. */ export function agentMonitoring({ packageName = '@sentry/browser', @@ -368,6 +374,9 @@ export function agentMonitoring({ configure: params => { const selected = getAgentIntegration(params); + // The Vercel AI SDK (generateText, streamText) is server-side only to prevent API key exposure. + // Therefore, Node.js instructions is returned for this option. + // This option is only available in meta frameworks. if (selected === AgentIntegration.VERCEL_AI) { return nodeAgentMonitoring({ packageName, @@ -404,6 +413,9 @@ export function agentMonitoring({ verify: params => { const selected = getAgentIntegration(params); + // The Vercel AI SDK (generateText, streamText) is server-side only to prevent API key exposure. + // Therefore, Node.js instructions is returned for this option. + // This option is only available in meta frameworks. if (selected === AgentIntegration.VERCEL_AI) { return nodeAgentMonitoring({ packageName,