Skip to content

docs(javascript): Document dataCollection option#17986

Open
s1gr1d wants to merge 4 commits into
masterfrom
sig/dataCollection-option
Open

docs(javascript): Document dataCollection option#17986
s1gr1d wants to merge 4 commits into
masterfrom
sig/dataCollection-option

Conversation

@s1gr1d
Copy link
Copy Markdown
Member

@s1gr1d s1gr1d commented Jun 2, 2026

DESCRIBE YOUR PR

Merge after this is released: getsentry/sentry-javascript#21277

closes getsentry/sentry-javascript#20939

IS YOUR CHANGE URGENT?

Help us prioritize incoming PRs by letting us know when the change needs to go live.

  • Urgent deadline (GA date, etc.):
  • Other deadline:
  • None: Not urgent, can wait up to 1 week+

SLA

  • Teamwork makes the dream work, so please add a reviewer to your PRs.
  • Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it.
    Thanks in advance for your help!

PRE-MERGE CHECKLIST

Make sure you've checked the following before merging your changes:

  • Checked Vercel preview for correctness, including links
  • PR was reviewed and approved by any necessary SMEs (subject matter experts)
  • PR was reviewed and approved by a member of the Sentry docs team

@s1gr1d s1gr1d requested a review from inventarSarah June 2, 2026 11:37
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 2, 2026

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

Project Deployment Actions Updated (UTC)
sentry-docs Ready Ready Preview, Comment Jun 3, 2026 12:43pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
develop-docs Ignored Ignored Preview Jun 3, 2026 12:43pm

Request Review

@s1gr1d s1gr1d requested review from chargome and cleptric June 2, 2026 11:37
Comment thread docs/platforms/javascript/common/configuration/options.mdx
@cleptric
Copy link
Copy Markdown
Member

cleptric commented Jun 2, 2026

Should also add this to https://docs.sentry.io/platforms/javascript/data-management/

Copy link
Copy Markdown
Collaborator

@inventarSarah inventarSarah left a comment

Choose a reason for hiding this comment

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

Content looks good to me 👍

Will updating the other pages that mention sendDefaultPi be covered in a separate PR?
Let me know if I can support you with that.

Comment on lines +219 to +228
```JavaScript
Sentry.init({
dsn: "___PUBLIC_DSN___",
dataCollection: {
genAI: {
inputs: false,
outputs: false,
},
});
```
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Bug: The code example for opting out of AI data collection has a syntax error due to a missing closing brace for the dataCollection object.
Severity: HIGH

Suggested Fix

Add a closing brace } for the dataCollection object after the genAI object's closing brace. The corrected code should close the genAI object, then the dataCollection object, and finally the Sentry.init options object.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location:
docs/platforms/javascript/common/data-management/data-collected/index.mdx#L219-L228

Potential issue: The JavaScript code example for opting out of AI content collection in
`Sentry.init` is invalid. It opens a `dataCollection` object but never closes it. The
snippet has three opening braces but only two closing ones, which will cause a
`SyntaxError` for any developer who copies and pastes this code, preventing their
application from starting.

@s1gr1d
Copy link
Copy Markdown
Member Author

s1gr1d commented Jun 3, 2026

I updated the "Data Collected" page as well now: https://sentry-docs-git-sig-datacollection-option.sentry.dev/platforms/javascript/guides/nextjs/data-management/data-collected/

I also changed all code snippets that contained sendDefaultPii - so users don't get a deprecation warning when they paste the snippet.

Comment thread docs/platforms/javascript/common/data-management/data-collected/index.mdx Outdated
Comment thread docs/platforms/javascript/common/data-management/data-collected/index.mdx Outdated
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.

Update user docs for dataCollection

3 participants