Skip to content

React sentry events contains user's IP address by default #17351

@uiii

Description

@uiii

Environment

SaaS (https://sentry.io/)

Steps to Reproduce

  1. Sentry initialized like this:
// sentry.ts
import * as Sentry from "@sentry/react";

if (import.meta.env.VITE_SENTRY_DSN) {
	console.log("sentry init");
	Sentry.init({
		dsn: import.meta.env.VITE_SENTRY_DSN,
		environment: import.meta.env.VITE_SENTRY_ENV || "unknown",
		release: import.meta.env.VITE_SENTRY_RELEASE,
		integrations: [],
		normalizeDepth: 10,
	});
}

export { Sentry };
  1. And used like this:
// main.ts
...
import { Sentry } from "./sentry";

ReactDOM.createRoot(document.getElementById("root")!, {
	onCaughtError: Sentry.reactErrorHandler(),
	onRecoverableError: Sentry.reactErrorHandler(),
	onUncaughtError: Sentry.reactErrorHandler(),
}).render(
	<React.StrictMode>
		<ErrorBoundary FallbackComponent={ErrorContainer}>
			...
		</ErrorBoundary>
	</React.StrictMode>,
);

Expected Result

No user's IP address stored by default as mentioned in the docs: https://docs.sentry.io/platforms/javascript/guides/react/data-management/data-collected/

Image

Actual Result

In event's tags is this:

Image

Product Area

Issues

Link

No response

DSN

No response

Version

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions