Skip to main content

Clips

FunctionReturns
getClipsForBroadcasterPromise<PaginatedResult<Clip>>
getClipsForGamePromise<PaginatedResult<Clip>>
getClipsByIdsPromise<Array<Clip>>
getClipByIdPromise<Clip | null>
getClipByIdBatchedPromise<Clip | null>
createClipPromise<string>
createClipFromVodPromise<string>

Functions​

getClipsForBroadcaster​

twitch.clip.getClipsForBroadcaster(broadcaster: UserIdResolvable, filter?: ClipFilter): Promise<PaginatedResult<Clip>>

getClipsForGame​

twitch.clip.getClipsForGame(gameId: string, filter?: PaginatedClipFilter): Promise<PaginatedResult<Clip>>

getClipsByIds​

twitch.clip.getClipsByIds(clipIds: Array<string>): Promise<Array<Clip>>

getClipById​

twitch.clip.getClipById(clipId: string): Promise<Clip | null>

getClipByIdBatched​

twitch.clip.getClipByIdBatched(clipId: string): Promise<Clip | null>

createClip​

twitch.clip.createClip(params: ClipCreateParams): Promise<string>

createClipFromVod​

twitch.clip.createClipFromVod(params: ClipCreateFromVodParams): Promise<string>

Types​

Clip​

type Clip = {
id: string
url: string
embedUrl: string
broadcasterId: string
broadcasterName: string
creatorId: string
creatorName: string
videoId: string
gameId: string
language: string
title: string
viewCount: number
createdAt: string
thumbnailUrl: string
duration: number
vodOffset: number | null
isFeatured: boolean
}

ClipCreateFromVodParams​

type ClipCreateFromVodParams = {
vodId: string
vodOffset: number
channel: UserIdResolvable
title?: string
duration?: number
}

ClipCreateParams​

type ClipCreateParams = {
createAfterDelay?: boolean
channel: UserIdResolvable
title?: string
duration?: number
}

ClipFilter​

type ClipFilter = {
startDate?: string
endDate?: string
isFeatured?: boolean
}

PaginatedClipFilter​

type PaginatedClipFilter = {
startDate?: string
endDate?: string
isFeatured?: boolean
before?: string
limit?: number
after?: string
}

PaginatedResult​

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

UserIdResolvable​

type UserIdResolvable = string | UserIdResolvableType

UserIdResolvableType​

type UserIdResolvableType = {
id: string
}