⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

Conversation

@priscilawebdev
Copy link
Member

  • Separate server-side and browser-side usage sections for clarity
  • Document openAIIntegration for Node.js platforms (auto-enabled by default)
  • Document instrumentOpenAiClient for browser and edge runtimes
  • Add special handling for Cloudflare Workers edge runtime
  • Simplify code examples by omitting import statements
  • Move configuration and supported versions to shared sections
  • Improve platform-specific visibility using PlatformSection components

closes https://linear.app/getsentry/issue/TET-1719/browser-javascript-ai-agent-onboarding

@linear
Copy link

linear bot commented Jan 16, 2026

@vercel
Copy link

vercel bot commented Jan 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
sentry-docs Ready Ready Preview, Comment Jan 16, 2026 2:28pm
1 Skipped Deployment
Project Deployment Review Updated (UTC)
develop-docs Ignored Ignored Preview Jan 16, 2026 2:28pm

Request Review

## Configuration

By default this integration adds tracing support to OpenAI API method calls including:
By default, tracing support is added to the following OpenAI API method calls:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated this to be abstract as it can either be an integration or helper

Comment on lines 53 to 68
This integration is **enabled by default for Node.js-based platforms** and automatically captures spans for OpenAI API method calls. You don't need to add it to your `integrations` array in `Sentry.init` unless you want to configure input and output recording with the `recordInputs` and `recordOutputs` options:

```javascript
Sentry.init({
dsn: "____PUBLIC_DSN____",
tracesSampleRate: 1.0,
integrations: [
// This integration is enabled by default.
// Only add this if you want to configure options.
Sentry.openAIIntegration({
recordInputs: true,
recordOutputs: true,
}),
],
});
```
Copy link
Member

@shellmayr shellmayr Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this integration is enabled by default, we should give that instruction at the base level, and only give the instructions for options under the subheading. This paragraph also doesn't really tell me what "configuring input and output recording" does for me, so it feels a bit vague right now

Copy link
Member Author

@priscilawebdev priscilawebdev Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved the Options and code snippet under Configuration and the a couple of other things. An image says more than a thousand words:

image

What do you think?

@priscilawebdev
Copy link
Member Author

@RulaKhaled I noticed that we do not have a separate section about Runtime for NextJS + OpenAI. should we add something? https://docs.sentry.io/platforms/javascript/guides/nextjs/configuration/integrations/openai/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants