From 9a7547fddbb718093eaa98fc4bbd3398dd336e64 Mon Sep 17 00:00:00 2001 From: Sigrid Huemer <32902192+s1gr1d@users.noreply.github.com> Date: Wed, 14 Aug 2024 18:02:41 +0200 Subject: [PATCH] fix(js): Delete hub occurrences (#11068) * fix(js): Delete hub occurrences * Apply suggestions from code review Co-authored-by: Liza Mock --------- Co-authored-by: Liza Mock --- .../common/best-practices/multiple-sentry-instances.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/platforms/javascript/common/best-practices/multiple-sentry-instances.mdx b/docs/platforms/javascript/common/best-practices/multiple-sentry-instances.mdx index 541b1c319cbd2..7fc7f87c2f52f 100644 --- a/docs/platforms/javascript/common/best-practices/multiple-sentry-instances.mdx +++ b/docs/platforms/javascript/common/best-practices/multiple-sentry-instances.mdx @@ -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. @@ -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/`; }