Clips
| Function | Returns |
|---|---|
getClipsForBroadcaster | Promise<PaginatedResult<Clip>> |
getClipsForGame | Promise<PaginatedResult<Clip>> |
getClipsByIds | Promise<Array<Clip>> |
getClipById | Promise<Clip | null> |
getClipByIdBatched | Promise<Clip | null> |
createClip | Promise<string> |
createClipFromVod | Promise<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
}