Skip to content

Commit 1d64a06

Browse files
authored
fix(browser): Add replay and profiling options to BrowserClientOptions (#8921)
Add missing replay and profiling options to the `BrowserClientOptions` interface. Previously, we only exposed these types to `BrowserOptions`. This led to type errors for users who directly create a client, without using `Sentry.init` (as reported in #8857). While one would think that `BrowserClientOptions` is basically a superset of `BrowserOptions` (leaving aside `stackparser`, `integrations` and `transport`) this is in fact not the case, which IMO is the core problem here. `BrowserClientOptions` only inherits the base `Options` (which are shared between browser and node), in addition to transport options. However, changing this so that, `BrowserClientOptions` inherits from `BrowserOptions` is a breaking change, so I opted to just add the missing options to `BrowserClientOptions`.
1 parent 5fdaaa7 commit 1d64a06

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/browser/src/client.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ export type BrowserOptions = Options<BrowserTransportOptions> &
3030
* Configuration options for the Sentry Browser SDK Client class
3131
* @see BrowserClient for more information.
3232
*/
33-
export type BrowserClientOptions = ClientOptions<BrowserTransportOptions>;
33+
export type BrowserClientOptions = ClientOptions<BrowserTransportOptions> &
34+
BrowserClientReplayOptions &
35+
BrowserClientProfilingOptions;
3436

3537
/**
3638
* The Sentry Browser SDK Client.

0 commit comments

Comments
 (0)