How can I initialize new Sentry instance after init?

2.3k views Asked by At

my project contains Raven SDK (raven-js) at the moment in order to report errors to Sentry.

When I want to initialize a new instance for reporting another Sentry project (another frame), I use:

const newInstance = new raven.Client()
...
newInstance.config(dsn).install()

What is the way to get a new instance with @sentry/browser library?

Tried to:

new Sentry.BrowserClient()

But it says it needs dsn to pass.

Is there any way to get a new instance without setting its dsn ?

1

There are 1 answers

2
Kamil Ogórek On BEST ANSWER

It requires config object, not dsn itself.

const client = new Sentry.BrowserClient({});