Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

simple-twitch-api

alexandrecoulay44MIT2.1.1TypeScript support: included

Simple module to use to interact with the twitch Api

Api, Twitch, nodejs, simple, Helix

readme


SIMPLE TWITCH API


NPM version NPM downloads Snyk Vulnerabilities for npm package Snyk Vulnerabilities for npm package Snyk Vulnerabilities for npm package

A simpler way to interact with the Twitch API (helix version : https://dev.twitch.tv/docs/api/reference) write in Typescript

Roadmap :

  • <input checked="" disabled="" type="checkbox"> TypeScript Support
  • <input checked="" disabled="" type="checkbox"> Basic Get and Events
  • <input disabled="" type="checkbox"> All Get requests
  • <input checked="" disabled="" type="checkbox"> All EventSub
  • <input disabled="" type="checkbox"> All Posts Request
  • <input disabled="" type="checkbox"> All Put Request

Support :

- ES5
- ES6
- typescript (you don't need to install another package to work with TS).

Install

$    npm install simple-twitch-api
$    yarn add simple-twitch-api

Example

import Twitch from 'simple-twitch-api';
import { CLIENT_ID, CLIENT_SECRET } from "./config.json";

const SCOPES = "user:read:email";

async function script() {
    const request = await twitch.getToken(CLIENT_ID, CLIENT_SECRET, SCOPES);

    const token = request.access_token;

    const client = new twitch.default({
        twitch_client_id: CLIENT_ID,
        token: token
    });

    const get_streams = await client.stream.fetch({
        user_login: [
            "alex_off"
        ]
    })

   console.table(get_streams.data);
}

script()

Maintainers

License

MIT License.