import { request, TwitchRequestError } from './core.ts'
import type { TwitchRequestOptions, TwitchResponse } from './types.ts'
export { TwitchRequestError }
/**
* Perform an authenticated Twitch Helix API request.
*
* Uses the `twitch` OAuth integration for both Authorization and Client-Id,
* which Helix requires together.
*
* @returns Parsed response with status, data, and raw text body.
* @example
* import request from 'kody:@kentcdodds/twitch/request'
* const response = await request({ path: '/users', throwOnError: true })
* // => { ok: true, status: 200, data: { data: [{ login: 'kentcdodds' }] } }
*/
export default async function twitchRequest<T = unknown>(
params: TwitchRequestOptions,
): Promise<TwitchResponse<T>> {
return await request<T>(params)
}
export { request }