twitchapi
v0.2.2
Published
A lightweight api wrapper for Twitch API
Downloads
5
Readme
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.