Back to Eliza

Twitch Plugin

packages/docs/plugin-registry/platform/twitch.md

2.0.12.6 KB
Original Source

The Twitch plugin connects Eliza agents to Twitch, enabling chat messaging and channel interaction.

Package: @elizaos/plugin-twitch

Installation

bash
eliza plugins install @elizaos/plugin-twitch

Setup

1. Create a Twitch Application

  1. Go to the Twitch Developer Console
  2. Create a new application
  3. Note the Client ID
  4. Generate an Access Token with the required chat scopes

2. Configure Eliza

json
{
  "connectors": {
    "twitch": {
      "accessToken": "your-twitch-access-token",
      "clientId": "your-twitch-client-id"
    }
  }
}

Or use environment variables:

bash
export TWITCH_ACCESS_TOKEN=your-twitch-access-token
export TWITCH_CLIENT_ID=your-twitch-client-id

Auto-Enable

The plugin auto-enables when any of these are present:

  • accessToken in connector config
  • clientId in connector config
  • enabled: true in connector config

Configuration

FieldRequiredDescription
accessTokenYes*Twitch OAuth access token
clientIdYes*Twitch application Client ID
clientSecretNoTwitch client secret
refreshTokenNoRefresh token for token renewal
usernameNoTwitch username for the bot
channelNoPrimary channel name to join
channelsNoAdditional channel names to join
requireMentionNoOnly respond when mentioned
allowedRolesNoComma-separated allowed roles
enabledNoForce-enable without credentials

* At least one of accessToken, clientId, or enabled: true is required.

Environment Variables

VariableRequiredDescription
TWITCH_ACCESS_TOKENYesTwitch OAuth access token (primary auto-enable trigger)
TWITCH_CLIENT_IDNoTwitch application Client ID
TWITCH_CLIENT_SECRETNoTwitch client secret
TWITCH_REFRESH_TOKENNoRefresh token for token renewal
TWITCH_USERNAMENoTwitch username for the bot
TWITCH_CHANNELNoPrimary channel name to join
TWITCH_CHANNELSNoAdditional channel names to join
TWITCH_ALLOWED_ROLESNoComma-separated allowed roles
TWITCH_REQUIRE_MENTIONNoOnly respond when mentioned

Features

  • Channel chat messaging
  • Whisper / DM support
  • Chat event handling

Streaming

For live-streaming output to Twitch, enable @elizaos/plugin-streaming and set TWITCH_STREAM_KEY (and optional streaming.twitch in config). See Streaming for setup details.