PHP code example of choccybiccy / twitch-tokens

1. Go to this page and download the library: Download choccybiccy/twitch-tokens 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/ */

    

choccybiccy / twitch-tokens example snippets


use Twitch\Auth\Token\Verifier;

$verifier = new Verifier;
if ($token = $verifier->verifyToken('token-string')) {
    $id = $token->get('sub');
    var_dump($token->toArray());
}