twitch_client 0.0.4 icon indicating copy to clipboard operation
twitch_client: ^0.0.4 copied to clipboard

A package for developers to interact with the Twitch API easily, not all endpoints are implemented yet but they will eventually.

This package is a work in progress and doesn't have everything implemented yet but it will be updated regularly. #

PS : Event subs are still a work in progress.

PSS : This is my first library ever, any kind advice/criticism is very welcome :)

Twitch Client is a package that allows you to connect with the Twitch API and interact with data like Bits, Channels, Chats, Games, and Moderation ... Twitch API documentation:>

Features #

Getting started #

Register an app here : The redirection URL and the client id are needed to connect with the API.

Usage #

Create a TwitchInterface object.

var twitchInterface = TwitchInterface(
    redirectionURL: 'url',
    clientid: 'clientID';

Retrieve the URL you will use in a webview to let the user connect with its account. The method getConnectionUrl must have a list of scopes, all scopes are available in the library.

final uri = twitchInterface.getConnectionUrl(
              scopes: TwitchApiScopes.allScopes);

Once the connection is done, the redirection URL will contain the user access token. Something like: Give the URL that was returned after using logged in to the package and it will parse the URL to keep the access token and add it to the TwitchInterface, this information is not kept across sessions, you will have to do this logic yourself.

twitchInterface.init(url: 'url');

Additional information #

IMPORTANT: Verify token

As per twitch documentation, you should validate the access token every hour, they can audit your app and ask you to resolve the issue if you don't do it. More here:

Please call validateToken() to do this request.

Available requests so far : #

  • Start Commercial
  • Get Extension Analytics
  • Get Game Analytics
  • Get Bits Leaderboard
  • Get Cheermotes
  • Get Channel Information
  • Modify Channel Information
  • Get Channel Editors
  • Get Followed Channels
  • Get Channel Followers
  • Get Chatters
  • Get Chat Settings
  • Update Chat Settings
  • Ban User
  • Unban User
  • Get Moderators
  • Add Channel Moderator
  • Remove Channel Moderator
  • Get VIPs
  • Add Channel VIP
  • Remove Channel VIP
  • Get Polls
  • Create Poll
  • End Poll
  • Get Predictions
  • Create Prediction
  • End Prediction
  • Get Users
  • Update User
  • Get Users Follows
  • Get User Block List
  • Block User
  • Unblock User
  • Get Videos
  • Delete Videos
  • Create Custom Rewards
  • Delete Custom Rewards
  • Get Custom Rewards
  • Get Custom Reward Redemptions
  • Update Custom Reward
  • Update Custom Reward Redemption
  • Get Streams
  • Get Followed Streams
  • Get Stream Key
pub points


unverified uploader

A package for developers to interact with the Twitch API easily, not all endpoints are implemented yet but they will eventually.

Repository (GitHub)


API reference


Icon for licenses.BSD-3-Clause (LICENSE)


dartz, dio, flutter, freezed_annotation, http_mock_adapter, json_annotation, web_socket_channel


Packages that depend on twitch_client