Skip to content

Commit ec85df1

Browse files
committed
more clarification
1 parent 3874074 commit ec85df1

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

docs/platforms/javascript/common/apis.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ If you use a bundler, using e.g. `const { replayIntegration } = await import('@s
134134
Returns the current scope. See{" "}
135135
<PlatformLink to="/enriching-events/scopes/">Scopes</PlatformLink> for more
136136
information.
137+
138+
Note that in most cases you should not use this API, but instead use `withScope` to generate and access a local scope. There are no guarantees about the consistency of `getCurrentScope` across different parts of your application, as scope forking may happen under the hood at various points.
137139
</SdkApi>
138140

139141
<SdkApi

docs/platforms/javascript/common/enriching-events/scopes/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ Sentry.withScope((scope) => {
7777
Sentry.captureException(new Error("my other error"));
7878
```
7979

80-
You can access the current scope via `Sentry.getCurrentScope()`, but usually you should use `Sentry.withScope()` to interact with local scopes instead.
80+
You can access the current scope via `Sentry.getCurrentScope()`, but in most cases you should not use this API, but instead use `withScope` to generate and access a local scope. There are no guarantees about the consistency of `getCurrentScope` across different parts of your application, as scope forking may happen under the hood at various points.
8181

8282
## How Scope Data is Applied to Events
8383

0 commit comments

Comments
 (0)