Internal class used to make sure we always have the latest internal functions working in case we have a version conflict.

Hierarchy

  • Hub

Implements

Constructors

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

    Parameters

    • Optional client: Client<ClientOptions<BaseTransportOptions>>

      bound to the hub.

    • scope: Scope = ...

      bound to the hub.

    • _version: number = API_VERSION

    Returns Hub

Methods

  • Records a new breadcrumb which will be attached to future events.

    Breadcrumbs will be added to subsequent events to provide more context on user's actions prior to an error or crash.

    Parameters

    • breadcrumb: Breadcrumb

      The breadcrumb to record.

    • Optional hint: BreadcrumbHint

      May contain additional information about the original breadcrumb.

    Returns void

  • This binds the given client to the current scope.

    Parameters

    • Optional client: Client<ClientOptions<BaseTransportOptions>>

      An SDK client (client) instance.

    Returns void

  • Captures a manually created event and sends it to Sentry.

    Parameters

    • event: Event

      The event to send to Sentry.

    • Optional hint: EventHint

      May contain additional information about the original exception.

    Returns string

  • Captures an exception event and sends it to Sentry.

    Parameters

    • exception: unknown

      An exception-like object.

    • Optional hint: EventHint

      May contain additional information about the original exception.

    Returns string

    The generated eventId.

  • Captures a message event and sends it to Sentry.

    Parameters

    • message: string

      The message to send to Sentry.

    • Optional level: Severity | SeverityLevel

      Define the level of the message.

    • Optional hint: EventHint

      May contain additional information about the original exception.

    Returns string

    The generated eventId.

  • Sends the current session on the scope to Sentry

    Parameters

    • endSession: boolean = false

      If set the session will be marked as exited and removed from the scope

    Returns void

  • Callback to set context information onto the scope.

    Parameters

    • callback: ((scope) => void)

      Callback function that receives Scope.

        • (scope): void
        • Parameters

          Returns void

    Returns void

  • Ends the session that lives on the current scope and sends it to Sentry

    Returns void

  • Returns the client of the top stack.

    Type Parameters

    • C extends Client<ClientOptions<BaseTransportOptions>, C>

    Returns undefined | C

  • Returns the scope stack for domains or the process.

    Returns Layer[]

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

    Returns Layer

  • Parameters

    • version: number

    Returns boolean

    Inherit Doc

  • This is the getter for lastEventId.

    Returns undefined | string

    The last event id of a captured event.

  • Removes a previously pushed scope from the stack.

    This restores the state before the scope was pushed. All breadcrumbs and context information added since the last call to this.pushScope are discarded.

    Returns boolean

  • Create a new scope to store context information.

    The scope will be layered on top of the current one. It is isolated, i.e. all breadcrumbs and context information added to this scope will be removed once the scope ends. Be sure to always remove this scope with this.popScope when the operation finishes or throws.

    Returns Scope

    Scope, the new cloned scope

  • For the duration of the callback, this hub will be set as the global current Hub. This function is useful if you want to run your own client and hook into an already initialized one e.g.: Reporting issues to your own sentry when running in your component while still using the users configuration.

    Parameters

    • callback: ((hub) => void)
        • (hub): void
        • Parameters

          Returns void

    Returns void

  • Sets context data with the given name.

    Parameters

    • name: string

      of the context

    • context: null | {
          [key: string]: any;
      }

      Any kind of data. This data will be normalized.

    Returns void

  • Set key:value that will be sent as extra data with the event.

    Parameters

    • key: string

      String of extra

    • extra: unknown

      Any kind of data. This data will be normalized.

    Returns void

  • Set an object that will be merged sent as extra data with the event.

    Parameters

    • extras: Extras

      Extras object to merge into current context.

    Returns void

  • Set key:value that will be sent as tags data with the event.

    Can also be used to unset a tag, by passing undefined.

    Parameters

    • key: string

      String key of tag

    • value: Primitive

      Value of tag

    Returns void

  • Set an object that will be merged sent as tags data with the event.

    Parameters

    • tags: {
          [key: string]: Primitive;
      }

      Tags context object to merge into current context.

      • [key: string]: Primitive

    Returns void

  • Updates user context information for future events.

    Parameters

    • user: null | User

      User context object to be set in the current context. Pass null to unset the user.

    Returns void

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

    Returns boolean

  • Starts a new Session, sets on the current scope and returns it.

    To finish a session, it has to be passed directly to client.captureSession, which is done automatically when using hub.endSession() for the session currently stored on the scope.

    When there's already an existing session on the scope, it'll be automatically ended.

    Parameters

    • Optional context: Partial<Session>

      Optional properties of the new Session.

    Returns Session

    The session which was just started

  • Starts a new Transaction and returns it. This is the entry point to manual tracing instrumentation.

    A tree structure can be built by adding child spans to the transaction, and child spans to other spans. To start a new child span within the transaction or any span, call the respective .startChild() method.

    Every child span must be finished before the transaction is finished, otherwise the unfinished spans are discarded.

    The transaction must be finished with a call to its .finish() method, at which point the transaction with all its finished child spans will be sent to Sentry.

    Parameters

    Returns Transaction

    The transaction which was just started

  • Returns all trace headers that are currently on the top scope.

    Returns {
        [key: string]: string;
    }

    • [key: string]: string
  • Creates a new scope with and executes the given operation within. The scope is automatically removed once the operation finishes or throws.

    This is essentially a convenience function for:

    pushScope();
    callback();
    popScope();

    Parameters

    • callback: ((scope) => void)

      that will be enclosed into push/popScope.

        • (scope): void
        • Parameters

          Returns void

    Returns void

Generated using TypeDoc