Disabling automatic error capturing in JavaScript SDK

I tried everything and none of them work. I either have all of the integrations or none of them! There’s no way to disable a single integration.

So I came up with this workaround:

const hub = new Hub(); // cause our project is embedded in another project
new BrowserClient({
    dsn: '__DSN__',
    beforeSend(event: Event, hint?: EventHint): PromiseLike<Event | null> | Event | null {
        if (!event.extra?.myFlag) return null;
        return event;


hub.withScope(scope => {
    scope.setExtra('myFlag', true);
    hub.captureMessage(message, severity);

I wish sentry could pay more attention on resolving such bugs and github’s open issues