From 087c867ba816a3c41553964d32a2562e39e80073 Mon Sep 17 00:00:00 2001 From: s1gr1d Date: Tue, 11 Jun 2024 09:45:44 +0200 Subject: [PATCH 1/3] docs(scope): Add small clarifications on current scope --- .../javascript/common/enriching-events/scopes/index.mdx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/platforms/javascript/common/enriching-events/scopes/index.mdx b/docs/platforms/javascript/common/enriching-events/scopes/index.mdx index c28f76688ddb2..9664a96db1799 100644 --- a/docs/platforms/javascript/common/enriching-events/scopes/index.mdx +++ b/docs/platforms/javascript/common/enriching-events/scopes/index.mdx @@ -102,7 +102,7 @@ Sentry.captureException(new Error("my error")); ## Configuring the Scope -There are two main ways to interact with the scope. You can access the current scope via `Sentry.getCurrentScope()` and use setters on the resulting scope, or you can use global methods like `Sentry.setTag()` directly, which will set on the respective scope under the hood. +There are two main ways to interact with the scope. You can access the current scope via `Sentry.getCurrentScope()` and use setters on the resulting scope, or you can use global methods like `Sentry.setTag()` directly, which will set on the respective scope under the hood (which will be the current active isolation scope). You'll first need to import the SDK, as usual: @@ -111,6 +111,7 @@ You'll first need to import the SDK, as usual: You can, for instance, add custom tags or inform Sentry about the currently authenticated user. ```javascript +/// Usually, you don't want to write on the current scope, so use with care! const scope = Sentry.getCurrentScope(); scope.setTag("my-tag", "my value"); scope.setUser({ @@ -118,7 +119,7 @@ scope.setUser({ email: "john.doe@example.com", }); -// Or use the global methods +// Or use the global methods (which will set data on the currently active isolation scope): Sentry.setTag("my-tag", "my value"); Sentry.setUser({ id: 42, From 5f0d11a4f641633413182cf8dcfa5c84a10388e5 Mon Sep 17 00:00:00 2001 From: Sigrid Huemer <32902192+s1gr1d@users.noreply.github.com> Date: Wed, 12 Jun 2024 15:12:21 +0200 Subject: [PATCH 2/3] Update docs/platforms/javascript/common/enriching-events/scopes/index.mdx Co-authored-by: Francesco Novy --- .../javascript/common/enriching-events/scopes/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/platforms/javascript/common/enriching-events/scopes/index.mdx b/docs/platforms/javascript/common/enriching-events/scopes/index.mdx index 9664a96db1799..8b3d5b2ec7c18 100644 --- a/docs/platforms/javascript/common/enriching-events/scopes/index.mdx +++ b/docs/platforms/javascript/common/enriching-events/scopes/index.mdx @@ -102,7 +102,7 @@ Sentry.captureException(new Error("my error")); ## Configuring the Scope -There are two main ways to interact with the scope. You can access the current scope via `Sentry.getCurrentScope()` and use setters on the resulting scope, or you can use global methods like `Sentry.setTag()` directly, which will set on the respective scope under the hood (which will be the current active isolation scope). +There are two main ways to interact with the scope. You can access the current scope via `Sentry.getCurrentScope()` and use setters on the resulting scope, or you can use global methods like `Sentry.setTag()` directly, which will set on the respective scope under the hood (which will be the isolation scope). You'll first need to import the SDK, as usual: From 800e2bd29433c376769d6dd3c277cdf9c4f7bbb3 Mon Sep 17 00:00:00 2001 From: Sigrid Huemer <32902192+s1gr1d@users.noreply.github.com> Date: Wed, 12 Jun 2024 15:12:27 +0200 Subject: [PATCH 3/3] Update docs/platforms/javascript/common/enriching-events/scopes/index.mdx Co-authored-by: Francesco Novy --- .../javascript/common/enriching-events/scopes/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/platforms/javascript/common/enriching-events/scopes/index.mdx b/docs/platforms/javascript/common/enriching-events/scopes/index.mdx index 8b3d5b2ec7c18..aae983d2a98a0 100644 --- a/docs/platforms/javascript/common/enriching-events/scopes/index.mdx +++ b/docs/platforms/javascript/common/enriching-events/scopes/index.mdx @@ -119,7 +119,7 @@ scope.setUser({ email: "john.doe@example.com", }); -// Or use the global methods (which will set data on the currently active isolation scope): +// Or use the global methods (which will set data on the isolation scope): Sentry.setTag("my-tag", "my value"); Sentry.setUser({ id: 42,