padhie / twitch-api-bundle
Simple Client for Twitch-Api https://dev.twitch.tv/docs/api/reference
2.0.4
2023-11-18 10:23 UTC
Requires
- php: ^8.2
- ext-curl: *
- ext-json: *
- guzzlehttp/guzzle: ^7.4
- guzzlehttp/promises: ^1.5
- guzzlehttp/psr7: ^2.1
- psr/http-message: ^1.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.6
- maglnet/composer-require-checker: ^3.8
- phpstan/phpstan: ^1.5
- phpunit/phpunit: ^9.6
- rector/rector: ^0.18.10
- dev-master
- 2.0.4
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- 2.0.0-BETA2
- 2.0.0-BETA1
- 1.2.4
- 1.2.3
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.15
- 1.1.14
- 1.1.13
- 1.1.12
- 1.1.11
- 1.1.9
- 1.1.8
- 1.1.7
- 1.1.5
- 1.1.4
- 1.1.2
- 1.0.7
- 1.0.5
- 1.0.1
- 1.0.0
- dev-php-8.2
- dev-dependabot/composer/guzzlehttp/psr7-2.4.5
- dev-multiple_stream_search
- dev-dependabot/composer/guzzlehttp/guzzle-7.4.5
- dev-master_v1
This package is auto-updated.
Last update: 2024-04-18 11:24:44 UTC
README
Simple Client for Twitch-Api https://dev.twitch.tv/docs/api/reference
How to use
Create Client
// 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(), );
send Single Request
$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();
send Pagination Request
$request = new \Padhie\TwitchApiBundle\Request\Users\GetUsersFollowsRequest($broadcasterId); $response = $client->sendWithPagination($request); assert($response instanceof \Padhie\TwitchApiBundle\Request\Users\GetUsersFollowsResponse); $users = $response->getUsers();
Todo
- 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