Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion static/app/gettingStartedDocs/javascript/agentMonitoring.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
Loading