diff --git a/MIGRATION.md b/MIGRATION.md index 99e9e3023732..eeb4b0071f2f 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -10,7 +10,7 @@ This will let you select which updates to run, and automatically update your cod ## Deprecate `Sentry.lastEventId()` and `hub.lastEventId()` -`Sentry.lastEventId()` sometimes causes race conditons, so we are deprecating it in favour of the `beforeSend` callback. +`Sentry.lastEventId()` sometimes causes race conditions, so we are deprecating it in favour of the `beforeSend` callback. ```js // Before @@ -37,6 +37,12 @@ Sentry.init({ }); ``` +## Deprecated fields on `Hub` + +In v8, the Hub class will be removed. The following methods are therefore deprecated: + +- `hub.shouldSendDefaultPii()`: Access Sentry client option via `Sentry.getClient().getOptions().sendDefaultPii` instead + ## Deprecated fields on `Span` and `Transaction` In v8, the Span class is heavily reworked. The following properties & methods are thus deprecated: diff --git a/packages/core/src/hub.ts b/packages/core/src/hub.ts index 07f1310f94a2..00bbce18a8c9 100644 --- a/packages/core/src/hub.ts +++ b/packages/core/src/hub.ts @@ -532,6 +532,9 @@ Sentry.init({...}); /** * Returns if default PII should be sent to Sentry and propagated in ourgoing requests * when Tracing is used. + * + * @deprecated Use top-level `getClient().getOptions().sendDefaultPii` instead. This function + * only unnecessarily increased API surface but only wrapped accessing the option. */ public shouldSendDefaultPii(): boolean { const client = this.getClient(); diff --git a/packages/types/src/hub.ts b/packages/types/src/hub.ts index f5ec2ea4fbb2..167938a74cbb 100644 --- a/packages/types/src/hub.ts +++ b/packages/types/src/hub.ts @@ -245,6 +245,9 @@ export interface Hub { /** * Returns if default PII should be sent to Sentry and propagated in ourgoing requests * when Tracing is used. + * + * @deprecated Use top-level `getClient().getOptions().sendDefaultPii` instead. This function + * only unnecessarily increased API surface but only wrapped accessing the option. */ shouldSendDefaultPii(): boolean; }