Skip to content

Commit fffa932

Browse files
authored
feat(core): Deprecate Hub.shouldSendDefaultPii (#10062)
Deprecates the unnecessary `Hub. shouldSendDefaultPii` method which can be easily replaced by accessing client options directly.
1 parent 118b5c7 commit fffa932

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

MIGRATION.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ You can [read more about the new performance APIs here](./docs/v8-new-performanc
2121

2222
## Deprecate `Sentry.lastEventId()` and `hub.lastEventId()`
2323

24-
`Sentry.lastEventId()` sometimes causes race conditons, so we are deprecating it in favour of the `beforeSend` callback.
24+
`Sentry.lastEventId()` sometimes causes race conditions, so we are deprecating it in favour of the `beforeSend` callback.
2525

2626
```js
2727
// Before
@@ -48,6 +48,12 @@ Sentry.init({
4848
});
4949
```
5050

51+
## Deprecated fields on `Hub`
52+
53+
In v8, the Hub class will be removed. The following methods are therefore deprecated:
54+
55+
- `hub.shouldSendDefaultPii()`: Access Sentry client option via `Sentry.getClient().getOptions().sendDefaultPii` instead
56+
5157
## Deprecated fields on `Span` and `Transaction`
5258

5359
In v8, the Span class is heavily reworked. The following properties & methods are thus deprecated:

packages/core/src/hub.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,9 @@ Sentry.init({...});
548548
/**
549549
* Returns if default PII should be sent to Sentry and propagated in ourgoing requests
550550
* when Tracing is used.
551+
*
552+
* @deprecated Use top-level `getClient().getOptions().sendDefaultPii` instead. This function
553+
* only unnecessarily increased API surface but only wrapped accessing the option.
551554
*/
552555
public shouldSendDefaultPii(): boolean {
553556
const client = this.getClient();

packages/types/src/hub.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,9 @@ export interface Hub {
247247
/**
248248
* Returns if default PII should be sent to Sentry and propagated in ourgoing requests
249249
* when Tracing is used.
250+
*
251+
* @deprecated Use top-level `getClient().getOptions().sendDefaultPii` instead. This function
252+
* only unnecessarily increased API surface but only wrapped accessing the option.
250253
*/
251254
shouldSendDefaultPii(): boolean;
252255
}

0 commit comments

Comments
 (0)