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

Hierarchy

  • Scope

Implemented by

Methods

  • 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

  • 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 User if there is one

    Returns undefined | User

  • Sets context data with the given name.

    Parameters

    • name: 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: SeverityLevel | Severity

      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

  • 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

Generated using TypeDoc