Skip to content
← Public packages

@kentcdodds/twitch

Monitor Twitch streams, send chat, and update channel settings.

src/get-stream.ts

19 lines · 680 B · TypeScript
import { getStreamStatus } from './core.ts'
import type { TwitchGetStreamParams, TwitchStreamStatus } from './types.ts'

/**
 * Check whether one or more Twitch channels are currently live.
 *
 * @returns Stream status per requested login, with isLive false when offline.
 * @example
 * import getStream from 'kody:@kentcdodds/twitch/get-stream'
 * const [status] = await getStream({ login: 'kentcdodds' })
 * // => { userLogin: 'kentcdodds', isLive: true, title: '...', viewerCount: 42 }
 */
export default async function twitchGetStream(
	params: TwitchGetStreamParams = {},
): Promise<TwitchStreamStatus[]> {
	return await getStreamStatus(params)
}

export { getStreamStatus }