パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v0.7.0

twitch_api

OAuth 暗黙認証を使用して Twitch.tv に接続するための純粋な Dart のラッパー。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
101
いいね数
21
Pub ポイント
150

パッケージをインストール

flutter pub add twitch_api

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

OAuth暗黙認証を使用してTwitch.tvのAPIに接続するためのラッパーを提供する純粋なDartパッケージです。Twitchのサービスとの統合を簡素化し、開発者がユーザーを認証し、ストリーム、チャンネル、ユーザー情報などの公開データにアクセスできるようにします。このパッケージはAndroid、iOS、Web、macOS、Windows、Linuxなど複数のプラットフォームをサポートしており、クロスプラットフォームアプリに最適です。使いやすさを重視した設計により、OAuthフローの複雑さを処理しつつ、Twitchの現在の認証基準と互換性があり、セキュリティも確保しています。

用途

  • Twitchログイン機能の統合
  • ライブストリームデータを取得中
  • ユーザーおよびチャンネル情報にアクセス
  • Twitchを活用したソーシャルアプリの構築
  • ストリーマー用のダッシュボードを作成する

主な機能

  • OAuth 暗黙の認証
  • クロスプラットフォーム対応
  • 純粋なDart実装
  • シンプルなAPIインターフェース
  • セキュアなトークン処理

適している対象

  • Twitch統合が必要なFlutterアプリ
  • ストリームモニタリングツール
  • Twitchコミュニティプラットフォーム
  • Twitchコンテンツ用の開発ツール
  • マルチプラットフォームアプリケーション

注意事項

  • 適切なTwitchアプリの登録が必要です
  • OAuth 暗黙的フローに限定
  • Twitch API のレート制限に依存
  • リフレッシュトークンの取り扱いに注意が必要です
  • サーバーサイドの操作には適していません

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

twitch_api

Dart Pub Coverage Status style: lint

A wrapper in pure Dart to connect to Twitch.tv using OAuth implicit authentication.

All the endpoints are implemented as defined in the Twitch API Reference

Getting started

NOTE: This package is in its early stage, please be patient until more methods are implemented or do not hesitate to open a merge request if you added support for an endpoint. Currently I do not have a roadmap of the endpoint I am going to add in priority so do not hesitate to open an issue to make suggestions depending of your needs.

To use this package you will need to register an application on the Twitch developer console to get a client ID.

After registering your application you will need to instantiate the TwitchClient class from the package with your clientId and your redirectUri .

import 'package:twitch_api/twitch_api.dart';

final _twitchClient = TwitchClient(
  clientId: clientId,
  redirectUri: redirectUri,
);

Now that you have initialized the client the last step before using the method will be to manage the first connection with your twitch account and initialize the token you will receive. You can find a complete example of an implementation using the package flutter_webview_plugin.

const clientId = "<YOUR_CLIENT_ID>";
const redirectUri = "<YOUR_REDIRECT_URL>"; // ex: "http://localhost/"

final _twitchClient = TwitchClient(
  clientId: clientId,
  redirectUri: redirectUri,
);

final _flutterWebviewPlugin = FlutterWebviewPlugin();

// First authentication through a webview
Future<TwitchToken> _openConnectionPage({
  List<TwitchApiScope> scopes = const [],
}) {
  // Listen for url changes to detect redirection on our redirectUri.
  _flutterWebviewPlugin.onUrlChanged.listen((url) {
    if (url.startsWith(_twitchClient.redirectUri)) {
      // After you got to your redirectUri you can initialize the token.
      _twitchClient.initializeToken(TwitchToken.fromUrl(url));

      // Close the webview
      _flutterWebviewPlugin.close();
    }
  });

  // When the webview is closed pop the current route.
  _flutterWebviewPlugin.onDestroy.listen((_) => Navigator.pop(context));

  // Get authorization URL for the connection with the webview.
  final _url = _twitchClient.authorizeUri(scopes);

  return Navigator.push(
    context,
    MaterialPageRoute(
      builder: (context) => WebViewPage(_url.toString()),
    ),
  ).then((_) => _twitchClient.twitchHttpClient.validateToken());
}

Now you are ready to use the methods implemented in Supported Endpoints section.

Supported Endpoints

Ads
  • [x] Start Commercial
Analytics
  • [x] Get Extension Analytics
  • [x] Get Game Analytics (Documentation in progress)
Bits
  • [x] Get Bits Leaderboard
  • [x] Get Cheermotes
  • [x] Get Extension Transactions
Channels
  • [x] Get Channel Information
  • [x] Modify Channel Information
  • [x] Get Channel Editors
Channel Points
  • [x] Create Custom Rewards
  • [x] Delete Custom Reward
  • [x] Get Custom Reward
  • [x] Get Custom Reward Redemption
  • [x] Update Custom Reward
  • [x] Update Redemption Status
Chat
  • [x] Get Channel Emotes
  • [x] Get Global Emotes
  • [x] Get Emote Sets
  • [x] Get Channel Chat Badges
  • [x] Get Global Chat Badges
  • [x] Get Chat Settings
  • [ ] Update Chat Settings
Clips
  • [x] Create Clip
  • [x] Get Clips
Entitlements
  • [ ] Create Entitlement Grants Upload URL
  • [ ] Get Code Status
  • [ ] Get Drops Entitlements
  • [ ] Redeem Code
Extensions
  • [ ] Get Extension Configuration Segment
  • [ ] Set Extension Configuration Segment
  • [ ] Set Extension Required Configuration
  • [ ] Send Extension PubSub Message
  • [ ] Get Live Channels
  • [ ] Get Extension Secrets
  • [ ] Create Extension Secret
  • [ ] Send Extension Chat Message
  • [ ] Get Extensions
  • [ ] Get Released Extensions
  • [ ] Get Extension Bits Products
  • [ ] Update Extension Bits Product
EventSub
  • [ ] Create EventSub Subscription
  • [ ] Delete EventSub Subscription
  • [ ] Get EventSub Subscriptions
Games
  • [x] Get Top Games
  • [x] Get Games
Hype Train
  • [ ] Get Hype Train Events
Moderation
  • [ ] Check AutoMod Status
  • [ ] Get Banned Events
  • [ ] Get Banned Users
  • [ ] Get Moderators
  • [ ] Get Moderator Events
Polls
  • [ ] Get Polls
  • [ ] Create Poll
  • [ ] End Poll
Predictions
  • [ ] Get Predictions
  • [ ] Create Prediction
  • [ ] End Prediction
Schedule
  • [ ] Get Channel Stream Schedule
  • [ ] Get Channel iCalendar
  • [ ] Update Channel Stream Schedule
  • [ ] Create Channel Stream Schedule Segment
  • [ ] Update Channel Stream Schedule Segment
  • [ ] Delete Channel Stream Schedule Segment
Search
  • [x] Search Categories
  • [x] Search Channels
Streams
  • [ ] Get Stream Key
  • [x] Get Streams
  • [ ] Create Stream Marker
  • [ ] Get Stream Markers
Subscriptions
  • [x] Get Broadcaster Subscriptions
Tags
  • [ ] Get All Stream Tags
  • [ ] Get Stream Tags
  • [ ] Replace Stream Tags
Users
  • [x] Get Users
  • [ ] Update User
  • [x] Get Users Follows
  • [ ] Create User Follows
  • [ ] Delete User Follows
  • [ ] Get User Block List
  • [ ] Block User
  • [ ] Unblock User
  • [ ] Get User Extensions
  • [ ] Get User Active Extensions
  • [ ] Update User Extensions
Videos
  • [ ] Get Videos
  • [ ] Delete Videos
Webhooks
  • [ ] Get Webhook Subscriptions

Contributors

TesteurManiak
Guillaume Roux
matteo0158
LaCremeDoree
LewisHolliday
Lewis Holliday

カテゴリー

依存関係

依存関係一覧 3 件

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。