Skip to main content

Videos

FunctionReturns
getVideosByIdsPromise<Array<Video>>
getVideoByIdPromise<Video | null>
getVideoByIdBatchedPromise<Video | null>
getVideosByUserPromise<PaginatedResult<Video>>
getVideosByGamePromise<PaginatedResult<Video>>
deleteVideosByIdsPromise<void>

Functions​

getVideosByIds​

twitch.video.getVideosByIds(videoIds: Array<string>): Promise<Array<Video>>

getVideoById​

twitch.video.getVideoById(videoId: string): Promise<Video | null>

getVideoByIdBatched​

twitch.video.getVideoByIdBatched(videoId: string): Promise<Video | null>

getVideosByUser​

twitch.video.getVideosByUser(userId: UserIdResolvable, filter?: PaginatedVideoFilter): Promise<PaginatedResult<Video>>

getVideosByGame​

twitch.video.getVideosByGame(gameId: string, filter?: PaginatedVideoFilter): Promise<PaginatedResult<Video>>

deleteVideosByIds​

twitch.video.deleteVideosByIds(videoIds: Array<string>): Promise<void>

Types​

PaginatedResult​

type PaginatedResult<T> = {
data: Array<T>
cursor?: string
}

PaginatedVideoFilter​

type PaginatedVideoFilter = {
language?: string
period?: VideoFilterPeriod
orderBy?: VideoSort
type?: "all" | "upload" | "archive" | "highlight"
before?: string
limit?: number
after?: string
}

UserIdResolvable​

type UserIdResolvable = string | UserIdResolvableType

UserIdResolvableType​

type UserIdResolvableType = {
id: string
}

Video​

type Video = {
id: string
userId: string
userLogin: string
userName: string
title: string
description: string
createdAt: string
publishedAt: string
url: string
thumbnailUrl: string
viewable: VideoViewableStatus
viewCount: number
language: string
type: VideoType
duration: string
streamId: string | null
mutedSegments: Array<VideoMutedSegment> | null
}

VideoFilterPeriod​

type VideoFilterPeriod = "day" | "week" | "month" | "all"

VideoMutedSegment​

type VideoMutedSegment = {
offset: number
duration: number
}

VideoSort​

type VideoSort = "time" | "trending" | "views"

VideoType​

type VideoType = "upload" | "archive" | "highlight"

VideoViewableStatus​

type VideoViewableStatus = "public" | "private"