View Source mix twitch.auth (hello_twitch_api v0.5.1)

A task for getting an OAuth access token from Twitch, using the authorization code flow.

NOTE: To use this, you need to add the local listener to your app's redirect urls:

http://localhost:42069/oauth/callback

Where 42069 is the default --listen-port value. Change the port to match any value you use for this if you specify it yourself.

Usage

mix twitch.auth [OPTION]

Options

  • --output - Specify how we want to output the token. Valid values are: json, priv, .env, .envrc, stdout, clipboard. NOTE: Only priv, json, and stdout are supported currently.
  • --listen-port - The port that the temporary web server will listen on. Defaults to 42069 if not set.
  • --listen-timeout - The time in ms that the server waits for a the twitch redirect with the authorization code. Defaults to 300_000 if not set.

Auth Options

  • --client-id - The Twitch client ID for your app. Defaults to the value of the TWITCH_CLIENT_ID env var if not set.
  • --client-secret - The Twitch client secret for your app. Defaults to the value of the TWITCH_CLIENT_SECRET env var if not set.
  • --auth-scope - The Twitch auth scope for your app. A space-separated string. Defaults to the value of the TWITCH_AUTH_SCOPE env var if not set. If the env var is not set, it defaults to the default_scope list, which should be all read scopes except for whisper and stream_key.

ENV Vars

  • TWITCH_CLIENT_ID - The Twitch client ID for your app.
  • TWITCH_CLIENT_SECRET - The Twitch client secret for your app.
  • TWITCH_AUTH_SCOPE - The Twitch scopes as a space-separated string.