Getting started
Install velho, gather your Twitch credentials, and wire up the modules that match your use case.
Prerequisites
Bun 1.3 or newer, a Twitch application with client ID & secret, and optionally refresh tokens for user-scoped operations.
Gather your Twitch credentials
Twitch issues the client_id, client_secret, and broadcaster_id values you will reference
throughout this toolkit. Follow the official console steps so you have everything ready before coding:
- Open the Twitch Developer Console and register a new application (or reuse one you already manage).
- Provide an app name, select the target environment, and add a redirect URL you control. Save the configuration.
- From the app detail page, copy the Client ID, then click New Secret to generate a Client Secret. Store the secret securely because Twitch only shows it once.
- Look up the Broadcaster ID (aka
broadcaster_idon Helix). You can:- Call
/helix/users?login=<channel>with your app token and read theidfield. - Run the Twitch CLI:
twitch api get users -q login=<channel>.
- Call
Drop the values into your environment file so the SDK and your deployment platform can read them:
TWITCH_CLIENT_ID=...
TWITCH_CLIENT_SECRET=...
TWITCH_BROADCASTER_ID=...Include TWITCH_BROADCASTER_ID when you manage channel resources, subscribe to EventSub events, or
call Helix endpoints that scope responses to a broadcaster.
Installation
Install with Bun:
bun add velhoQuick setup with the CLI tool
Get started instantly with the interactive OAuth setup:
# Set your Twitch credentials
export TWITCH_CLIENT_ID="your_client_id"
export TWITCH_CLIENT_SECRET="your_client_secret"
# Run the interactive setup
bunx velho-setupThis will automatically handle the OAuth flow and save credentials to your .env file.
Manual setup
Alternatively, create a .env file containing your Twitch credentials:
TWITCH_CLIENT_ID=your_client_id
TWITCH_CLIENT_SECRET=your_client_secret
TWITCH_BROADCASTER_ID=your_broadcaster_id # optional for channel-scoped APIs