Skip to content

Built for people who want to own their automations. Join the waitlist for an invite.

Package listing

@kody/twitch

src/request.ts

15 lines · 577 B · TypeScript
import { requestHelix } from './client.ts'

/**
 * Perform an authenticated Twitch Helix request.
 * Helix requires both Authorization (from the twitch integration) and Client-Id.
 * Non-GET calls need confirm: true. Pass dryRun: true to preview.
 *
 * @example
 * import request from 'kody:@kody/twitch/request'
 * const response = await request({ path: '/users', throwOnError: true })
 * // => { ok: true, status: 200, data: { data: [{ login: '...' }] } }
 */
export default async function twitchRequest(params: Record<string, unknown> = {}) {
	return requestHelix(params)
}