Videos
| Function | Returns |
|---|---|
getVideosByIds | Promise<Array<Video>> |
getVideoById | Promise<Video | null> |
getVideoByIdBatched | Promise<Video | null> |
getVideosByUser | Promise<PaginatedResult<Video>> |
getVideosByGame | Promise<PaginatedResult<Video>> |
deleteVideosByIds | Promise<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"