Skip to content

[skill-drift] update(sentry-react-sdk): document dataCollection option (v10.55.0)#155

Open
github-actions[bot] wants to merge 1 commit into
mainfrom
skill-drift/sentry-react-sdk-skill-drift-update-sentry-react-sdk-docu-1780325450
Open

[skill-drift] update(sentry-react-sdk): document dataCollection option (v10.55.0)#155
github-actions[bot] wants to merge 1 commit into
mainfrom
skill-drift/sentry-react-sdk-skill-drift-update-sentry-react-sdk-docu-1780325450

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot commented Jun 1, 2026

Warning

Auto-generated from external SDK content. Review all links and code suggestions before acting on them.

Summary

  • Document the new dataCollection option introduced in SDK v10.55.0 (PR #21097, #20965)
  • Update Sentry.init() example to use dataCollection instead of deprecated sendDefaultPii
  • Add comprehensive dataCollection options table with all fields and filtering patterns
  • Mark sendDefaultPii as legacy with deprecation warning

Context

The browser SDK (which @sentry/react extends) introduced dataCollection as a fine-grained replacement for the boolean sendDefaultPii option. dataCollection provides per-feature control over:

  • User info (IP, headers)
  • Cookies (with allow/deny filtering)
  • HTTP headers (request/response, with filtering)
  • Query params (with filtering)
  • HTTP bodies
  • AI inputs/outputs
  • Stack frame variables

sendDefaultPii will be deprecated in a future major version.

Changes

skills/sentry-react-sdk/SKILL.md:

  • Replaced sendDefaultPii: true with dataCollection: { userInfo: true } in init example (line 130)
  • Added dataCollection to configuration reference table as recommended option
  • Marked sendDefaultPii as legacy
  • Added new "dataCollection Options" subsection with full API documentation and filtering examples

Reviewed PRs

  • #21097 (May 28) — Migrated browser SDK to dataCollection for infer_ip, cookies, headers, and metrics
  • #20965 (before window) — Added dataCollection type definition
  • #21172 (May 28) — Internal: React SyntheticEvent normalization (no user-facing config)

Testing

Skill documentation change only; no runtime behavior changes. Users following the updated wizard will use the future-proof dataCollection API instead of the legacy sendDefaultPii.

Source PRs

…n (v10.55.0)

Automated drift-fix run.

Co-Authored-By: Claude (claude-sonnet-4-5) <noreply@anthropic.com>
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 05ec9f4. Configure here.

userInfo: true,
cookies: { allow: ['session', 'user_id'] },
httpHeaders: {
request: { allow: ['authorization', 'x-request-id'] },
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Example allowlists authorization header

Medium Severity

The new dataCollection filtering example uses httpHeaders.request allow with authorization, which instructs readers to forward credential-bearing headers to Sentry. The browser SDK skill’s parallel example denies authorization and cookie instead.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 05ec9f4. Configure here.

Comment on lines +130 to +133
// Data collection (recommended; replaces sendDefaultPii)
dataCollection: {
userInfo: true, // Collect user IP and headers
},
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: The documentation incorrectly states dataCollection: { userInfo: true } is a full replacement for sendDefaultPii: true, omitting cookies and httpHeaders collection.
Severity: MEDIUM

Suggested Fix

Update the documentation to show the correct equivalent for sendDefaultPii: true. The dataCollection object should include userInfo: true, cookies: true, and httpHeaders: { request: true, response: true } to match the behavior of the deprecated option.

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: skills/sentry-react-sdk/SKILL.md#L130-L133

Potential issue: The documentation for migrating from `sendDefaultPii: true` is
incomplete. It claims that setting `dataCollection: { userInfo: true }` is the direct
equivalent. However, this only enables the collection of user identity fields
(`user.*`). The correct replacement, as documented in the parent browser SDK, also
requires setting `cookies: true` and `httpHeaders: { request: true, response: true }`.
Developers following this guide will unknowingly stop collecting PII from cookies and
HTTP headers, leading to silent data loss in their Sentry events.

Did we get this right? 👍 / 👎 to inform future reviews.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants