Skip to content

Commit

Permalink
fix(js): Delete hub occurrences (#11068)
Browse files Browse the repository at this point in the history
* fix(js): Delete hub occurrences

* Apply suggestions from code review

Co-authored-by: Liza Mock <[email protected]>

---------

Co-authored-by: Liza Mock <[email protected]>
  • Loading branch information
s1gr1d and lizokm committed Aug 14, 2024
1 parent b480f67 commit 9a7547f
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ client.init(); // initializing has to be done after setting the client on the sc
scope.captureException(new Error("example"));
```

You can now customize the scope to your liking, without affecting other hubs/clients.
You can now customize the scope to your liking, without affecting other clients.

### Dealing with Integrations

Integrations are setup on the `Client`, if you need to deal with multiple clients and hubs you have to make sure to also do the integration handling correctly.
Integrations are set up on the `Client`. If you need to deal with multiple clients, you'll have to make sure the integration handling is set up correctly.

We do not recommend doing this if you are using Sentry in a browser extension or in similar scenarios.
If you can't avoid using global integrations (e.g. in a micro frontend application), here is a working example of how to use multiple clients with multiple scopes running global integrations.
Expand All @@ -91,7 +91,7 @@ function happyIntegration() {
setupOnce() {
Sentry.addEventProcessor((event) => {
const self = Sentry.getClient().getIntegration(HappyIntegration);
// Run the integration ONLY when it was installed on the current Hub
// Run the integration ONLY if it was installed on the current client
if (self) {
event.message = `\\o/ ${event.message} \\o/`;
}
Expand Down

0 comments on commit 9a7547f

Please sign in to comment.