Skip to content

[skill-drift] update(sentry-nestjs-sdk): document dataCollection API replacing sendDefaultPii - #151

Merged
chargome merged 8 commits into
mainfrom
skill-drift/sentry-nestjs-sdk-skill-drift-update-sentry-nestjs-sdk-doc-1780325425
Jun 16, 2026
Merged

chargome merged 8 commits into
mainfrom
skill-drift/sentry-nestjs-sdk-skill-drift-update-sentry-nestjs-sdk-doc-1780325425

Conversation

@github-actions

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

Copy link
Copy Markdown
Contributor

Warning

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

Summary

  • Updated Sentry.init() examples to use new dataCollection API (SDK ≥ 10.54.0)
  • Added dataCollection configuration options to the reference table
  • Marked sendDefaultPii as deprecated in favor of dataCollection.userInfo
  • Updated config-driven init example to use dataCollection

Context

The Sentry JavaScript SDK introduced a new dataCollection client option in v10.54.0 (PR #20965) as a centralized, fine-grained way to control data collection. The simple sendDefaultPii boolean option will be deprecated and removed in a future release.

Recent migrations to dataCollection that affect NestJS:

  • PR #21100: Migrated @sentry/node-core (merged May 28, 2026)
  • PR #21071: Migrated core request data collection (merged May 28, 2026)

Changes Made

  1. Init examples (lines 158-174, 185-195): Replaced sendDefaultPii: true with the new dataCollection object showing:

    • userInfo: true (replaces sendDefaultPii for user context/IP)
    • httpHeaders control for request/response headers
    • cookies and queryParams collection options
    • Added comment noting sendDefaultPii is deprecated
  2. Configuration table (lines 489-519):

    • Added dataCollection and its sub-options
    • Marked sendDefaultPii as Deprecated
    • Added defaults note for httpHeaders and genAI
  3. Config example reference (line 198): Updated comment to mention dataCollection instead of sendDefaultPii

Reviewed PRs

All PRs merged within the 7-day window (cutoff: 2026-05-25)

Primary drift source:

  • PR #21100 — feat(node-core): Migrate sendDefaultPii to dataCollection (May 28, 2026)
  • PR #21071 — feat(core): Migrate request data to dataCollection (May 28, 2026)

Related migrations (inform broader ecosystem shift):

Why this matters for NestJS:
NestJS SDK inherits from @sentry/node and @sentry/node-core. The node-core migration makes dataCollection the recommended API for all Node.js-based SDKs, including NestJS.

🤖 Generated with Claude Code skill-drift detection

Source PRs

…replacing sendDefaultPii

Automated drift-fix run.

Co-Authored-By: Claude (claude-sonnet-4-5) <noreply@anthropic.com>
Comment thread skills/sentry-nestjs-sdk/SKILL.md
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@cleptric
cleptric requested a review from a team as a code owner June 15, 2026 13:46
@cleptric
cleptric requested review from chargome and nicohrubec June 15, 2026 13:46
Comment thread skills/sentry-nestjs-sdk/SKILL.md Outdated
Comment thread skills/sentry-nestjs-sdk/SKILL.md Outdated
Comment thread skills/sentry-nestjs-sdk/SKILL.md Outdated
Comment thread skills/sentry-nestjs-sdk/SKILL.md Outdated
chargome and others added 6 commits June 15, 2026 15:51
…stjs-sdk-skill-drift-update-sentry-nestjs-sdk-doc-1780325425
…-nestjs-sdk-doc-1780325425' of github.com:getsentry/sentry-for-ai into skill-drift/sentry-nestjs-sdk-skill-drift-update-sentry-nestjs-sdk-doc-1780325425
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Comment on lines +506 to +511
| `dataCollection` | `object` | See below | Controls what data the SDK collects (SDK ≥ 10.57.0) |
| `dataCollection.userInfo` | `boolean` | `true` | Include IP addresses and user context |
| `dataCollection.httpHeaders` | `object` | See below | Capture HTTP headers for requests/responses |
| `dataCollection.cookies` | `boolean\|object` | `true` | Capture cookies; use `{allow: [...]}` or `{deny: [...]}` for filtering |
| `dataCollection.queryParams` | `boolean\|object` | `true` | Capture URL query parameters; use `{allow: [...]}` or `{deny: [...]}` for filtering |
| `dataCollection.genAI` | `object` | See below | Control AI input/output recording |

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 dataCollection reference table in SKILL.md omits the httpBodies option, even though it's documented elsewhere in the file and is a key PII control feature.
Severity: MEDIUM

Suggested Fix

Add a row to the dataCollection reference table for the httpBodies option, similar to the one present in the browser SDK's SKILL.md. The row should specify its type, default value (["incomingRequest", "outgoingRequest", "incomingResponse", "outgoingResponse"]), and a description of its purpose.

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-nestjs-sdk/SKILL.md#L506-L511

Potential issue: The reference table for the `dataCollection` option in the NestJS SDK
documentation (`SKILL.md`) is missing an entry for `dataCollection.httpBodies`. This
option is referenced in commented-out code examples and is explicitly documented in the
defaults section below the table. This omission means developers relying on the
reference table will be unaware of the primary mechanism for controlling HTTP body
collection, which is a significant feature for managing personally identifiable
information (PII).

release: process.env.SENTRY_RELEASE,
sendDefaultPii: true,

// Data collection (SDK ≥ 10.57.0 — replaces deprecated sendDefaultPii)

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 NestJS SKILL.md incorrectly documents the minimum SDK version for dataCollection as 10.57.0 instead of the correct 10.54.0, causing user confusion.
Severity: MEDIUM

Suggested Fix

Update the minimum SDK version for dataCollection in the NestJS SKILL.md from 10.57.0 to 10.54.0 in all relevant places (e.g., the section heading and code example comments) to match the actual release version and other documentation.

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-nestjs-sdk/SKILL.md#L163

Potential issue: The NestJS `SKILL.md` documentation specifies that the `dataCollection`
feature requires SDK version `≥ 10.57.0`. This contradicts the PR description and the
browser SDK documentation, which both state the feature was introduced in `v10.54.0`.
This inconsistency will cause developers using SDK versions between 10.54.0 and 10.56.x
to incorrectly believe they cannot use the `dataCollection` feature.

| `environment` | `string` | `"production"` | e.g., `"staging"`; env: `SENTRY_ENVIRONMENT` |
| `release` | `string` | — | e.g., `"myapp@1.0.0"`; env: `SENTRY_RELEASE` |
| `dataCollection` | `object` | See below | Controls what data the SDK collects (SDK ≥ 10.57.0) |
| `dataCollection.userInfo` | `boolean` | `true` | Include IP addresses and user context |

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 for dataCollection.userInfo in the NestJS SKILL.md states a default of true, contradicting the browser SDK's documentation which states false.
Severity: HIGH

Suggested Fix

Verify the actual default value of dataCollection.userInfo in the SDK. Update the NestJS SKILL.md documentation to reflect the correct default value, ensuring it is consistent with the browser SDK documentation and the SDK's behavior to avoid confusion regarding PII collection.

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-nestjs-sdk/SKILL.md#L507

Potential issue: The NestJS `SKILL.md` documents the default value for
`dataCollection.userInfo` as `true`, which directly contradicts the browser SDK
documentation where the default is `false`. If the actual default is `false` (consistent
with the historical behavior of `sendDefaultPii: false`), this documentation error could
lead developers to either unknowingly fail to collect user data or mistakenly believe no
action is needed for privacy compliance, creating a risk related to PII handling.

@chargome
chargome merged commit 7b52de3 into main Jun 16, 2026
13 checks passed
@chargome
chargome deleted the skill-drift/sentry-nestjs-sdk-skill-drift-update-sentry-nestjs-sdk-doc-1780325425 branch June 16, 2026 14:31
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.

2 participants