Skip to content

Get Your Twitch OAuth Token

Step 1: Authorize Your App

Click this link to generate your OAuth token:

🔗 Generate Twitch OAuth Token

⚠️ IMPORTANT: Updated with EventSub chat scopes (user:read:chat, user:write:chat, user:bot, channel:bot) for TwitchIO v3 compatibility.

StarStreamer v0.6.1+ includes a web interface with integrated OAuth flow:

  1. Start StarStreamer: uv run python src/main.py
  2. Open the web interface at http://localhost:8888
  3. Navigate to the Connections page
  4. Click the Twitch authorization button
  5. Complete OAuth flow on Twitch's website
  6. Token is automatically captured and stored securely

This method is more user-friendly and handles token storage automatically.

Step 2: Manual Authorization (Alternative Method)

  1. Click the link above
  2. Log in to Twitch if needed
  3. Click "Authorize" to grant all permissions
  4. You'll be redirected to http://localhost:3000#access_token=YOUR_TOKEN&scope=...
  5. Copy the token from the URL (everything between access_token= and &scope=)

Step 3: Store Your Token

StarStreamer uses implicit OAuth flow for security and simplicity:

  1. No client secret required - Public clients don't need client secrets
  2. Database token storage - Tokens are stored securely in StarStreamer's database via VariableRepository
  3. No config file tokens - This prevents accidental commits of sensitive credentials

Configure Your Channel

Update your config.yaml file with your channel information:

twitch:
  client_id: "h1x5odjr6qy1m8sesgev1p9wcssz63"  # Default StarStreamer public client
  channel: "YOUR_CHANNEL_NAME"

Or use environment variable substitution:

twitch:
  client_id: "${TWITCH_CLIENT_ID:-h1x5odjr6qy1m8sesgev1p9wcssz63}"
  channel: "${TWITCH_CHANNEL}"

Note: You only need to set channel - StarStreamer will automatically fetch your broadcaster ID from your channel name.

Token Storage

The OAuth token from Step 2 will be automatically stored in StarStreamer's database when you first run the application. This secure storage approach: - Prevents accidental token commits to version control - Allows for future token refresh capabilities - Keeps sensitive credentials separate from configuration files

Step 4: Optional - Manual Broadcaster ID (Advanced)

If needed, you can manually set your broadcaster ID to override auto-fetch:

twitch:
  client_id: "h1x5odjr6qy1m8sesgev1p9wcssz63"
  channel: "YOUR_CHANNEL_NAME"
  broadcaster_id: "YOUR_TWITCH_USER_ID"

Or with environment variables:

twitch:
  client_id: "${TWITCH_CLIENT_ID:-h1x5odjr6qy1m8sesgev1p9wcssz63}"
  channel: "${TWITCH_CHANNEL}"
  broadcaster_id: "${TWITCH_BROADCASTER_ID}"

To get your broadcaster ID manually:

  1. Go to: https://www.streamweasels.com/tools/convert-twitch-username-to-user-id/
  2. Enter your Twitch username
  3. Copy the User ID

Or use the Twitch CLI:

twitch api get users -q login=YOUR_USERNAME

All Required Scopes

Your token will have these permissions: - ✅ Chat (EventSub/Helix): user:read:chat, user:write:chat - Read and send messages via EventSub/Helix API - ✅ Bot Permissions: user:bot, channel:bot - Required for bot operations with EventSub - ✅ Channel Points: Read and manage redemptions
- ✅ Subscriptions: Read sub events - ✅ Bits: Read cheer events - ✅ Hype Train: Read hype train events - ✅ Moderation: channel:moderate, moderation:read - Receive ban/unban events and general moderation - ✅ Banned Users: moderator:read:banned_users - Read banned user information - ✅ Shield Mode: Manage shield mode - ✅ Shoutouts: Create and receive shoutouts - ✅ VIPs: Read and manage VIPs - ✅ Polls: Read and manage polls - ✅ Predictions: Read and manage predictions - ✅ Goals: Read channel goals - ✅ Clips: Create clips - ✅ Markers: Create stream markers - ✅ Commercials: Run ads

Note: The old IRC scopes (chat:read, chat:edit) are deprecated. We now use EventSub/Helix scopes for chat functionality.

Troubleshooting

If you get "redirect_uri does not match": 1. Make sure you're using exactly: http://localhost:3000 2. You may need to add this redirect URI in your Twitch app settings

If some events still fail with 403: - Some events require you to be a Partner or Affiliate (like channel points) - Some events need additional setup in your Twitch dashboard