Skip to content
Open
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
39 changes: 21 additions & 18 deletions develop-docs/sdk/foundations/client/data-collection/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@
title: Data Collection
description: Configuration for what data SDKs collect by default, including technical context, PII, and sensitive data.
spec_id: sdk/foundations/client/data-collection
spec_version: 0.2.0
spec_status: draft
spec_version: 1.0.0
spec_status: candidate
spec_depends_on:
- id: sdk/foundations/client
version: ">=1.0.0"
spec_changelog:
- version: 1.0.0
date: 2026-06-05
summary: Promoted to candidate following the initial JavaScript SDK implementation.
- version: 0.2.0
date: 2026-06-05
summary: Collect more data by default. `userInfo` now defaults to `true` and `httpBodies` now defaults to all valid body types. Both can be disabled to opt out.
Expand Down Expand Up @@ -38,7 +41,7 @@ Related specs:

## Concepts

<SpecSection id="data-sensitivity-levels" status="draft" since="0.1.0">
<SpecSection id="data-sensitivity-levels" status="candidate" since="1.0.0">

### Data Sensitivity Levels

Expand Down Expand Up @@ -83,7 +86,7 @@ For the canonical list of terms used to detect sensitive values at collection ti

## Behavior

<SpecSection id="configuration-surface" status="draft" since="0.1.0">
<SpecSection id="configuration-surface" status="candidate" since="1.0.0">

### Configuration Requirements

Expand All @@ -93,7 +96,7 @@ SDKs **MUST** support at least the `userInfo` option, key-value collection modes

</SpecSection>

<SpecSection id="collection-defaults" status="draft" since="0.1.0">
<SpecSection id="collection-defaults" status="candidate" since="1.0.0">

### Default Collection Behavior

Expand All @@ -105,7 +108,7 @@ The three sensitivity levels determine whether data is collected by default:

</SpecSection>

<SpecSection id="sensitive-denylist" status="draft" since="0.1.0">
<SpecSection id="sensitive-denylist" status="candidate" since="1.0.0">

### Sensitive Denylist

Expand Down Expand Up @@ -196,7 +199,7 @@ No built-in option scrubs **keys**; users who need to hide header or cookie name

</SpecSection>

<SpecSection id="integration-overrides" status="draft" since="0.1.0">
<SpecSection id="integration-overrides" status="candidate" since="1.0.0">

### Integration-Level Overrides

Expand All @@ -214,7 +217,7 @@ corresponding global `dataCollection` values for the data that integration colle

</SpecSection>

<SpecSection id="user-set-data-scrubbing" status="draft" since="0.1.0">
<SpecSection id="user-set-data-scrubbing" status="candidate" since="1.0.0">

### User-Set Data and Scrubbing

Expand Down Expand Up @@ -242,7 +245,7 @@ This means if a user calls `Sentry.setUser({ email: "jane@example.com" })`, that

## Public API

<SpecSection id="option-types" status="draft" since="0.1.0">
<SpecSection id="option-types" status="candidate" since="1.0.0">

### Option Types

Expand Down Expand Up @@ -478,7 +481,7 @@ public enum BodyType {

</SpecSection>

<SpecSection id="datacollection-options" status="draft" since="0.1.0">
<SpecSection id="datacollection-options" status="candidate" since="1.0.0">

### `dataCollection` Options

Expand Down Expand Up @@ -512,14 +515,14 @@ init({

| Key | Option Type | Default | Since | Description |
|-----|-------------|---------|-------|-------------|
| `userInfo` | Boolean | `true` | 0.1.0 | Automatically populate `user.*` fields (`user.id`, `user.email`, `user.username`, `user.ip_address`) from auto-instrumentation (e.g., inferring `user.ip_address` from an incoming HTTP request, or deriving user identity from framework session/auth context). Does **not** gate data explicitly set via `Sentry.setUser()`, which is always attached (see [User-Set Data and Scrubbing](#user-set-data-scrubbing)). Does not affect any other data category. Default changed to `true` in 0.2.0. |
| `cookies` | Key-value collection | `{ mode: "denyList" }` | 0.1.0 | Collect cookies. All key names are always included; the SDK scrubs values for keys matching the sensitive denylist or custom allow/deny terms. |
| `httpHeaders` | `{ request?, response? }` | Both `{ mode: "denyList" }` | 0.1.0 | Collect HTTP headers. Configure request and response independently using key-value collection modes. All key names are always included. |
| `httpBodies` | `string[]` (body types) | all valid body types | 0.1.0 | List of body types to collect. Omitted = all body types valid for the platform; empty array (`[]`) = off. Valid values: `"incomingRequest"`, `"outgoingRequest"`, `"incomingResponse"`, `"outgoingResponse"`. Default changed from `[]` (off) to all valid body types in 0.2.0. |
| `queryParams` | Key-value collection | `{ mode: "denyList" }` | 0.1.0 | Collect URL query parameters. All key names are always included; the SDK scrubs values for keys matching the sensitive denylist or custom allow/deny terms. |
| `genAI` | `{ inputs?, outputs? }` | Both `true` | 0.1.0 | For `inputs`: Include the content of generative AI inputs (e.g. prompt text, tool call arguments). <br /><br /> For `outputs`: Include the content of generative AI outputs (e.g. completion text, tool call results). Metadata such as model name and token counts is always collected regardless of these settings. |
| `stackFrameVariables` | Boolean | `true` | 0.1.0 | Include local variable values captured within stack frames. |
| `frameContextLines` | Integer (`Boolean` fallback) | `5` (`true`) | 0.1.0 | Number of source code lines to include above and below each stack frame. <br/> **`Boolean` fallback:** Not all platforms support integer configuration values. SDKs **MAY** accept a boolean, where `true` is equivalent to the platform default (typically `5`) and `false` is equivalent to `0` (no context lines). SDKs **SHOULD** prefer accepting an integer when their platform supports it. |
| `userInfo` | Boolean | `true` | 1.0.0 | Automatically populate `user.*` fields (`user.id`, `user.email`, `user.username`, `user.ip_address`) from auto-instrumentation (e.g., inferring `user.ip_address` from an incoming HTTP request, or deriving user identity from framework session/auth context). Does **not** gate data explicitly set via `Sentry.setUser()`, which is always attached (see [User-Set Data and Scrubbing](#user-set-data-scrubbing)). Does not affect any other data category. |
| `cookies` | Key-value collection | `{ mode: "denyList" }` | 1.0.0 | Collect cookies. All key names are always included; the SDK scrubs values for keys matching the sensitive denylist or custom allow/deny terms. |
| `httpHeaders` | `{ request?, response? }` | Both `{ mode: "denyList" }` | 1.0.0 | Collect HTTP headers. Configure request and response independently using key-value collection modes. All key names are always included. |
| `httpBodies` | `string[]` (body types) | all valid body types | 1.0.0 | List of body types to collect. Omitted = all body types valid for the platform; empty array (`[]`) = off. Valid values: `"incomingRequest"`, `"outgoingRequest"`, `"incomingResponse"`, `"outgoingResponse"`. |
| `queryParams` | Key-value collection | `{ mode: "denyList" }` | 1.0.0 | Collect URL query parameters. All key names are always included; the SDK scrubs values for keys matching the sensitive denylist or custom allow/deny terms. |
| `genAI` | `{ inputs?, outputs? }` | Both `true` | 1.0.0 | For `inputs`: Include the content of generative AI inputs (e.g. prompt text, tool call arguments). <br /><br /> For `outputs`: Include the content of generative AI outputs (e.g. completion text, tool call results). Metadata such as model name and token counts is always collected regardless of these settings. |
| `stackFrameVariables` | Boolean | `true` | 1.0.0 | Include local variable values captured within stack frames. |
| `frameContextLines` | Integer (`Boolean` fallback) | `5` (`true`) | 1.0.0 | Number of source code lines to include above and below each stack frame. <br/> **`Boolean` fallback:** Not all platforms support integer configuration values. SDKs **MAY** accept a boolean, where `true` is equivalent to the platform default (typically `5`) and `false` is equivalent to `0` (no context lines). SDKs **SHOULD** prefer accepting an integer when their platform supports it. |
Comment on lines +518 to +525
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 since version for several data collection options is incorrectly set to 1.0.0. It should reflect their original introduction version, 0.1.0, to maintain accurate historical context.
Severity: LOW

Suggested Fix

Revert the since values for the affected options to their original introduction versions as documented in the changelog (e.g., 0.1.0). Restore any removed historical context from the descriptions, such as the note about the userInfo default changing in 0.2.0.

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: develop-docs/sdk/foundations/client/data-collection/index.mdx#L518-L525

Potential issue: The `since` field for several data collection options, including
`userInfo`, `cookies`, and `httpHeaders`, has been updated to `1.0.0`. However, the
changelog confirms these options were introduced in version `0.1.0`. The established
convention in other specifications is that the `since` field denotes the version in
which a feature first appeared. This change misrepresents the history of these options,
which can mislead SDK implementors and affect compatibility decisions. Additionally,
historical context, such as the `userInfo` default changing in version `0.2.0`, has been
removed, further erasing the spec's evolution.

Also affects:

  • develop-docs/sdk/foundations/client/data-collection/index.mdx:44~44
  • develop-docs/sdk/foundations/client/data-collection/index.mdx:89~89
  • develop-docs/sdk/foundations/client/data-collection/index.mdx:99~99
  • develop-docs/sdk/foundations/client/data-collection/index.mdx:111~111
  • develop-docs/sdk/foundations/client/data-collection/index.mdx:202~202
  • develop-docs/sdk/foundations/client/data-collection/index.mdx:220~220
  • develop-docs/sdk/foundations/client/data-collection/index.mdx:248~248
  • develop-docs/sdk/foundations/client/data-collection/index.mdx:484~484

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




Expand Down
Loading