Holds additional event information. Scope.applyToEvent will be called by the client before an event will be sent.

Hierarchy

Implements

Properties

_attachments: Attachment[]

Attachments

_breadcrumbs: Breadcrumb[]

Array of breadcrumbs.

_contexts: Contexts

Contexts

_eventProcessors: EventProcessor[]

Callback list that will be called after applyToEvent.

_extra: Extras

Extra

_fingerprint?: string[]

Fingerprint

_level?: Severity | SeverityLevel

Severity

_notifyingListeners: boolean

Flag if notifying is happening.

_propagationContext: PropagationContext

Propagation Context for distributed tracing

_requestSession?: RequestSession

Request Mode Session Status

_scopeListeners: ((scope) => void)[]

Callback for client to receive scope changes.

Type declaration

    • (scope): void
    • Parameters

      Returns void

_sdkProcessingMetadata: {
    [key: string]: unknown;
}

A place to stash data which is needed at some point in the SDK's event processing pipeline but which shouldn't get sent to Sentry

Type declaration

  • [key: string]: unknown
_session?: Session

Session

_span?: Span

Span

_tags: {
    [key: string]: Primitive;
}

Tags

Type declaration

  • [key: string]: Primitive
_transactionName?: string

Transaction Name

_user: User

User

Methods

  • This will be called after applyToEvent is finished.

    Parameters

    Returns PromiseLike<null | Event>

  • This will be called on every set call.

    Returns void

  • Adds an attachment to the scope

    Parameters

    • attachment: Attachment

      Attachment options

    Returns Scope

  • Sets the breadcrumbs in the scope

    Parameters

    • breadcrumb: Breadcrumb
    • Optional maxBreadcrumbs: number

      number of max breadcrumbs to merged into event.

    Returns Scope

  • Add new event processor that will be called after applyToEvent.

    Parameters

    Returns Scope

  • Clears the current scope and resets its properties.

    Returns Scope

  • Clears attachments from the scope

    Returns Scope

  • Clears all currently set Breadcrumbs.

    Returns Scope

  • Returns an array of attachments on the scope

    Returns Attachment[]

  • Get propagation context from the scope, used for distributed tracing

    Returns PropagationContext

  • Returns the RequestSession if there is one

    Returns undefined | RequestSession

  • Returns the Session if there is one

    Returns undefined | Session

  • Returns the Span if there is one

    Returns undefined | Span

  • Returns the Transaction attached to the scope (if there is one)

    Returns undefined | Transaction

  • Returns the User if there is one

    Returns undefined | User

  • Sets context data with the given name.

    Parameters

    • key: string

      of the context

    • context: null | Context

      an object containing context data. This data will be normalized. Pass null to unset the context.

    Returns Scope

  • 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 Scope

  • 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 Scope

  • Sets the fingerprint on the scope to send with the events.

    Parameters

    • fingerprint: string[]

      string[] to group events in Sentry.

    Returns Scope

  • Sets the level on the scope for future events.

    Parameters

    • level: Severity | SeverityLevel

      string SeverityLevel

    Returns Scope

  • Add propagation context to the scope, used for distributed tracing

    Parameters

    • context: PropagationContext

    Returns Scope

  • Sets the RequestSession on the scope

    Parameters

    • Optional requestSession: RequestSession

    Returns Scope

  • Add data which will be accessible during event processing but won't get sent to Sentry

    Parameters

    • newData: {
          [key: string]: unknown;
      }
      • [key: string]: unknown

    Returns Scope

  • Sets the Session on the scope

    Parameters

    • Optional session: Session

    Returns Scope

  • Sets the Span on the scope.

    Parameters

    • Optional span: Span

      Span

    Returns Scope

  • 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 Scope

  • 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 Scope

  • Sets the transaction name on the scope for future events.

    Parameters

    • Optional name: string

    Returns Scope

  • 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 Scope

  • Updates the scope with provided data. Can work in three variations:

    • plain object containing updatable attributes
    • Scope instance that'll extract the attributes from
    • callback function that'll receive the current scope as an argument and allow for modifications

    Parameters

    Returns Scope

  • Inherit values from the parent scope.

    Parameters

    • Optional scope: Scope

      to clone.

    Returns Scope

Generated using TypeDoc