Skip to content

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

Package listing

@kody/twitch

src/get-me.ts

16 lines · 576 B · TypeScript
import { getMe, resolveIntegrationName } from './client.ts'
import { inputRecord } from './validation.ts'

/**
 * Read the authenticated Twitch user from Helix GET /users.
 * Public profile fields only — email is never returned.
 *
 * @example
 * import getMe from 'kody:@kody/twitch/get-me'
 * const me = await getMe()
 * // => { id: '...', login: '...', displayName: '...', hasEmail: false }
 */
export default async function twitchGetMe(params: Record<string, unknown> = {}) {
	const input = inputRecord(params)
	return getMe(resolveIntegrationName(input.integration))
}