Skip to content

Prerequisites

Dani K edited this page Apr 29, 2024 · 1 revision

Before creating your own bot, you must follow these steps:

  1. Go to your console in Twitch Developers.

  2. Register a Chat Bot application. After this, you can get your application's client ID and client secret.

  3. Get an OAuth Token here. This token will let your bot to join IRC chats.

  4. With your applicaciont's data, a bot can get an app access token. However, this token won't let the bot's API client use many of the API's endpoints. For using these endpoints, the bot must get an user access token using an authorization code. You can get this code navigating to https://id.twitch.tv/oauth2/authorize specifying the following parameters:

    • client_id. Your app’s registered client ID.
    • redirect_uri. Your app’s registered redirect URI. The authorization code is sent to this URI.
    • response_type. Must be set to code.
    • scope. A space-delimited list of scopes. The APIs that you’re calling will identify the scopes you must list. You must URL encode the list.
    • force_verify (optional). Set to true to force the user to re-authorize your app’s access to their resources. The default is false.
    • state (optional). Although optional, you are strongly encouraged to pass a state string to help prevent Cross-Site Request Forgery (CSRF) attacks. The server returns this string to you in your redirect URI (see the state parameter in the fragment portion of the URI). If this string doesn’t match the state string that you passed, ignore the response. The state string should be randomly generated and unique for each OAuth request.

    If the user authorized your app by clicking Authorize, the server sends the authorization code to your redirect URI.

Clone this wiki locally