Skip to main content
Module

x/sentry/index.d.ts>Hub

The Official Sentry Deno SDK
Go to Latest
class Hub
implements Hub$1
import { Hub } from "https://deno.land/x/sentry@7.88.0/index.d.ts";

Constructors

new
Hub(
client?: Client,
scope?: Scope,
_version?: number,
)

Creates a new instance of the hub, will push one Layer into the internal stack on creation.

Properties

private
_callExtensionMethod

Calls global extension method and binding current instance to the function call

private
optional
_lastEventId

Contains the last event id of a captured event.

private
_sendSessionUpdate

Sends the current Session on the scope

private
readonly
_stack

Is a Layer[] containing the client and scope

private
readonly
_version
private
_withClient

Internal helper function to call a method on the top client if it exists.

Methods

addBreadcrumb(breadcrumb: Breadcrumb, hint?: BreadcrumbHint): void
bindClient(client?: Client): void
captureEvent(event: Event, hint?: EventHint): string
captureException(exception: unknown, hint?: EventHint): string
captureMessage(
message: string,
level?: Severity | SeverityLevel,
hint?: EventHint,
): string
captureSession(endSession?: boolean): void
configureScope(callback: (scope: Scope) => void): void
endSession(): void
getClient<C extends Client>(): C | undefined
getIntegration<T extends Integration>(integration: IntegrationClass<T>): T | null
getScope(): Scope

Returns the scope of the top stack.

getStack(): Layer[]

Returns the scope stack for domains or the process.

getStackTop(): Layer

Returns the topmost scope layer in the order domain > local > process.

isOlderThan(version: number): boolean
lastEventId(): string | undefined
popScope(): boolean
pushScope(): Scope
run(callback: (hub: Hub) => void): void
setContext(name: string, context: { [key: string]: any; } | null): void
setExtra(key: string, extra: Extra): void
setExtras(extras: Extras): void
setTag(key: string, value: Primitive): void
setTags(tags: { [key: string]: Primitive; }): void
setUser(user: User | null): void

Returns if default PII should be sent to Sentry and propagated in ourgoing requests when Tracing is used.

startSession(context?: SessionContext): Session
startTransaction(context: TransactionContext, customSamplingContext?: CustomSamplingContext): Transaction
traceHeaders(): { [key: string]: string; }
withScope(callback: (scope: Scope) => void): void