Skip to content

BrowserClientOptions type should include BrowserClientReplayOptions #8857

Closed
@Sc4ramouche

Description

@Sc4ramouche

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/react

SDK Version

7.64.0

Framework Version

18.2.0

Link to Sentry event

No response

SDK Setup

const browserClient = new BrowserClient({
    enabled,
    ...clientOptions,
    ignoreErrors: [...DEFAULT_IGNORED_ERRORS, ignoredErrorRegex, ...(clientOptions.ignoreErrors || [])],
    environment,
    transport: makeFetchTransport,
    stackParser: defaultStackParser,
    integrations: [
      ...defaultIntegrations,
      new Integrations.BrowserTracing(),
      new Replay({ maskAllText: true, blockAllMedia: true }),
    ],
    replaysSessionSampleRate: 0,
    replaysOnErrorSampleRate: 0.1,
    beforeSend: filterSentryEvents,
} as ClientOptions & BrowserClientReplayOptions);

Steps to Reproduce

This issue is about types exposed by Sentry packages.

At the very last line of the setup provided above, we had to specify BrowserClientReplayOptions manually for the BrowserClient. Otherwise, TypeScript would report that passing replaysSessionSampleRate and replaysOnErrorSampleRate is not correct.

Expected Result

BrowserClientOptions type should should include BrowserClientReplayOptions.

Actual Result

TypeScript reports incorrect options passed to initialise BrowserClient.

Please let me know if I'm missing something here, or additional info is needed. Thank you!

Metadata

Metadata

Assignees

Labels

Package: reactIssues related to the Sentry React SDK

Type

No type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions