plugins/plugin-twitch/README.md
Twitch chat integration plugin for ElizaOS agents.
npm install @elizaos/plugin-twitch
chat:read and chat:edit scopes at Twitch Token GeneratorSet the following environment variables:
| Variable | Description |
|---|---|
TWITCH_USERNAME | Bot's Twitch username |
TWITCH_CLIENT_ID | Application client ID from Twitch Developer Console |
TWITCH_ACCESS_TOKEN | OAuth access token with chat:read and chat:edit scopes |
TWITCH_CHANNEL | Primary channel to join (without # prefix) |
| Variable | Description | Default |
|---|---|---|
TWITCH_CLIENT_SECRET | Application client secret (for token refresh) | - |
TWITCH_REFRESH_TOKEN | OAuth refresh token (for automatic refresh) | - |
TWITCH_CHANNELS | Comma-separated list of additional channels | - |
TWITCH_REQUIRE_MENTION | Only respond when @mentioned | false |
TWITCH_ALLOWED_ROLES | Comma-separated roles allowed to interact | all |
all - Anyone can interactowner / broadcaster - Channel owner onlymoderator - Moderatorsvip - VIP userssubscriber - Subscribersimport twitchPlugin from "@elizaos/plugin-twitch";
const agent = new Agent({
plugins: [twitchPlugin],
});
Twitch chat operations route through the canonical MESSAGE action using
source: "twitch".
| Primary action | Operation | Description |
|---|---|---|
MESSAGE | send | Send a message to a Twitch channel |
MESSAGE | join_channel | Join a Twitch channel |
MESSAGE | leave_channel | Leave a Twitch channel |
MESSAGE | list_channels | List joined Twitch channels |
Twitch does not register standalone planner providers. Channel and user context is exposed through the Twitch message connector hooks.
The plugin emits the following events:
| Event | Description |
|---|---|
TWITCH_MESSAGE_RECEIVED | A chat message was received |
TWITCH_MESSAGE_SENT | A message was sent |
TWITCH_JOIN_CHANNEL | Bot joined a channel |
TWITCH_LEAVE_CHANNEL | Bot left a channel |
TWITCH_CONNECTION_READY | Connected to Twitch |
TWITCH_CONNECTION_LOST | Connection lost |
TWITCH_ALLOWED_ROLES to restrict who can interactTWITCH_REQUIRE_MENTION in busy channelschat:read and chat:editchat:edit scopeMIT