PHP code example of ritero / twitch-sdk

1. Go to this page and download the library: Download ritero/twitch-sdk library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ritero / twitch-sdk example snippets


use \jofner\SDK\TwitchTV\TwitchSDK;

$twitch = new TwitchSDK;
...



use \jofner\SDK\TwitchTV\TwitchSDK;
use \jofner\SDK\TwitchTV\TwitchSDKException;

$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');
...