vertisan / oauth2-twitch-helix
Twitch (new version Helix) OAuth 2.0 Client Provider for The PHP League OAuth2-Client
Installs: 29 520
Dependents: 1
Suggesters: 0
Security: 0
Stars: 10
Watchers: 1
Forks: 6
Open Issues: 0
Requires
- php: >=7.1
- league/oauth2-client: ^2.2.1
Requires (Dev)
- ext-json: *
- jakub-onderka/php-parallel-lint: ^1.0
- mockery/mockery: ^1.2
- phpunit/phpunit: ^10.0.5
- squizlabs/php_codesniffer: ^3.4
README
This package provides Twitch (new version Helix) OAuth 2.0 support for the PHP League's OAuth 2.0 Client.
Installation
To install, use Composer:
composer require vertisan/oauth2-twitch-helix
Usage
Usage is the same as The League's OAuth client, using Vertisan\OAuth2\Client\Provider\TwitchHelix
as the provider.
$provider = new \Vertisan\OAuth2\Client\Provider\TwitchHelix([ 'clientId' => "YOUR_CLIENT_ID", 'clientSecret' => "YOUR_CLIENT_SECRET", 'redirectUri' => "http://your-redirect-uri-passed-in-twitch-dashboard", ]);
You can also optionally add a scopes
key to the array passed to the constructor. The available scopes are documented
on the New Twitch API Reference.
Testing
$ ./vendor/bin/phpunit