PHP code example of adamhebby / glimeshclient

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

    

adamhebby / glimeshclient example snippets




use GlimeshClient\Adapters\Authentication\OAuthFileAdapter;
use GlimeshClient\Client;
use GlimeshClient\Objects\Enums\ChannelStatus;
use GraphQL\Query;
use GuzzleHttp\Client as GuzzleHttpClient;
use Symfony\Component\Dotenv\Dotenv;

'allow_redirects' => true]);

$client = new Client(
    $guzzle,
    new OAuthFileAdapter(
        $_ENV['CLIENT_ID'],
        $_ENV['CLIENT_SECRET'],
        '/tmp/auth.json'
    ),
    $logger
);

$object = $client->makeRequest(
    (new Query('channels'))->setSelectionSet([
        'id',
        (new Query('stream'))->setSelectionSet([
            'thumbnail',
        ]),
    ])->setArguments(['status' => 'ENUM:' . ChannelStatus::LIVE])
);

var_dump($object);