almostinteractive/mixer-php-client

A PHP client for Mixer.com OAuth and APIs

Installs: 20

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/almostinteractive/mixer-php-client

v0.1.1 2019-08-26 19:06 UTC

This package is auto-updated.

Last update: 2025-11-27 09:02:29 UTC


README

A PHP 7.1 library for interfacing with the Mixer.com API.

Installation

composer require almostinteractive/mixer-php-client

Usage Example

$mixerGuzzleClient = new MixerGuzzleClient('MY_CLIENT_ID');
$apiClient = new MixerApi('MY_CLIENT_ID', 'MY_CLIENT_SECRET', $mixerGuzzleClient);


$scope = [
    'channel:analytics:self',
    'channel:details:self',
    'user:details:self'
];
$scope = implode('%20', $scope);
$authUrl = $apiClient->getOauthApi()->getAuthUrl('http://localhost/callback.php', 'code', $scope, true, null);


$response = $apiClient->getOauthApi()->getUserAccessToken($code, 'http://localhost/callback.php');
$token = json_decode($response->getBody()->getContents(), true);
$accessToken = $token['access_token'];
$refreshToken = $token['refresh_token'];

$response = $apiClient->getUsersApi()->getUserByAccessToken($accessToken);
$userData = json_decode($response->getBody()->getContents(), true);

Notes from the Author

I plan on only adding the endpoints as I need them. Pull requests welcome. Requests will be duly considered.