Skip to content
Open
Show file tree
Hide file tree
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
7 changes: 3 additions & 4 deletions docs/platforms/javascript/common/configuration/apis.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -417,14 +417,13 @@ Sentry.setContext("character", {
<Expandable title="Capturing User IP-Addresses">
<PlatformCategorySection supported={['server', 'serverless']}>
On the server, the IP address will be inferred from the incoming HTTP request, if available.
This is automatically done if you have configured `sendDefaultPii: true` in your <PlatformLink to="/configuration/options/#sendDefaultPii">SDK configuration</PlatformLink>.
This is automatically done if you have configured <PlatformLink to="/configuration/options/#dataCollection">`dataCollection: { userInfo: true }`</PlatformLink> (or the deprecated `sendDefaultPii: true`) in your SDK configuration.
</PlatformCategorySection>

<PlatformCategorySection supported={["browser"]}>
On the browser, if the users' `ip_address` is set to `"{{ auto }}"`, Sentry
will infer the IP address from the connection between your app and Sentrys'
server. `{{auto}}` is automatically set if you have configured `sendDefaultPii:
true` in your <PlatformLink to="/configuration/options/#sendDefaultPii">SDK configuration</PlatformLink>.
will infer the IP address from the connection between your app and Sentry's
server. `{{auto}}` is automatically set if you have configured <PlatformLink to="/configuration/options/#dataCollection">`dataCollection: { userInfo: true }`</PlatformLink> (or the deprecated `sendDefaultPii: true`) in your SDK configuration.
</PlatformCategorySection>

To ensure your users' IP addresses are never stored in your event data, you can go to your project settings, click on "Security & Privacy", and enable "Prevent Storing of IP Addresses" or use Sentry's [server-side data scrubbing](/security-legal-pii/scrubbing/) to remove `$user.ip_address`. Adding such a rule ultimately overrules any other logic.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,15 @@ _Type: `boolean` (optional)_

Records inputs to Anthropic SDK calls (such as prompts and messages).

Defaults to `true` if `sendDefaultPii` is `true`.
Defaults to `true` if `dataCollection.genAI.inputs` is `true` (which is the default when using `dataCollection`), or if the deprecated `sendDefaultPii` is `true`.

#### `recordOutputs`

_Type: `boolean` (optional)_

Records outputs from Anthropic SDK calls (such as generated text and responses).

Defaults to `true` if `sendDefaultPii` is `true`.
Defaults to `true` if `dataCollection.genAI.outputs` is `true` (which is the default when using `dataCollection`), or if the deprecated `sendDefaultPii` is `true`.

**Usage**

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,15 @@ _Type: `boolean` (optional)_

Records inputs to Google Gen AI SDK calls (such as prompts and messages).

Defaults to `true` if `sendDefaultPii` is `true`.
Defaults to `true` if `dataCollection.genAI.inputs` is `true` (which is the default when using `dataCollection`), or if the deprecated `sendDefaultPii` is `true`.

#### `recordOutputs`

_Type: `boolean` (optional)_

Records outputs from Google Gen AI SDK calls (such as generated text and responses).

Defaults to `true` if `sendDefaultPii` is `true`.
Defaults to `true` if `dataCollection.genAI.outputs` is `true` (which is the default when using `dataCollection`), or if the deprecated `sendDefaultPii` is `true`.

**Usage**

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ _Import name: `Sentry.httpClientIntegration`_

This integration captures errors on failed requests from Fetch and XHR and attaches request and response information.

By default, error events don't contain header or cookie data. You can change this behavior by setting `sendDefaultPii: true` in your root `Sentry.init({})` config.
By default, error events don't contain header or cookie data. You can control this with the <PlatformLink to="/configuration/options/#dataCollection">`dataCollection`</PlatformLink> option. Set `dataCollection: { httpHeaders: true, cookies: true }` in your root `Sentry.init({})` config. The deprecated `sendDefaultPii: true` option also enables this behavior.

<PlatformContent includePath="configuration/http-client" />

Expand All @@ -56,13 +56,13 @@ _Type: `(string|RegExp)[]`_
An array of request targets that should be considered, for example `['http://example.com/api/test']` would interpret any request to this URL as a failure. This array can contain Regexes, strings, or a combination of the two.
Default: `[/.*/]`

### `sendDefaultPii`

_Type: `boolean`_
### `dataCollection`

<Alert level="warning">
This option has to be specified on the root Sentry.init options, not the
integration options!
This option has to be specified on the root `Sentry.init` config, not on the
integration!
</Alert>

This option is required for capturing headers and cookies.
Controls header and cookie collection for this integration. Use `dataCollection: { httpHeaders: true, cookies: true }` in `Sentry.init` to capture headers and cookies on failed requests. See the <PlatformLink to="/configuration/options/#dataCollection">`dataCollection` option</PlatformLink> for the full set of controls including allow/deny lists.

The deprecated `sendDefaultPii: true` option also enables this behavior.
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,15 @@ _Type: `boolean` (optional)_

Records inputs to LangChain operations (such as prompts and messages).

Defaults to `true` if `sendDefaultPii` is `true`.
Defaults to `true` if `dataCollection.genAI.inputs` is `true` (which is the default when using `dataCollection`), or if the deprecated `sendDefaultPii` is `true`.

#### `recordOutputs`

_Type: `boolean` (optional)_

Records outputs from LangChain operations (such as generated text and responses).

Defaults to `true` if `sendDefaultPii` is `true`.
Defaults to `true` if `dataCollection.genAI.outputs` is `true` (which is the default when using `dataCollection`), or if the deprecated `sendDefaultPii` is `true`.

**Usage**

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,15 @@ _Type: `boolean` (optional)_

Records inputs to LangGraph operations (such as messages and state data passed to the graph).

Defaults to `true` if `sendDefaultPii` is `true`.
Defaults to `true` if `dataCollection.genAI.inputs` is `true` (which is the default when using `dataCollection`), or if the deprecated `sendDefaultPii` is `true`.

#### `recordOutputs`

_Type: `boolean` (optional)_

Records outputs from LangGraph operations (such as generated responses, agent outputs, and final state).

Defaults to `true` if `sendDefaultPii` is `true`.
Defaults to `true` if `dataCollection.genAI.outputs` is `true` (which is the default when using `dataCollection`), or if the deprecated `sendDefaultPii` is `true`.

**Usage**

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,15 @@ _Type: `boolean` (optional)_

Records inputs to OpenAI SDK calls (such as prompts and messages).

Defaults to `true` if `sendDefaultPii` is `true`.
Defaults to `true` if `dataCollection.genAI.inputs` is `true` (which is the default when using `dataCollection`), or if the deprecated `sendDefaultPii` is `true`.

#### `recordOutputs`

_Type: `boolean` (optional)_

Records outputs from OpenAI SDK calls (such as generated text and responses).

Defaults to `true` if `sendDefaultPii` is `true`.
Defaults to `true` if `dataCollection.genAI.outputs` is `true` (which is the default when using `dataCollection`), or if the deprecated `sendDefaultPii` is `true`.

**Usage**

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ _Type: `boolean`_

Records inputs to the `ai` function call.

Defaults to `true` if `sendDefaultPii` is `true` or if you explicitly set `experimental_telemetry.isEnabled` to `true` in your `ai` function callsites.
Defaults to `true` if `dataCollection.genAI.inputs` is `true` (which is the default when using `dataCollection`), if the deprecated `sendDefaultPii` is `true`, or if you explicitly set `experimental_telemetry.isEnabled` to `true` in your `ai` function callsites.

```javascript
Sentry.init({
Expand All @@ -151,7 +151,7 @@ _Type: `boolean`_

Records outputs to the `ai` function call.

Defaults to `true` if `sendDefaultPii` is `true` or if you explicitly set `experimental_telemetry.isEnabled` to `true` in your `ai` function callsites.
Defaults to `true` if `dataCollection.genAI.outputs` is `true` (which is the default when using `dataCollection`), if the deprecated `sendDefaultPii` is `true`, or if you explicitly set `experimental_telemetry.isEnabled` to `true` in your `ai` function callsites.

```javascript
Sentry.init({
Expand Down
39 changes: 39 additions & 0 deletions docs/platforms/javascript/common/configuration/options.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,47 @@ Set to `false` to opt out, for example, when using a custom `tunnel` or when run

<SdkOption name="sendDefaultPii" type='boolean' defaultValue='false'>

<Alert level="warning">
`sendDefaultPii` is deprecated and will be removed in the next major version
(v11). Use [`dataCollection`](#dataCollection) instead.
</Alert>

Set this option to `true` to send default PII data to Sentry. Among other things, enabling this will enable automatic IP address collection on events.

For backwards compatibility, `sendDefaultPii: true` behaves like enabling all [`dataCollection`](#dataCollection) categories.
If both options are set, `dataCollection` takes precedence.

</SdkOption>

<SdkOption name="dataCollection" type='DataCollection' availableSince="10.54.0">

Controls which categories of data the SDK collects automatically. All fields are optional and default to collecting rich debugging context,
while scrubbing values whose keys match Sentry's built-in sensitive denylist (`auth`, `token`, `password`, and similar).
User identity fields (`user.*`) and HTTP bodies are **not** collected by default.

For more on what data Sentry collects and how to control it, see <PlatformLink to="/data-management/">Data Management</PlatformLink>.

| Key | Type | Default | Description |
| --------------------- | ---------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------- |
| `userInfo` | `boolean` | `false` | Populate `user.*` fields (`id`, `email`, `username`, `ip_address`) from instrumentation. |
| `cookies` | `CollectBehavior` | `true` | Collect cookies. |
| `httpHeaders` | `{ request?, response? }` | both `true` | Collect HTTP request and response headers. |
| `httpBodies` | `HttpBodyCollectionTarget[]` | `[]` | Body types to collect: `"incomingRequest"`, `"outgoingRequest"`, `"incomingResponse"`, `"outgoingResponse"`. |
| `queryParams` | `CollectBehavior` | `true` | Collect URL query parameters. |
| `genAI` | `{ inputs?, outputs? }` | both `true` | Collect generative AI input/output content. Metadata is always collected. |
| `stackFrameVariables` | `boolean` | `true` | Capture local variable values in stack frames. |
| `frameContextLines` | `number` | `5` | Source code lines captured around each stack frame. |

The `cookies`, `httpHeaders`, and `queryParams` categories accept a `CollectBehavior` value:
Comment thread
sentry[bot] marked this conversation as resolved.

```typescript
type CollectBehavior = boolean | { allow: string[] } | { deny: string[] };
// true → collect all (sensitive denylist still scrubs values)
// false → collect nothing
// { deny: [] } → collect all, extending the denylist with the given terms
// { allow: [] } → only the listed keys send their real value
```

</SdkOption>

<SdkOption name="maxBreadcrumbs" type='number' defaultValue="100">
Expand Down
Loading
Loading