Twitch Helix API PHP Wrapper for Laravel

Overview

Laravel Twitch

Latest Stable Version Total Downloads License GitHub Build Status

PHP Twitch Helix API Wrapper for Laravel 5+

⚠️ Changes on May 01, 2020

Since May 01, 2020, Twitch requires all requests to contain a valid OAuth Access Token. This can be achieved by requesting an OAuth Token using the Client Credentials Flow.

If you don't handle this by yourself, be sure to enable the built-in Access Token generation feature via the oauth_client_credentials.auto_generate configuration entry.

You will need define a valid Client ID and Client Secret via your config or the available setters! See the full config for more details.

Table of contents

  1. Installation
  2. Configuration
  3. Examples
  4. Documentation
  5. Upgrading
  6. Development

Installation

composer require romanzipp/laravel-twitch

Configuration

Copy configuration to project:

php artisan vendor:publish --provider="romanzipp\Twitch\Providers\TwitchServiceProvider"

Add environmental variables to your .env:

TWITCH_HELIX_KEY=
TWITCH_HELIX_SECRET=
TWITCH_HELIX_REDIRECT_URI=http://localhost

If you want to use the EventSub with the Webhook transport, then you are required to define a secret. This secret is a string between 10 and 100 characters.

TWITCH_HELIX_EVENTSUB_SECRET=

Examples

Basic

$twitch = new romanzipp\Twitch\Twitch;

$twitch->setClientId('abc123');

// Get User by Username
$result = $twitch->getUsers(['login' => 'herrausragend']);

// Check, if the query was successful
if ( ! $result->success()) {
    return null;
}

// Shift result to get single user data
$user = $result->shift();

return $user->id;

Setters

$twitch = new romanzipp\Twitch\Twitch;

$twitch->setClientId('abc123');
$twitch->setClientSecret('abc456');
$twitch->setToken('abcdef123456');

$twitch = $twitch->withClientId('abc123');
$twitch = $twitch->withClientSecret('abc123');
$twitch = $twitch->withToken('abcdef123456');

OAuth Tokens

$twitch = new romanzipp\Twitch\Twitch;

$twitch->setClientId('abc123');
$twitch->setToken('abcdef123456');

$result = $twitch->getUsers(['login' => 'herrausragend']);

OAuth Client Credentials Flow

Since May 01, 2020, every request requires an OAuth token which can be issued using the OAuth Client Credentials Flow.

use romanzipp\Twitch\Enums\GrantType;
use romanzipp\Twitch\Twitch;

$twitch = new Twitch;

$twitch->setClientId('abc123');
$twitch->setClientSecret('def123');
$twitch->setToken('abcdef123456');

$result = $twitch->getOAuthToken(null, GrantType::CLIENT_CREDENTIALS, ['user:read']);

if ( ! $result->success()) {
    return;
}

$accessToken = $result->data()->access_token;

Pagination

The Twitch API returns a paginator field with paginated results like /streams, /followsor /games. To jump between pages, the given cursor must be appended to the following query using the direction attributes after or before.

In this example, we will fetch a set of streams and use the provided cursor to switch to the next/previous set of data.

❗️ To prevent infinite loops or errors, use the Result::hasMoreResults() method to check if there are more results available.

$twitch = new romanzipp\Twitch\Twitch;

// Page 1
$firstResult = $twitch->getStreams(['language' => 'de']);

// Page 2
$secondResult = $twitch->getStreams(['language' => 'de'], $firstResult->next());

// Page 1 (again)
$thirdResult = $twitch->getStreams(['language' => 'de'], $secondResult->back());

Facade

use romanzipp\Twitch\Facades\Twitch;

Twitch::withClientId('abc123')->withToken('abcdef123456')->getUsers();

Pagination Loop Example

This example fetches all Twitch Games and stores them into a database.

use romanzipp\Twitch\Twitch;

$twitch = new Twitch;

do {
    $nextCursor = null;

    // If this is not the first iteration, get the page cursor to the next set of results
    if (isset($result)) {
        $nextCursor = $result->next();
    }

    // Query the API with an optional cursor to the next results page
    $result = $twitch->getTopGames(['first' => 100], $nextCursor);

    foreach ($result->data() as $item) {
        // Process the games result data
    }

    // Continue until there are no results left
} while ($result->hasMoreResults());

Insert user objects

The new API does not include the user objects in endpoints like followers or bits.

[
  {
    "from_id": "123456",
    "to_id": "654321",
    "followed_at": "2018-01-01 12:00:00"
  }
]

You can just call the insertUsers method to insert all user data identified by from_id into from_user

use romanzipp\Twitch\Twitch;

$twitch = new Twitch;

$result = $twitch->getUsersFollows(['to_id' => 654321]);

$result->insertUsers($twitch, 'from_id', 'from_user');

New Result data:

[
  {
    "from_id": "123456",
    "to_id": "654321",
    "followed_at": "2018-01-01 12:00:00",
    "from_user": {
      "id": "123456",
      "display_name": "HerrAusragend",
      "login": "herrausragend"
    }
  }
]

Defining EventSub Handlers

By default, the EventSub webhook controller will automatically handle all EventSub notification and revocation calls; however, if you have additional webhook events you would like to handle, you may do so by extending the EventSub webhook controller.

To ensure your application can handle EventSub webhooks, be sure to configure the webhook callback url in the transport payload.

Your controller's method names should correspond to Laravel Twitch's controller conventions. Specifically, methods should be prefixed with handle, suffixed with Notification and the "camel case" name of the EventSub Type you wish to handle. For example, if you wish to handle the channel.follow type, you should add a handleChannelFollowNotification method to the controller:



namespace App\Http\Controllers;

use romanzipp\Twitch\Http\Controllers\EventSubController as BaseController;
use Symfony\Component\HttpFoundation\Response;

class EventSubController extends BaseController
{
    public function handleChannelFollowNotification(array $payload): Response
    {
        return $this->successMethod(); // handle the channel follow notification...
    }

    protected function handleNotification(array $payload): Response
    {
        return $this->successMethod(); // handle all other incoming notifications...
    }

    protected function handleRevocation(array $payload): Response
    {
        return $this->successMethod(); // handle the subscription revocation...
    }
}

Next, define a route to your EventSub webhook controller within your application's routes/api.php file.

use App\Http\Controllers\EventSubController;

Route::post(
    'twitch/eventsub/webhook',
    [EventSubController::class, 'handleWebhook']
);

Create EventSub Subscription

Important: When creating a subscription, you must specify a secret for purposes of verification, described above in “Configuration”. This secret is automatically attached to the webhook transport if it is not explicitly defined.

use romanzipp\Twitch\Enums\EventSubType;
use romanzipp\Twitch\Twitch;

$twitch = new Twitch;


$twitch->subscribeEventSub([], [
    'type' => EventSubType::STREAM_ONLINE,
    'version' => '1',
    'condition' => [
        'broadcaster_user_id' => '1337',
    ],
    'transport' => [
        'method' => 'webhook',
        'callback' => 'https://example.com/api/twitch/eventsub/webhook',
    ]
]);

List EventSub Subscription

use romanzipp\Twitch\Twitch;

$twitch = new Twitch;

$result = $twitch->getEventSubs(['status' => 'notification_failures_exceeded']);

foreach ($result->data() as $item) {
    // process the subscription
}

Delete EventSub Subscription

use romanzipp\Twitch\Twitch;

$twitch = new Twitch;

$twitch->unsubscribeEventSub([
    'id' => '932b34ad-821a-490f-af43-b327187d0f5c'
]);

Documentation

Twitch Helix API Documentation: https://dev.twitch.tv/docs/api/reference

OAuth

public function getOAuthAuthorizeUrl(string $responseType = 'code', array $scopes = [], ?string $state = NULL, bool $forceVerify = false)
public function getOAuthToken(?string $code = NULL, string $grantType = 'authorization_code', array $scopes = [])

Ads

public function startCommercial(array $parameters = [])

Analytics

public function getExtensionAnalytics(array $parameters = [])
public function getGameAnalytics(array $parameters = [])

Bits

public function getCheermotes(array $parameters = [])
public function getBitsLeaderboard(array $parameters = [])
public function getExtensionTransactions(array $parameters = [])

ChannelPoints

public function createCustomRewards(array $parameters = [], array $body = [])
public function deleteCustomReward(array $parameters = [])
public function getCustomReward(array $parameters = [])
public function getCustomRewardRedemption(array $parameters = [], ?Paginator $paginator = NULL)
public function updateCustomReward(array $parameters = [])
public function updateRedemptionStatus(array $parameters = [], array $body = [])

Chat

public function getChannelChatEmotes(array $parameters = [])
public function getGlobalChatEmotes()
public function getChatEmoteSets(array $parameters = [])
public function getChannelChatBadges(array $parameters = [])
public function getGlobalChatBadges()

Clips

public function createClip(array $parameters = [])
public function getClips(array $parameters = [])

Entitlements

public function createEntitlementUrl(array $parameters = [])
public function getEntitlementsCodeStatus(array $parameters = [])
public function getDropsEntitlements(array $parameters = [])
public function redeemEntitlementsCode(array $parameters = [])

EventSub

public function subscribeEventSub(array $parameters = [], array $body = [])
public function unsubscribeEventSub(array $parameters = [])
public function getEventSubs(array $parameters = [], ?Paginator $paginator = NULL)

Extensions

public function getAuthedUserExtensions()
public function getAuthedUserActiveExtensions()
public function disableAllExtensions()
public function disableUserExtensionById(?string $parameter = NULL)
public function disableUserExtensionByName(?string $parameter = NULL)
public function updateUserExtensions(?string $method = NULL, ?string $parameter = NULL, bool $disabled = false)

Games

public function getTopGames(array $parameters = [], ?Paginator $paginator = NULL)
public function getGames(array $parameters = [])

HypeTrain

public function getHypeTrainEvents(array $parameters = [])

Polls

public function getPolls(array $parameters = [], ?Paginator $paginator = NULL)
public function createPoll(array $parameters = [], array $body = [])
public function endPoll(array $parameters = [], array $body = [])

Predictions

public function getPredictions(array $parameters = [], ?Paginator $paginator = NULL)
public function createPrediction(array $parameters = [], array $body = [])
public function endPrediction(array $parameters = [], array $body = [])

Search

public function searchCategories(array $parameters = [])
public function searchChannels(array $parameters = [])

Streams

public function getStreamKey(array $parameters = [])
public function getStreams(array $parameters = [], ?Paginator $paginator = NULL)
public function getFollowedStreams(array $parameters = [], ?Paginator $paginator = NULL)
public function createStreamMarker(array $parameters = [], array $body = [])
public function getStreamMarkers(array $parameters = [], ?Paginator $paginator = NULL)
public function getChannels(array $parameters = [])
public function updateChannels(array $parameters = [], array $body = [])

Users

public function createUserFollows(array $parameters = [], array $body = [])
public function deleteUserFollows(array $parameters = [])
public function getUsers(array $parameters = [])
public function getUsersFollows(array $parameters = [], ?Paginator $paginator = NULL)
public function updateUser(array $parameters = [])
public function getUserExtensions(array $parameters = [])
public function getUserActiveExtensions(array $parameters = [])
public function updateUserExtension(array $parameters = [], array $body = [])

Videos

public function getVideos(array $parameters = [], ?Paginator $paginator = NULL)

Subscriptions

public function getSubscriptions(array $parameters = [], ?Paginator $paginator = NULL)
public function getUserSubscription(array $parameters = [])

Tags

public function getStreamTags(array $parameters = [])
public function getAllStreamTags(array $parameters = [], ?Paginator $paginator = NULL)
public function replaceStreamTags(array $parameters = [], array $body = [])

Moderation

public function checkAutoModStatus(array $parameters = [], array $body = [])
public function getBannedUsers(array $parameters = [], ?Paginator $paginator = NULL)
public function getBannedEvents(array $parameters = [], ?Paginator $paginator = NULL)
public function getModerators(array $parameters = [], ?Paginator $paginator = NULL)
public function getModeratorEvents(array $parameters = [], ?Paginator $paginator = NULL)

Webhooks

public function getWebhookSubscriptions(array $parameters = [])
public function subscribeWebhook(array $parameters = [], array $body = [])
public function unsubscribeWebhook(array $parameters = [], array $body = [])
public function buildWebhookTopic(string $path, array $parameters = [])

OAuth Scopes Enums

Upgrading

Development

Run Tests

composer test
CLIENT_ID=xxxx composer test
CLIENT_ID=xxxx CLIENT_SECRET=xxxx composer test

Generate Documentation

composer docs

Join the Twitch Dev Discord!

Discord

Discord

Comments
  • Update EventSub Documentation and fix non-existent type

    Update EventSub Documentation and fix non-existent type

    Hey, I have revised the documentation a bit, so that everyone can understand how to use the EventSub.

    Also I fixed a type. There had been a typo in it. It should be channel.follow instead of user.follow.

    opened by ghostzero 11
  • Wrong glue for scopes

    Wrong glue for scopes

    Hi,

    There are two commits from you previous pull requests. Could you open a new one with your a536a57 commit?

    Have you tested the the space separated scopes? I'm not sure if the %20 default encoding is handled correctly from twitch as the documentation states + https://dev.twitch.tv/docs/authentication/#scopes

    Ohh, your right.

    opened by androidbeet 5
  • added event message id, retries and timestamp to eventsub events

    added event message id, retries and timestamp to eventsub events

    I think, adding the event id, number of retries and the timestamp is necessary to check, whether the event should still be handled when for example people try to do a replay attack or Twitch sends events multiple times.

    see: https://github.com/romanzipp/Laravel-Twitch/issues/67#issuecomment-829048428

    opened by Katzen48 4
  • How to realize a login?

    How to realize a login?

    I plan to login via Twitch.

    I have a login view.

        public function login()
        {
            return view('auth.login', [
                'authorize_url' => $this->twitch->getOAuthAuthorizeUrl($responseType = 'code')
            ]);
        }
    

    I can get the code.

        public function callback(Request $request)
        {
            Log::info($request->code);
        }
    

    But how do I get the information like email address, Twitch username & Twitch-ID from this user?

    question 
    opened by Muetze42 4
  • added missing endpoints

    added missing endpoints

    added all missing music, extension, music, teams, users and videos endpoints to the update-endpoints branch I have also added the newer endpoints (block user, unblock user, whisper, chat announcement, get/update chat color etc.)

    opened by derpierre65 3
  • Result

    Result "status"

    I'm going to keep this short, privatising "status" does nothing but add more work on someone using your package, for example getting a users subscribers, $var->status == 200/404, why make it more of a pain? Honestly......

    opened by TheOfficialDroid 3
  • New and changed eventsub subscription types

    New and changed eventsub subscription types

    Following new eventsub subscription types need to be added on top of #103

    • Subgift
    • Re-Sub Message (when sharing)
    • Extension Bits Transaction Creation

    After coming out of beta , the "channel.unsubscribe" event type was renamed to "channel.subscription.end"

    opened by Katzen48 3
  • APIs and EventSub for Polls and Predictions

    APIs and EventSub for Polls and Predictions

    Twitch released two new products for public beta today. For more information about the beta classification, see Product Lifecycle.

    I am currently still unsure with the following namings:

    • Should it be called createPolls or createPoll?
    • Should it be updatePoll or endPoll (because of the PATCH-Method)?
    • Should it be createPredictions or createPrediction?
    • Should it be updatePrediction or endPrediction (because of the PATCH-Method)?

    For createCustomRewards it is also plural. But you actually create only one reward. I would go with singular.

    Also there are now the two new environment variables for testing:

    • BROADCASTER_ID (ID of the user to test for)
    • ACCESS_TOKEN (Access Token of the user to be tested)
    opened by ghostzero 3
  • Problem with laravel timezone

    Problem with laravel timezone

    First of all, thanks for the amazing package.

    When I set app.php's zime zone to my local time zone, the eventsub webhook URL keeps throwing SignatureVerificationException with the message Timestamp outside the tolerance zone, it works when I set it back to Laravel's default though.

    Is this perhaps a problem on my side?

    opened by alitnk 3
  • Bug: Auto Generate does not work properly.

    Bug: Auto Generate does not work properly.

    I have the feeling that the oauth client credentials cache does not renew expired keys.

    I have the problem almost every month that I get the response Invalid OAuth token from the Twitch API.

    Unfortunately I could not look at it. Workaround was: Change cache key.

    opened by ghostzero 3
  • WIP: EventSub

    WIP: EventSub

    I added the new event sub implementation.

    I have also implemented an event handler to simplify the handling of EventSub (including Secret + Signature check). So you only have to extend the EventSubController and register your controller in the routes.

    Feel free to share your feedback 😃

    opened by ghostzero 3
  • Request: Add Validate endpoint

    Request: Add Validate endpoint

    Hello, Just getting started with this package and it's working nicely so far. I see in the pull requests you are working on adding some missing endpoints, I have one more that I would love for you to add.

    It's the oauth validate endpoint for validating tokens (More info here).

    Thanks for your work -Casey

    opened by CaseyBlackburn 0
  • Drop PHP 7 support

    Drop PHP 7 support

    PHP 7 has been decommissioned and security patches will be delivered November 28, 2022: https://www.php.net/supported-versions.php After that, I believe PHP 7 support can be dropped to make use of the new PHP 8 features.

    opened by Katzen48 0
  • Add CONTRIBUTING.md

    Add CONTRIBUTING.md

    I had some ideas to create a CONTRIBUTING.md file. It is intended to make it easier to get started with Contributing.

    This file is based on Contributing to Ruby on Rails. Which work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

    This is a draft.

    opened by ghostzero 0
Releases(4.0.0)
  • 4.0.0(Jan 11, 2021)

    v4.0.0

    Info: v3.0.0 Release changelog & Upgrade guide

    Changes

    • Drop support for guzzle/http 6.3
    • Remove cache driver configuration key #72
    • Move romanzipp\Twitch\Helpers\Paginator to romanzipp\Twitch\Objects\Paginator

    Exceptions

    • Remove romanzipp\Twitch\Exceptions\RequestRequiresClientIdException
    • Remove romanzipp\Twitch\Exceptions\RequestRequiresClientSecretException
    • Remove romanzipp\Twitch\Exceptions\RequestRequiresRedirectUriException
    • Add romanzipp\Twitch\Exceptions\RequestRequiresAuthenticationException

    Result class

    All previously public properties are now declared as private. Corresponding getter methods have been added.

    Properties

    • Remove romanzipp\Twitch\Result::$success property
    • Change romanzipp\Twitch\Result::$exception visibility from public to private
    • Change romanzipp\Twitch\Result::$data visibility from public to private
    • Change romanzipp\Twitch\Result::$total visibility from public to private
    • Change romanzipp\Twitch\Result::$status visibility from public to private
    • Change romanzipp\Twitch\Result::$pagination visibility from public to private

    Methods

    • Change romanzipp\Twitch\Result::status() method name to getStatus()
    • Change romanzipp\Twitch\Result::error() method name to getErrorMessage()
    • Change romanzipp\Twitch\Result::rateLimit() method name to getRateLimit()
    • Add romanzipp\Twitch\Result::getException() method
    • Add romanzipp\Twitch\Result::getTotal() method
    • Add romanzipp\Twitch\Result::getPagination() method
    • Add romanzipp\Twitch\Result::getPaginator() method
    Source code(tar.gz)
    Source code(zip)
  • 3.0.0(Sep 3, 2020)

    v3.0.0

    This major version introduces new method signatures. Since the Helix API has been widely updated with many changes in endpoints and parameters, the package now only offers a single method per endpoint.

    Previously we have provided methods like getUserByName('twitch') which has now been removed and should be replaced by getUsers(['login' => 'twitch'])

    Changes

    Methods updated

    • updated createClip to createClip(array $parameters = [])
    • updated createEntitlementUrl to createEntitlementUrl(array $parameters = [])
    • updated updateUser to updateUser(array $parameters = [])
    • updated subscribeWebhook to subscribeWebhook(array $parameters = [], array $body = [])
    • updated unsubscribeWebhook to unsubscribeWebhook(array $parameters = [], array $body = [])

    Methods removed

    • Clips
      • removed getClip, please use getClips
    • Games
      • removed getGameById, please use getGames with ['id' => ...]
      • removed getGameByName, please use getGames with ['name' => ...]
      • removed getGamesByIds, please use getGames with ['id' => ...]
      • removed getGamesByNames, please use getGames with ['name' => ...]
    • Streams
      • removed getStreamsMetadata (endpoint removed)
      • removed getStreamsByUserId, please use getStreams with ['user_id' => ...]
      • removed getStreamsByUserName, please use getStreams with ['user_login' => ...]
      • removed getStreamsByUserIds, please use getStreams with ['user_id' => ...]
      • removed getStreamsByUserNames, please use getStreams with ['user_login' => ...]
      • removed getStreamsByCommunity, please use getStreams (endpoint removed)
      • removed getStreamsByCommunities, please use getStreams (endpoint removed)
      • removed getStreamsByGame, please use getStreams with ['game_id' => ...]
      • removed getStreamsByGames, please use getStreams with ['game_id' => ...]
    • Subscriptions
      • removed getUserSubscriptions (endpoint removed)
      • removed getBroadcasterSubscriptions, please use getSubscriptions
    • Users
      • removed getAuthedUser (deprecated)
      • removed getUserById, please use getUsers with ['id' => ...]
      • removed getUserByName, please use getUsers with ['login' => ...]
      • removed getUsersByIds, please use getUsers with ['id' => ...]
      • removed getUsersByNames, please use getUsers with ['login' => ...]
    • Follows
      • removed getFollows, please use getUsersFollows
      • removed getFollowsFrom, please use getUsersFollows with ['from_id' => ...]
      • removed getFollowsTo, please use getUsersFollows with ['to_id' => ...]
    • Videos
      • removed getVideosById, please use getVideos with ['id' => ...]
      • removed getVideosByUser, please use getVideos with ['user_id' => ...]
      • removed getVideosByGame, please use getVideos with ['game_id' => ...]
    • Webhooks
      • removed webhookTopicStreamMonitor, please use buildWebhookTopic
      • removed webhookTopicUserFollows, please use buildWebhookTopic
      • removed webhookTopicUserGainsFollower, please use buildWebhookTopic
      • removed webhookTopicUserFollowsUser, please use buildWebhookTopic

    Methods added

    • Clips
      • added getClips
    • Search
      • added searchCategories
      • added searchChannels
    • Streams
      • added getStreamKey
      • added createStreamMarker
    • Tags
      • added getStreamTags
      • added getAllStreamTags
      • added replaceStreamTags
    • Users
      • added getChannels
      • added updateChannels
      • added createUserFollows
      • added deleteUserFollows
      • added getUserExtensions
      • added getUserActiveExtensions
      • added updateUserExtension

    Endpoints

    • [x] Ads - Start Commercial
    • [x] Analytics - Get Extension Analytics
    • [x] Analytics - Get Game Analytics
    • [x] Bits - Get Cheermotes
    • [x] Bits - Get Bits Leaderboard
    • [x] Bits - Get Extension Transactions
    • [x] Clips - Create Clip
    • [x] Clips - Get Clips
    • [x] Entitlements - Create Entitlement Grants Upload URL
    • [x] Entitlements - Get Code Status
    • [x] Entitlements - Get Drops Entitlements
    • [x] Entitlements - Redeem Code
    • [x] Games - Get Top Games
    • [x] Games - Get Games
    • [x] Moderation - Check AutoMod Status
    • [x] Moderation - Get Banned Users
    • [x] Moderation - Get Banned Events
    • [x] Moderation - Get Moderators
    • [x] Moderation - Get Moderator Events
    • [x] Search - Search Categories
    • [x] Search - Search Channels
    • [x] Streams - Get Stream Key
    • [x] Streams - Get Streams
    • [x] Streams - Create Stream Marker
    • [x] Streams - Get Stream Markers
    • [x] Streams - Get Channel Information
    • [x] Streams - Modify Channel Information
    • [x] Subscriptions - Get Broadcaster Subscriptions
    • [x] Tags - Get Stream Tags
    • [x] Tags - Get All Stream Tags
    • [x] Tags - Replace Stream Tags
    • [x] Users - Create User Follows
    • [x] Users - Delete User Follows
    • [x] Users - Get Users
    • [x] Users - Get Users Follows
    • [x] Users - Update User
    • [x] Users - Get User Extensions
    • [x] Users - Get User Active Extensions
    • [x] Users - Update User Extensions
    • [x] Videos - Get Videos
    • [x] Webhooks - Get Webhook Subscriptions
    • [x] Hype Train - Get Hype Train Events
    Source code(tar.gz)
    Source code(zip)
  • 2.2.4(Apr 30, 2020)

    Add support for OAuth Client Credentials Flow

    - public function getOAuthToken(string $code): Result
    + public function getOAuthToken(?string $code = null, string $grantType = GrantType::AUTHORIZATION_CODE, array $scopes = []): Result
    
    use romanzipp\Twitch\Enums\GrantType;
    
    $twitch = new romanzipp\Twitch;
    
    $twitch->getOAuthToken(null, GrantType::CLIENT_CREDENTIALS, ['user:read']);
    
    Source code(tar.gz)
    Source code(zip)
  • 2.2.0(Mar 3, 2020)

  • 2.0.0(May 28, 2019)

    • Add tests
    • Add docs generator
    • Add new OAuth endpoints
    • Change Twitch service constructor arguments order
    • Enhance exmaple docs
    • Remove legacy endpoints
    • Remove endpoint methods token parameter

    Upgrading to 2.0

    Change composer version

    - "romanzipp/laravel-twitch": "^1.0"
    + "romanzipp/laravel-twitch": "^2.0"
    

    Token parameter is removed from all methods

    The OAuth Bearer token can now only be set through the instance setters setToken or withToken.

    - $twitch->getAuthedUser('abcdef123456');
    + $twitch->withToken('abcdef123456')->getAuthedUser();
    

    Legacy Kraken endpoints have been removed

    - $twitch->legacyRefreshToken();
    - $twitch->legacyRoot();
    
    Source code(tar.gz)
    Source code(zip)
  • 1.0.17(Oct 4, 2018)

    🚨 Change in Behavior

    The withToken and withLegacy methods will now modify the Twitch instance without clearing themselfes after the next request.

    Source code(tar.gz)
    Source code(zip)
  • 1.0.14(Sep 10, 2018)

  • 1.0.13(Sep 10, 2018)

  • 1.0.12(Aug 6, 2018)

  • 1.0.11(Jul 25, 2018)

  • 1.0.10(May 17, 2018)

Owner
Roman Zipp
Developer at @PietSmietde & Student for Business Informatics
Roman Zipp
Laravel 8.x package wrapper library for Metatrader 5 Web API

Laravel 8.x package wrapper library for Metatrader 5 Web API

Ali A. Dhillon 10 Nov 13, 2022
A PHP wrapper for Spotify's Web API.

Spotify Web API PHP This is a PHP wrapper for Spotify's Web API. It includes the following: Helper methods for all API endpoints: Information about ar

Jonathan Wilsson 796 Jan 8, 2023
Simple Curl based wrapper for Binance API for PHP scripts

Simple Curl based wrapper for Binance API for PHP scripts Feaures API support for SPOT data/trading FAPI/DAPI support for futures data/trading Curl-on

Mr Crypster 22 May 1, 2022
Google Drive Api Wrapper by PHP

GoogleDrive Api Wrapper usage at first you need to create oauth client on google cloud platform. so go to the your google console dashboard and create

Arash Abedi 2 Mar 24, 2022
Super-simple, minimum abstraction MailChimp API v3 wrapper, in PHP

MailChimp API Super-simple, minimum abstraction MailChimp API v3 wrapper, in PHP. I hate complex wrappers. This lets you get from the MailChimp API do

Drew McLellan 2k Dec 22, 2022
Google Translator Api Wrapper For Php Developers.

Google Translator Api Wrapper For Php Developers.

Roldex Stark 2 Oct 12, 2022
The Official Vultr API PHP Wrapper

WIP - This is not the final API Client. Unstable release use with caution. Vultr API PHP Client. Getting Started Must have a PSR7, PSR17, and PSR18 Co

Vultr 10 Dec 20, 2022
An elegant wrapper around Google Vision API

STILL UNDER DEVELOPMENT - DO NOT USE IN PRODUCTION Requires PHP 8.0+ For feedback, please contact me. This package provides an elegant wrapper around

Ahmad Mayahi 24 Nov 20, 2022
An unofficial wrapper client for lknpd.nalog.ru API

Unofficial MoyNalog API client An unofficial wrapper client for lknpd.nalog.ru API Install Via Composer $ composer require shoman4eg/moy-nalog Usage S

Artem Dubinin 18 Dec 14, 2022
A Gitlab API wrapper that helps to automate common actions on CI jobs

Gitlab CI client This is a Gitlab API wrapper that helps to automate common actions on CI jobs (eg: Open a merge request, Open or close an issue etc)

SparkFabrik 2 May 2, 2022
Laravel wrapper for the Facebook Graph PHP 8 SDK

Laravel Facebook Graph SDK Installation Getting started with Laravel Facebook Graph is easy - first, install the package via composer composer require

Joel Butcher 44 Dec 8, 2022
laravel wrapper for dicom images services

laravel wrapper for dicom images services

Laravel Iran Community 4 Jan 18, 2022
A Laravel wrapper for thephpleague's Fractal package

laravel-api-response A Laravel wrapper for thephpleague's Fractal package Install Via Composer composer require lykegenes/laravel-api-response Then, a

Patrick Samson 3 Mar 15, 2021
A PHP Stream wrapper for Amazon S3

S3StreamWrapper A simple stream wrapper for Amazon S3. Example <?php use S3StreamWrapper\S3StreamWrapper; S3StreamWrapper::register(); $options = a

Gijs Kunze 21 Nov 23, 2021
An asynchronous ClamAV wrapper written in PHP with amphp/socket

amphp-clamav An asynchronous ClamAV wrapper written with amphp/socket Installing composer require pato05/amphp-clamav Examples Ping and scan of a fil

Pato05 4 Feb 28, 2022
OVHcloud APIs lightweight PHP wrapper

Lightweight PHP wrapper for OVHcloud APIs - The easiest way to use OVHcloud APIs in your PHP applications - Compatible with PHP 7.4, 8.0, 8.1 - Not affiliated with OVHcloud

Germain Carré 3 Sep 10, 2022
PSR-18 compliant Circuit Breaker wrapper

Interrupt PSR-18 compliant Circuit Breaker wrapper. Acknowledgement This library is heavily inspired by: ackintosh/ganesha PrestaShop/circuit-breaker

Flávio Heleno 5 Jun 14, 2023
Nexmo REST API client for PHP. API support for SMS, Voice, Text-to-Speech, Numbers, Verify (2FA) and more.

Client Library for PHP Support Notice This library and it's associated packages, nexmo/client and nexmo/client-core have transitioned into a "Maintena

Nexmo 75 Sep 23, 2022
OpenAI API Client is a component-oriented, extensible client library for the OpenAI API. It's designed to be faster and more memory efficient than traditional PHP libraries.

OpenAI API Client in PHP (community-maintained) This library is a component-oriented, extensible client library for the OpenAI API. It's designed to b

Mounir R'Quiba 6 Jun 14, 2023