TwurpleAuthenticationGetting dataExamplesFAQMigration

Main classes

HelixStream

A Twitch stream.

Overview

Properties

gameId

Type: string

The game ID, or an empty string if the stream doesn't currently have a game.

gameName

Type: string

The game name, or an empty string if the stream doesn't currently have a game.

id

Type: string

The stream ID.

isMature

Type: boolean

Whether the stream is set to be targeted to mature audiences only.

language

Type: string

The language of the stream.

startDate

Type: Date

The time when the stream started.

tags

Type: string[]

The tags applied to the stream.

thumbnailUrl

Type: string

The URL of the thumbnail of the stream.

This URL includes the placeholders {width} and {height} which you must replace with the desired dimensions of the thumbnail (in pixels).

You can also use HelixStream#getThumbnailUrl to do this replacement.

title

Type: string

The title of the stream.

type

Type: HelixStreamType

The type of the stream.

userDisplayName

Type: string

The user's display name.

userId

Type: string

The user ID.

userName

Type: string

The user's name.

viewers

Type: number

The number of viewers the stream currently has.

Methods

getGame()

async

Gets information about the game that is being played on the stream.

Returns null if the stream doesn't currently have a game.

Return type: HelixGame | null

getThumbnailUrl(width, height)

Builds the thumbnail URL of the stream using the given dimensions.

ParameterTypeRequiredDefaultDescription
widthnumbernone

The width of the thumbnail.

heightnumbernone

The height of the thumbnail.

Return type: string

getUser()

async

Gets information about the user broadcasting the stream.

Return type: HelixUser