Simple Client for Twitch-Api https://dev.twitch.tv/docs/api/reference
// see https://dev.twitch.tv/docs/authentication/getting-tokens-oauth
$clientId = 'CLIENT_ID';
$authorization = 'AUTHORIZATION';
$client = new \Padhie\TwitchApiBundle\TwitchClient(
new \GuzzleHttp\Client(),
new \Padhie\TwitchApiBundle\Request\RequestGenerator($clientId, $authorization),
new \Padhie\TwitchApiBundle\Response\ResponseGenerator(),
);
$request = new \Padhie\TwitchApiBundle\Request\Channels\GetChannelInformationRequest($broadcasterId);
$response = $client->send($request);
assert($response instanceof \Padhie\TwitchApiBundle\Response\Channels\GetChannelInformationResponse);
$title = $response->getChannels()[0]->getTitle();
$request = new \Padhie\TwitchApiBundle\Request\Users\GetUsersFollowsRequest($broadcasterId);
$response = $client->sendWithPagination($request);
assert($response instanceof \Padhie\TwitchApiBundle\Request\Users\GetUsersFollowsResponse);
$users = $response->getUsers();
- implement Namespaces
- Ads
- Analytics
- Bits
- ChannelPoints
- Channels
- Chat
- Clips
- Entitlements
- EventSub
- Extensions
- Games
- Goals
- HypeTrain
- Moderation
- Music
- Polls
- Predictions
- Schedule
- Search
- Streams
- Subscriptions
- Tags
- Teams
- Users
- Videos
- tests with Response Examples (from Documentation)
- implement Parallel Request
- implement Async Request