Download the PHP package obnoxiousfrog/twitch-api without Composer

On this page you can find all versions of the php package obnoxiousfrog/twitch-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package twitch-api

Twitch Api

This is a PHP library to simplify working with the Twitch API.

PLEASE READ

It has come to my attention that this package may no longer be compatible with the recent Twitch API changes. Unfortunately, I do not have the time required to look into it at the moment. Hopefully, I will some day in the not too distant future, and maybe I'll even go ahead and re-write it completely. I will not offer support on any major feature requests or issues until then.

Please keep this in mind if you decide to use and/or rely on this package.

Thank you.

Installation

Install by running the following Composer command:

Example

Below is an example for authenticating the user, checking if the user is following and subscribed to the user obnoxiousfrog, and if they are, they are greeted with a message. If not, an exception is thrown for logging, and/or redirecting the user to another page with an error message.

Documentation

TwitchApi\Application

This class implements the \TwitchApi\Contracts\Application contract.

The entire API revolves around the Application object.

client is your Twitch application client id.

secret is your Twitch application client secret (do not share this with anyone).

scopes is an array of Twitch scopes.

redirect is the Twitch application redirect url.

Below is an example of how this might look in a production environment.

Class Methods

Visibility Method Arguments Return
public __construct string $client string $secret array $scopes string $redirect void
public request - \TwitchApi\Contracts\Request
public bind string $abstract, string $concrete void
public instance string $abstract, array $parameters [] \StdClass
public make string $abstract, array $parameters [] \StdClass
private instantiate string $concrete, array $parameters \StdClass
public static api - string
public static client - string
public static secret - string
public static scopes - string
public static redirect - string

TwitchApi\Authenticator

This class implements the \TwitchApi\Contracts\Authenticator contract.

Class Methods

Visibility Method Arguments Return
public __construct \TwitchApi\Contracts\Application $app void
public authenticate - boolean
public user - \TwitchApi\Contracts\User
public channel string $channel \TwitchApi\Contracts\Channel
public static url string $client null, string $redirect null, string $scopes null string

TwitchApi\User

This class implements the \TwitchApi\Contracts\User contract.

Class Methods

Visibility Method Arguments Return
public __construct \TwitchApi\Contracts\Application $app, \TwitchApi\Contracts\Response $token, \TwitchApi\Contracts\Response $user void
public accessToken - string
public refreshToken - string
public id - integer
public email - string
public name - string
public displayname - string
public logo - string
public bio - string
public timestamps - array
public isPartnered - boolean
public isSubscribed string $streamer boolean
public isFollowing string $streamer boolean

TwitchApi\Channel

This class implements the \TwitchApi\Contracts\Channel contract.

Class Methods

Visibility Method Arguments Return
public __construct \TwitchApi\Contracts\Application $app, \TwitchApi\Contracts\User $user, string $channel void
public get - \TwitchApi\Contracts\Response
public teams - array
public emoticons - array

TwitchApi\Request

This class implements the \TwitchApi\Contracts\Request contract.

Class Methods

Visibility Method Arguments Return
public __construct \TwitchApi\Contracts\Application $app void
public get string $endpoint, array $parameters [], array $headers [] \TwitchApi\Contract\Response
public post string $endpoint, array $parameters [], array $headers [] \TwitchApi\Contract\Response

TwitchApi\Response

This class implements the \TwitchApi\Contracts\Response contract.

Class Methods

Visibility Method Arguments Return
public __construct \TwitchApi\Contracts\Application $app, string $response, array $request void
public __get string $property mixed

Using your own classes

Make sure your own classes implement the appropriate contract (you may find all the contracts below the title of each class documentation above), and then you may simply run the bind method from the \TwitchApi\Application object.

For example, the following would replace the TwitchApi User class with your own:


All versions of twitch-api with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package obnoxiousfrog/twitch-api contains the following files

Loading the files please wait ....