Skip to content

feat: Add top level getCurrentScope() method #9800

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/astro/src/index.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export {
getHubFromCarrier,
getCurrentHub,
getClient,
getCurrentScope,
Hub,
makeMain,
Scope,
Expand Down
1 change: 1 addition & 0 deletions packages/browser/src/exports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export {
getHubFromCarrier,
getCurrentHub,
getClient,
getCurrentScope,
Hub,
lastEventId,
makeMain,
Expand Down
1 change: 1 addition & 0 deletions packages/bun/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export {
getHubFromCarrier,
getCurrentHub,
getClient,
getCurrentScope,
Hub,
lastEventId,
makeMain,
Expand Down
7 changes: 7 additions & 0 deletions packages/core/src/exports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -308,3 +308,10 @@ export function lastEventId(): string | undefined {
export function getClient<C extends Client>(): C | undefined {
return getCurrentHub().getClient<C>();
}

/**
* Get the currently active scope.
*/
export function getCurrentScope(): Scope {
return getCurrentHub().getScope();
}
1 change: 1 addition & 0 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export {
setUser,
withScope,
getClient,
getCurrentScope,
} from './exports';
export {
getCurrentHub,
Expand Down
1 change: 1 addition & 0 deletions packages/deno/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export {
getHubFromCarrier,
getCurrentHub,
getClient,
getCurrentScope,
Hub,
lastEventId,
makeMain,
Expand Down
1 change: 1 addition & 0 deletions packages/node/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export {
getHubFromCarrier,
getCurrentHub,
getClient,
getCurrentScope,
Hub,
lastEventId,
makeMain,
Expand Down
1 change: 1 addition & 0 deletions packages/serverless/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export {
getActiveTransaction,
getCurrentHub,
getClient,
getCurrentScope,
getHubFromCarrier,
makeMain,
setContext,
Expand Down
1 change: 1 addition & 0 deletions packages/sveltekit/src/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export {
getHubFromCarrier,
getCurrentHub,
getClient,
getCurrentScope,
Hub,
makeMain,
Scope,
Expand Down
1 change: 1 addition & 0 deletions packages/vercel-edge/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export {
getHubFromCarrier,
getCurrentHub,
getClient,
getCurrentScope,
Hub,
lastEventId,
makeMain,
Expand Down