unofficial_twitch_open_api 0.0.3 copy "unofficial_twitch_open_api: ^0.0.3" to clipboard
unofficial_twitch_open_api: ^0.0.3 copied to clipboard

Wrapper for the newest Twitch API. It returns informations about channels, media, search and game

📦 unofficial_twitch_auth #

This package allows to retrieve all the data by the newest Twitch APIs.

Available on pub.dev: https://pub.dev/packages/unofficial_twitch_open_api

Getting started #

To make the APIs works, you need to configure your application on Twitch Dev Console. If you don't how to do, please follow the steps here .

To access to the Twitch's data, was implemented the class TwitchManagerOpenApi. This utility create an instance of the available subclass of BaseTwitchOpenApi.

/// You can create the instance of [TwitchManagerOpenApi] via provider or get_it
/// An example below:
List<SingleChildWidget> _initProvider() {
  String clientId = 'your_secret_client_id';

  return [
    Provider<TwitchManagerOpenApi>(
      create: (ctx) =>
          TwitchManagerOpenApi(
            clientId: clientId,
          ),
    ),
  ];
}

/// Then, you can use the instance created previously to retrieve the subclass needed
T getInstance<T extends BaseTwitchOpenApi>() {
  final manager = Provider.of<TwitchManagerOpenApi>();

  return manager.of<T>(bearerToken: 'your_secret_token');
}

/// Finally, use the instance. An example below:
final channelInfo = getInstance<TwitchChannelInformation>(
  bearerToken: 'your_secret_token',
).getChannelInformation(broadcasterId: broadcasterId);
6
likes
140
pub points
0%
popularity

Publisher

verified publisherfedericoviceconti.com

Wrapper for the newest Twitch API. It returns informations about channels, media, search and game

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, http, unofficial_twitch_http

More

Packages that depend on unofficial_twitch_open_api