सार्वजनिक जानकारी से बना चयन मार्गदर्शन। केवल संदर्भ हेतु।
एक शुद्ध Dart पैकेज जो Twitch.tv के API से OAuth आईम्प्लिसिट प्रमाणीकरण का उपयोग करके कनेक्ट करने के लिए एक वрапर प्रदान करता है। यह Twitch की सेवाओं के साथ एकीकरण को सरल बनाता है, जिससे डेवलपर्स को उपयोगकर्ताओं को प्रमाणित करने और स्ट्रीम, चैनल और उपयोगकर्ता जानकारी जैसे सार्वजनिक डेटा तक पहुँच प्राप्त करने में सक्षम बनाता है। यह पैकेज Android, iOS, Web, macOS, Windows और Linux जैसे कई प्लेटफॉर्म को समर्थन देता है, जिससे यह क्रॉस-प्लेटफॉर्म एप्लिकेशन के लिए आदर्श है। उपयोग में आसान डिज़ाइन के साथ, यह OAuth फ्लो की जटिलताओं को संभालता है जबकि ट्विच के वर्तमान प्रमाणीकरण मानकों के साथ सुरक्षा और संगतता बनाए रखता है।
उपयोग
Twitch लॉगिन कार्यक्षमता को एकीकृत करना
लाइव स्ट्रीम डेटा लोड कर रहा है
उपयोगकर्ता और चैनल की जानकारी तक पहुंच
Twitch-आधारित सोशल ऐप्स बनाना
स्ट्रीमर्स के लिए डैशबोर्ड बनाना
मुख्य विशेषताएँ
OAuth अप्रमाणित प्रमाणीकरण
प्लेटफॉर्म के अनुकूल समर्थन
शुद्ध डार्ट कार्यान्वयन
सरल API इंटरफेस
सुरक्षित τोकन संभाल
इनके लिए उपयुक्त
Twitch एकीकरण की आवश्यकता वाले Flutter ऐप्स
स्ट्रीम मॉनिटरिंग टूल्स
Twitch समुदाय प्लेटफॉर्म
Twitch सामग्री के लिए विकास साधन
बहु-प्लेटफॉर्म एप्लिकेशन
विचार योग्य बातें
सही ट्विच ऐप पंजीकरण की आवश्यकता है
OAuth अप्रत्यक्ष प्रवाह तक सीमित
Twitch API दर सीमाओं पर निर्भर करता है
रिफ्रेश टोकन का सावधानीपूर्वक उपयोग करने की आवश्यकता है
सर्वर-पक्ष ऑपरेशन के लिए उपयुक्त नहीं
मूल README
संबंधित सोर्स रिपॉज़िटरी के मूल README का स्नैपशॉट। नवीनतम सामग्री के लिए रिपॉज़िटरी देखें।
twitch_api
A wrapper in pure Dart to connect to Twitch.tv using OAuth implicit authentication.
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 webviewFuture<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);
returnNavigator.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)