sentry-javascript icon indicating copy to clipboard operation
sentry-javascript copied to clipboard

Capture exceptions for multiple projects in Unified Browser SDK

Open sahilanguralla opened this issue 7 years ago • 2 comments

  • [x] Review the documentation: https://docs.sentry.io/
  • [x] Search for existing issues: https://github.com/getsentry/sentry-javascript/issues
  • [x] Use the latest release: https://github.com/getsentry/sentry-javascript/releases

Package + Version

  • [x] @sentry/browser
  • [ ] @sentry/node
  • [ ] raven-js
  • [ ] raven-node (raven for node)
  • [ ] other:

Version:

4.4.1

Description

I have two bundles getting loaded in the same web application. Both are separately maintained and versioned. I also want to track errors separately. Can I enclose the code execution in two different Sentry instances, so that exceptions for both bundles are logged under respective projects in sentry?

In raven-js, there was some facility like this:

Raven.context(function () {
    myCode();
});

sahilanguralla avatar Feb 14 '19 13:02 sahilanguralla

@sahilanguralla yes, you can :)

Here are the docs for your usage https://docs.sentry.io/platforms/javascript/advance-settings/#using-a-client-directly

Cheers!

kamilogorek avatar Feb 14 '19 15:02 kamilogorek

The above link seems to be broken, here is a working one: https://docs.sentry.io/platforms/javascript/troubleshooting/#using-a-client-directly

aronlr avatar Dec 09 '20 14:12 aronlr