Bits
| Function | Returns |
|---|---|
getLeaderboard | Promise<BitsLeaderboardResponse> |
getCheermotes | Promise<Dictionary<Cheermote>> |
getCustomPowerUps | Promise<Array<CustomPowerUp>> |
getCustomPowerUpById | Promise<CustomPowerUp | null> |
getCustomPowerUpsById | Promise<Array<CustomPowerUp>> |
getCustomPowerUpsByIds | Promise<Array<CustomPowerUp>> |
Functions
getLeaderboard
twitch.bits.getLeaderboard(params?: BitsLeaderboardQuery): Promise<BitsLeaderboardResponse>
getCheermotes
twitch.bits.getCheermotes(): Promise<Dictionary<Cheermote>>
getCustomPowerUps
twitch.bits.getCustomPowerUps(): Promise<Array<CustomPowerUp>>
getCustomPowerUpById
twitch.bits.getCustomPowerUpById(powerUpId: string): Promise<CustomPowerUp | null>
getCustomPowerUpsById
twitch.bits.getCustomPowerUpsById(powerUpId: string): Promise<Array<CustomPowerUp>>
getCustomPowerUpsByIds
twitch.bits.getCustomPowerUpsByIds(powerUpIds: Array<string>): Promise<Array<CustomPowerUp>>
Types
BitsLeaderboardEntry
type BitsLeaderboardEntry = {
userId: string
userLogin: string
userName: string
rank: number
score: number
}
BitsLeaderboardPeriod
type BitsLeaderboardPeriod = "day" | "week" | "month" | "year" | "all"
BitsLeaderboardQuery
type BitsLeaderboardQuery = {
count?: number
period?: BitsLeaderboardPeriod
startDate?: Date
contextUserId?: string
}
BitsLeaderboardResponse
type BitsLeaderboardResponse = {
dateRange: DateRange
total: number
data: Array<BitsLeaderboardEntry>
}
Cheermote
type Cheermote = {
prefix: string
tiers: Array<CheermoteTier>
type: CheermoteType
lastUpdated: string
order: number
}
CheermoteActionImageUrlsByBackgroundAndStateAndScale
type CheermoteActionImageUrlsByBackgroundAndStateAndScale = {
dark: CheermoteActionImageUrlsByStateAndScale
light: CheermoteActionImageUrlsByStateAndScale
}
CheermoteActionImageUrlsByScale
type CheermoteActionImageUrlsByScale = {
'1': string
'15': string
'2': string
'3': string
'4': string
}
CheermoteActionImageUrlsByStateAndScale
type CheermoteActionImageUrlsByStateAndScale = {
animated: CheermoteActionImageUrlsByScale
static: CheermoteActionImageUrlsByScale
}
CheermoteTier
type CheermoteTier = {
minBits: number
id: string
color: string
images: CheermoteActionImageUrlsByBackgroundAndStateAndScale
canCheer: boolean
showInBitsCard: boolean
}
CheermoteType
type CheermoteType = "global_first_party" | "global_third_party" | "channel_custom" | "display_only" | "sponsored"
CustomPowerUp
type CustomPowerUp = {
broadcasterId: string
broadcasterLogin: string
broadcasterName: string
id: string
image: CustomPowerUpImage | null
backgroundColor: string
isEnabled: boolean
bits: number
title: string
prompt: string
isUserInputRequired: boolean
maxPerStreamSetting: CustomPowerUpMaxPerStreamSetting
maxPerUserPerStreamSetting: CustomPowerUpMaxPerUserPerStreamSetting
globalCooldownSetting: CustomPowerUpGlobalCooldownSetting
isPaused: boolean
isInStock: boolean
defaultImage: CustomPowerUpImage
redemptionsRedeemedCurrentStream: number | null
cooldownExpiresAt: string
}
CustomPowerUpGlobalCooldownSetting
type CustomPowerUpGlobalCooldownSetting = {
isEnabled: boolean
globalCooldownSeconds: number
}
CustomPowerUpImage
type CustomPowerUpImage = {
url1X: string
url2X: string
url4X: string
}
CustomPowerUpMaxPerStreamSetting
type CustomPowerUpMaxPerStreamSetting = {
isEnabled: boolean
maxPerStream: number
}
CustomPowerUpMaxPerUserPerStreamSetting
type CustomPowerUpMaxPerUserPerStreamSetting = {
isEnabled: boolean
maxPerUserPerStream: number
}
DateRange
type DateRange = {
startedAt: string
endedAt: string
}