Options
All
  • Public
  • Public/Protected
  • All
Menu

Class User

Stores fields related to the current extension user, either a viewer or the broadcaster. These fields are automatically updated by the SDK.

Hierarchy

  • User

Index

Constructors

constructor

  • since

    1.0.0

    Parameters

    • auth: TwitchAuth

      An auth token usable by this user for backend requests.

    Returns User

Properties

bitrate

bitrate: number

buffer

buffer: number

channelID

channelID: string

game

game: string

ip

ip: string

latency

latency: number

muxyID

muxyID: string

registeredWithMuxy

registeredWithMuxy: boolean

role

role: string

theme

theme: string

timeOffset

timeOffset: number

twitchID

twitchID: string

twitchJWT

twitchJWT: string

twitchOpaqueID

twitchOpaqueID: string

videoMode

videoMode: string

visualizationID

visualizationID: string

volume

volume: number

Accessors

Static Roles

  • get Roles(): object
  • Defines the current user's role on Twitch relative to the current channel being viewed. May be "viewer" if the user is simply viewing the channel, "moderator" if the user is a moderator of the channel or "broadcaster" if the user is also the broadcaster of the channel.

    since

    1.0.3

    Returns object

    • Broadcaster: string
    • Moderator: string
    • Viewer: string

Static VideoModes

  • get VideoModes(): object
  • Defines the video mode for the current user. This may be "default" for the default windowed viewing experience on Twitch, "fullscreen" for the fullscreen, video-only mode or "theatre" for the video full window-width.

    since

    1.0.3

    Returns object

    • Default: string
    • Fullscreen: string
    • Theatre: string

Methods

anonymous

  • anonymous(): boolean
  • Returns whether or not the current extension user is anonymous. Twitch defines an anonymous user as one who is not logged in to the channel page running this extension, or one who has not opted-in to sharing auth information with this extension.

    since

    1.0.0

    Returns boolean

    True if the user is not logged in to Twitch or has not granted access to their Twitch ID.

extractJWTInfo

  • extractJWTInfo(jwt: string): void
  • Attempts to parse the provided JWT and persist any found information in store.

    since

    1.0.0

    Parameters

    • jwt: string

      The auth JWT token as returned from the auth harness.

    Returns void

getOffsetDate

  • getOffsetDate(): Date
  • Returns a date object that is based on the Muxy server time.

    Returns Date

updateAuth

  • Stores values from a new auth token in the local store.

    since

    1.0.0

    Parameters

    • auth: TwitchAuth

      An auth JWT with updated user information.

    Returns void

Generated using TypeDoc