Where do twitch developer apps fit in with chat bots?

I am trying to understand the relationship between a twitch developer app and building a chat bot. My understanding so far is – people build chat bots by creating a new Twitch user, then programmatically communicating with Twitch chat through IRC (often with the TMI library) using that bot account. You don’t need a developer app for this, just a phony user right?

I am also aware that there are Twitch developer apps, and one possible use case is to make a chat bot. But I’m not really seeing how or why. Biggest roadblock for me is: apps don’t have a username… so how are they supposed to chat?

If you can help me understand I would really appreciate it!

Logging into chat is done by using an oauth token with the chat_login scope. Oauth tokens are given to applications, when a user authorizes the application to communicate with Twitch on their behalf, limited by the scopes used in the auth process.

So you need an application to get the chat login token. If you want to do more with the API than just chat, you’ll also need a client ID to use the HTTP API.


In order to do anything you need an oauth key IRC/chat wise

In order to login to chat and well chat you need an oauth key with the chat_login scope

That’s where the clientID and application comes in

Sure there are a couple of tools out there for just generating a chat_login oauth key. But just use your own app and keys for that.

EDIT: NINJA’d by 3v. Damn you iPhone


Cool thanks… could you link me to an open source project / example demonstrating this, preferably with javascript and Node?

If you are just curious about a chat-bot, Google returns the following as the top answer:

Thanks yes but this is showing the ‘use a tool to generate an oauth password’ flow. I am looking for an example which is more like the flows described by @BarryCarlyon and @3ventic

You can get the chat oauth by logging in as your bot account and then logging into https://twitchapps.com/tmi. The password then is the entire string, oauth:oauth_string This website gets the permission for the chat_login scope for the account that requests it.

If you are wanting to get permission from another user, then you will need setup a web page that you register as a callback with Twitch (especially for user facing items). If you are just playing around through your own account, then you can point Twitch to localhost and you will need to setup a webpage that handles the requests back from Twitch.

That is all fairly well documented here:

There are examples using curl from the command line to do what you want.

1 Like

thanks for your help @IllusionaryOne , everyone!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.