Back to Eliza

Twitch Connector

packages/docs/connectors/twitch.md

2.0.14.1 KB
Original Source

Twitch Connector

Connect your agent to Twitch for live chat monitoring, channel events, and audience interactions using the @elizaos/plugin-twitch package.

Prerequisites

Configuration

NameRequiredDescription
TWITCH_ACCESS_TOKENYesTwitch OAuth access token with chat scopes
TWITCH_CLIENT_IDNoTwitch application Client ID
TWITCH_CLIENT_SECRETNoTwitch client secret
TWITCH_REFRESH_TOKENNoRefresh token for automatic token renewal
TWITCH_USERNAMENoTwitch username for the bot
TWITCH_CHANNELNoPrimary channel name to join
TWITCH_CHANNELSNoComma-separated list of additional channel names to join
TWITCH_ALLOWED_ROLESNoComma-separated list of allowed roles
TWITCH_REQUIRE_MENTIONNoOnly respond when mentioned

The connector auto-enables when accessToken, clientId, or enabled: true is set in the connector config.

Configure in ~/.eliza/eliza.json:

json
{
  "connectors": {
    "twitch": {
      "clientId": "YOUR_CLIENT_ID",
      "accessToken": "YOUR_ACCESS_TOKEN"
    }
  }
}

To disable:

json
{
  "connectors": {
    "twitch": {
      "clientId": "YOUR_CLIENT_ID",
      "accessToken": "YOUR_ACCESS_TOKEN",
      "enabled": false
    }
  }
}

Setup

The plugin-auto-enable.ts module checks connectors.twitch in your config. The connector auto-enables when accessToken or clientId is truthy, or when enabled is explicitly true. Setting enabled: false disables auto-enable regardless of other fields.

No environment variable is required to trigger auto-enable — it is driven entirely by the connector config object.

Environment Variables

VariableRequiredDescription
TWITCH_ACCESS_TOKENYesTwitch OAuth access token with chat scopes
TWITCH_CLIENT_IDNoTwitch application Client ID
TWITCH_CLIENT_SECRETNoTwitch client secret
TWITCH_REFRESH_TOKENNoRefresh token for automatic token renewal
TWITCH_USERNAMENoTwitch username for the bot
TWITCH_CHANNELNoPrimary channel name to join
TWITCH_CHANNELSNoComma-separated list of additional channels to join
TWITCH_ALLOWED_ROLESNoComma-separated list of roles allowed to interact
TWITCH_REQUIRE_MENTIONNoOnly respond when @mentioned

Setup Steps

  1. Go to the Twitch Developer Console and create a new application
  2. Note the Client ID and generate an Access Token with the required chat scopes
  3. Add the credentials to connectors.twitch in your config or set the environment variables
  4. Start your agent — the Twitch connector will auto-enable

Full Configuration Reference

All fields are defined under connectors.twitch in eliza.json.

Core Fields

FieldTypeDefaultDescription
clientIdstringTwitch application Client ID
accessTokenstringOAuth access token with chat scopes
clientSecretstringTwitch client secret
refreshTokenstringRefresh token for token renewal
usernamestringTwitch username for the bot
channelstringPrimary channel name to join
channelsstring[]Additional channel names to join
requireMentionbooleanOnly respond when mentioned
allowedRolesstring[]Comma-separated allowed roles
enabledbooleanExplicitly enable/disable

Features

  • Live chat monitoring and response
  • Channel event handling
  • Audience interaction management
  • Multi-channel support
  • Role-based access filtering
  • Mention-based response filtering