twitcheasy-twitch-bottwitch-authtwitch-auth-tmitwitch-chat-clienttwitch-eventsubtwitch-pubsub-clienttwitch-webhooks
Welcome

HelixStreamApi

The Helix API methods that deal with streams.

Overview

Can be accessed using client.helix.streams on an ApiClient instance.

Example

const api = new ApiClient(new StaticAuthProvider(clientId, accessToken));
const stream = await api.helix.streams.getStreamByUserId('125328655');

Methods

createStreamMarker(broadcaster, description)

async

Creates a new stream marker.

Only works while the specified user's stream is live.

Parameter Type Required Default Description
broadcaster UserIdResolvable none

The broadcaster to create a stream marker for.

description string none

The description of the marker.

Return type: HelixStreamMarker

getStreamByUserId(user)

async

Retrieves the current stream for the given user ID.

Parameter Type Required Default Description
user UserIdResolvable none

The user ID to retrieve the stream for.

Return type: HelixStream | null

getStreamByUserName(user)

async

Retrieves the current stream for the given user name.

Parameter Type Required Default Description
user UserNameResolvable none

The user name to retrieve the stream for.

Return type: HelixStream | null

getStreamKey(broadcaster)

async

Retrieves the stream key of a stream.

Parameter Type Required Default Description
broadcaster UserIdResolvable none

The broadcaster to retrieve the stream key for.

Return type: string

getStreamMarkersForUser(user)

async

Retrieves a list of all stream markers for an user.

Parameter Type Required Default Description
user UserIdResolvable none

The user to list the stream markers for.

getStreamMarkersForUserPaginated(user)

Creates a paginator for all stream markers for an user.

Parameter Type Required Default Description
user UserIdResolvable none

The user to list the stream markers for.

Return type: HelixPaginatedRequest<HelixStreamGetMarkersResult, HelixStreamMarkerWithVideo>

getStreamMarkersForVideo(videoId)

async

Retrieves a list of all stream markers for a video.

Parameter Type Required Default Description
videoId string none

The video to list the stream markers for.

getStreamMarkersForVideoPaginated(videoId)

Creates a paginator for all stream markers for a video.

Parameter Type Required Default Description
videoId string none

The video to list the stream markers for.

Return type: HelixPaginatedRequest<HelixStreamGetMarkersResult, HelixStreamMarkerWithVideo>

getStreams(filter)

async

Retrieves a list of streams.

Parameter Type Required Default Description
filter HelixPaginatedStreamFilter {} see below
filter.after string none

A cursor to get the following page of.

filter.before string none

A cursor to get the previous page of.

filter.community string | Array<string> none

A community ID or a list thereof.

filter.game string | Array<string> none

A game ID or a list thereof.

filter.language string | Array<string> none

A language or a list thereof.

filter.limit string none

The number of results per page.

filter.type HelixStreamType none

A type of stream.

filter.userId string | Array<string> none

A user ID or a list thereof.

filter.userName string | Array<string> none

A user name or a list thereof.

getStreamsPaginated(filter)

Creates a paginator for streams.

Parameter Type Required Default Description
filter HelixStreamFilter {} see below
filter.community string | Array<string> none

A community ID or a list thereof.

filter.game string | Array<string> none

A game ID or a list thereof.

filter.language string | Array<string> none

A language or a list thereof.

filter.type HelixStreamType none

A type of stream.

filter.userId string | Array<string> none

A user ID or a list thereof.

filter.userName string | Array<string> none

A user name or a list thereof.

Return type: HelixPaginatedRequest<HelixStreamData, HelixStream>

getStreamTags(broadcaster)

async

Retrieves the tags of a stream.

Parameter Type Required Default Description
broadcaster UserIdResolvable none

The broadcaster of the stream.

Return type: Array<HelixTag>

replaceStreamTags(broadcaster, tagIds)

async

Replaces the tags of a stream.

Parameter Type Required Default Description
broadcaster UserIdResolvable none

The broadcaster of the stream.

tagIds Array<string> none

The tags to set. If not given, removes all tags.

Return type: void