Auth model
Installed plugin + Twitch chat credentials / IRC-style channel auth
Live chat means live moderation pressure, rate limits, and stream-aware etiquette.
Twitch chat setup for OpenClaw: plugin install, bot-account credentials, channel join behavior, allowlist versus role gating, mention requirements, token refresh, and live-chat verification.
Auth model
Installed plugin + Twitch chat credentials / IRC-style channel auth
Safety stance
Moderation boundaries and rate expectations matter as much as raw connectivity on a live stream surface.
Verification ritual
Test in a controlled channel first, then rehearse commands and replies under moderate message volume.
Rollout mode
20–35 min setup
Plugin channel · IRC-backed chat
Twitch runs over IRC-backed live chat, with OpenClaw connecting as a Twitch user and enforcing access control before public chat becomes bot input.
Access watch
A bot that behaves acceptably in a private test can still fail hard under live-stream pace and moderation norms.
Twitch is a live-chat lane, not a quiet bot inbox. The operator job is to keep three things aligned: the bot account that authenticates, the channel chat it joins, and the OpenClaw access rules that stop public chat from turning into open bot control.
Operator companion pages (helps keep the lane bounded during rollout):
Twitch is useful when OpenClaw needs to participate in a stream’s chat surface rather than a private messaging app.
That gives it a very specific operational profile:
This is why the official docs place a warning near the top: add allowFrom or allowedRoles, and remember that requireMention defaults to true.
Use this dossier when you need to decide:
Most Twitch mistakes come from treating a working login as proof that the bot should answer everyone.
The channel uses a Twitch user account.
Core fields are:
usernameaccessTokenclientIdThe official quick setup recommends generating a Bot Token and ensuring the token has:
chat:readchat:writechannel is not the same thing as username.
The docs call this out explicitly:
username is the bot account that authenticates,channel is the Twitch chat room the bot joins.That distinction matters whenever the bot account and the streamer account are different, which is a common setup.
The official docs are unusually direct here because Twitch is a public chat surface.
You should add either:
allowFrom for a hard allowlist of Twitch user IDs, orallowedRoles for role-based access.And by default:
requireMention is true.That default is healthy. It keeps the bot from responding to every ambient chat line during early rollout.
For a first production-minded setup, the safest shape is:
allowFrom with your own Twitch user ID,{
channels: {
twitch: {
enabled: true,
username: 'openclaw',
accessToken: 'oauth:abc123...',
clientId: 'xyz789...',
channel: 'vevisk',
allowFrom: ['123456789'],
},
},
}
Why this is the right first shape:
Twitch support ships as a plugin.
Install it with:
openclaw plugins install @openclaw/twitch
If you are working from a local checkout, the docs also allow:
openclaw plugins install ./extensions/twitch
For beginner setup, the official docs recommend using Twitch Token Generator:
chat:read and chat:write,The docs also note that tokens from the token generator expire after several hours.
For the default account, the docs allow an env var:
OPENCLAW_TWITCH_ACCESS_TOKEN=oauth:abc123...
Or you can set it directly in config:
{
channels: {
twitch: {
accessToken: 'oauth:abc123...',
},
},
}
If both env and config are set, config takes precedence.
For long-term operations, config is usually easier to reason about because Twitch setups often evolve from “one test bot in one chat” into multiple channels and separate accounts.
allowFrom: most secureThe docs explicitly recommend allowFrom as the hard allowlist path.
{
channels: {
twitch: {
allowFrom: ['123456789'],
},
},
}
The values are Twitch user IDs, not usernames. The official rationale is sound: usernames can change, but user IDs are permanent.
allowedRoles: good when chat roles define trustIf you want role-based access instead of an explicit user-ID allowlist, leave allowFrom unset and use roles such as:
moderatorownervipsubscriberallExample:
{
channels: {
twitch: {
allowedRoles: ['moderator'],
},
},
}
requireMention: keep it on unless you have a strong reason not toBy default, requireMention is true.
You can disable it:
{
channels: {
twitch: {
requireMention: false,
},
},
}
But on a live public surface, that is a meaningful escalation. Keep the default until you have a moderation reason to broaden behavior.
The official docs split Twitch token handling into two paths.
Tokens from Twitch Token Generator cannot be refreshed automatically. When they expire, regenerate them.
This is fine for evaluation or low-stakes usage.
For automatic refresh, create your own Twitch application and add:
clientSecretrefreshTokenExample:
{
channels: {
twitch: {
clientSecret: 'your_client_secret',
refreshToken: 'your_refresh_token',
},
},
}
The docs state that the bot refreshes tokens before expiration and logs refresh events.
The safest Twitch proof is narrow and deliberate.
openclaw doctor
openclaw channels status --probe
channel.requireMention is on by default.That final negative test matters on Twitch more than on many other channels.
The official docs give a compact but useful first-pass troubleshooting map.
If the bot does not respond, check whether your user ID is in allowFrom.
For testing only, the docs suggest temporarily removing allowFrom and using:
{
channels: {
twitch: {
allowedRoles: ['all'],
},
},
}
That is a good diagnostic move, but not a recommended steady state.
The bot must join the channel named in channel.
A valid token alone does not mean the bot is present in the chat room you are testing.
For connection or authentication errors, the docs say to verify:
accessToken is the OAuth access token value and typically starts with oauth:,chat:read and chat:write,clientSecret and refreshToken are set.If logs say token refresh is disabled, the docs point to the same missing pieces:
clientSecretrefreshTokenThe presence of expiresIn alone is not the same as having a renewable token setup.
Twitch supports channels.twitch.accounts for per-account configuration.
That is useful when you want:
Example from the official docs:
{
channels: {
twitch: {
accounts: {
channel1: {
username: 'openclaw',
accessToken: 'oauth:abc123...',
clientId: 'xyz789...',
channel: 'vevisk',
},
channel2: {
username: 'openclaw',
accessToken: 'oauth:def456...',
clientId: 'uvw012...',
channel: 'secondchannel',
},
},
},
},
}
The docs add one crucial constraint: each account needs its own token.
For most Twitch deployments, the safest steady state is:
allowFrom or a narrow allowedRoles rule,Twitch is not the place to discover your access-control policy by accident.
Twitch is strongest as a community-facing live surface.
Use it when you want OpenClaw to show up in stream chat with clear boundaries. It is not a replacement for a private operator lane. In practice it works best when paired with a quieter admin or fallback channel elsewhere.
Verification & references
References