twitchapi

0.2.2 • Public • Published

TwitchAPI Wrapper


A lightweight wrapper for the Twitch API. Easy to use, and no hassle.

To install:

npm install twitchapi --save

Routes currently available:

  • channels/:channel
  • games/top
  • search/channels
  • search/games
  • search/streams
  • streams
  • streams/:channel
  • streams/featured
  • streams/summary
  • teams
  • teams/:team
  • videos/:id
  • videos/top
  • channels/:channel/videos
  • Custom requests using the custom.request syntax

For visual use of each route, please checkout the examples directory.

How to use:

var Twitch = require('twitchapi').default;
var TwitchAPI = new Twitch('API_CLIENT_ID');

TwitchAPI.search('streams', { query: 'Halo' })
  .then((results) => {
    console.log(results);
  })
  .catch((error) => {
    console.log(error);
  });

How to use (es6):

import Twitch from 'twitchapi';    
const TwitchAPI = new Twitch('API_CLIENT_ID');

TwitchAPI.search('streams', { query: 'Halo' })
	.then((results) => {
	  console.log(results);
	})
	.catch((error) => {
	  console.log(error);
	});

You can refer to the twitch api documention for more details on configuration for the routes (ex. query, limit, offset, etc)

Better documentation will exist soon.

Readme

Keywords

Package Sidebar

Install

npm i twitchapi

Weekly Downloads

0

Version

0.2.2

License

none

Last publish

Collaborators

  • robertgrubb