This is unofficial TwitchTV SDK for PHP. SDK is currently under development, so functions, readme and/or examples will change.
TwitchTV SDK for v3 API is under development
There is develop branch, which takes place in refactoring existing features. Because I need to develop SDK and also have it functional, rewriting functions carried out in phases. If you have questions or suggestions regarding the development of the new version, you can use Issues
Version 2.* changed namespace! I know it's not best practice and i'm really sorry, but i have my reasons for that. Thanks for understanding. Version 2.* has BC breaks and lot of changes. Be careful with updating! Before updating thoroughly examine the changes and adjust your application for modified functions.
TwitchTV SDK for PHP requires PHP 5.3.0 or later with cURL.
The best way to install TwitchTV SDK is use Composer.
$ composer require 'ritero/twitch-sdk:~1.0'{
"require": {
// ..
"ritero/twitch-sdk": "~1.0"
}
}The downloaded package includes the src directory. This directory contains
the source code of TwitchTV SDK for PHP. This is the only directory
that you will need in order to deploy your application.
Basic functions starts with standard naming policy (user*, channel* etc.) -
userGet() for example. Authenticated functions have auth* prefixes,
like authUserGet().
use \ritero\SDK\TwitchTV\TwitchSDK;
$twitch = new TwitchSDK;
...require '/path/to/libs/ritero/SDK/TwitchTV/TwitchSDK.php';
require '/path/to/libs/ritero/SDK/TwitchTV/TwitchException.php';
use \ritero\SDK\TwitchTV\TwitchSDK;
use \ritero\SDK\TwitchTV\TwitchException;
$twitch = new TwitchSDK;
...$twitch = new TwitchSDK;
$channel = $twitch->channelGet('channelname');
...$twitch_config = array(
'client_id' => 'your_twitch_app_client_id',
'client_secret' => 'your_twitch_app_client_secret',
'redirect_uri' => 'your_twitch_app_redirect_uri',
);
$twitch = new TwitchSDK($twitch_config);
$loginURL = $twitch->authLoginURL('user_read');
...More examples you can find soon at Wiki pages.
Refer to the LICENSE.md file for license information