Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

twitch.tv

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

twitch.tv

Library for Twitch.tv's REST API

  • 2.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

twitch.tv

node.js lib for Twitch.tv's REST API

npm install twitch.tv

Example

var twitch = require("twitch.tv")

twitch("streams", function(err, res) {
  console.log(res)
})

API

twitch(apiMethod[, options], callback)

Default options:

{
  ua: "node.js twitch.tv by mediremi",
  apiVersion: "3",
  clientID: ""
}
  • options.baseUrl -> Twitch.tv API base URL
  • options.ua -> User agent sent to Twitch.tv
  • options.apiVersion -> API version used
  • options.clientID -> Client ID provided by Twitch.tv. Used for rate-limiting
  • options.auth -> OAuth token provided by Twitch.tv. Used for privileged requests (doc here)

callback is called with two parameters: err and response.

Available Twitch API methods

Examples:

twitch("channel", function(err, res) {
  console.log(res)
})

twitch("games/top", function(err, res) {
  if (err) return console.error(err)

  console.log(res.top)
})

twitch("videos/top", {
  ua: "get-cool-twitch-vids.com",
  apiVersion: 1,
  clientID: "axjhfp777tflhy0yjb5sftsil"
})

twitch("channels/44322889", {
  apiVersion: 5,
  clientID: "uo6dggojyb8d6soh92zknwmi5ej1q2"
})

// https://dev.twitch.tv/docs/v5/reference/users/#get-user
twitch("user", {
  apiVersion: 5,
  clientID: "uo6dggojyb8d6soh92zknwmi5ej1q2",
  auth: "cfabdegwdoklmawdzdo98xt2fo512y"
})

Keywords

FAQs

Package last updated on 21 Feb 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc