Search code examples
javascriptsentryraven

How can I initialize new Sentry instance after init?


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 ?


Solution

  • It requires config object, not dsn itself.

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