Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
simple-helix-api
Advanced tools
The Simple Helix API allows developers to easily develop applications for Twitch
Simple Helix API makes easy to develop applications for Twitch in couple lines of code
Install with npm:
npm install --save simple-helix-api
Creating Helix object
const HelixAPI = require("simple-helix-api");
const Helix = new Helix({
access_token: "xxx",
cliend_id: "xxx"
});
Params for Helix:
Param | Required | Default | Description |
---|---|---|---|
access_token | false | null | Access Token that provide by Twitch |
client_id | true | null | Client ID of your application |
disableWarns | false | false | Disabled warnings in console |
Then you can get profile ID
const user = await Helix.getUser("InfiniteHorror");
const { id } = user;
Common methods do not require an access token
Get information about user (example usage: id, profile image, offline image, view count, broadcaster type)
const user = await Helix.getUser(id);
Get channel info like title, game and others
const channel = await Helix.getChannel(id);
Get broadcast information (example usage: realtime viewers count)
const stream = await Helix.getStream(id);
Get broadcast meta information
const meta = await Helix.getStreamMeta(id);
Get first N followers from the end
const followers = await Helix.getFollowers(id, count, after);
Param | Type | Required | Default | Max | Description |
---|---|---|---|---|---|
id | Number | true | null | - | ID of user |
count | Number | false | 20 | 100 | Number of count of followers that you can get |
after | String | false | null | - | Pangination cursor (offset) |
Return an array of all followers. The lead time depends on the number of followers on your channel
const all_followers = await Helix.getAllFollowers(id);
Get simple number of followers count
const count = await Helix.getFollowersCount(id);
Get viewers splitted by categories (broadcaster, admins, staff, moderators, vips, viewers). Attention! This method used username instead of user ID
const viewers = await Helix.getViewers(user_name);
Get game by this ID or name
const game = await Helix.getGame("Overwatch");
Get the top 100 most viewed games on Twitch at the moment
const top = await Helix.getTopGames(count);
Param | Type | Required | Default | Max | Description |
---|---|---|---|---|---|
count | Number | false | 100 | 100 | Number of games |
Attention: access_token is required
Update broadcast information
await Helix.updateStream(id, title, game);
Param | Type | Required | Description |
---|---|---|---|
id | Number | true | User ID |
title | String | true | Stream title |
game | String | true | Game on the stream |
Create chatbot to receive messages from Twitch Chat
You must get oauth token
const oauth_token = "XXXXXX";
const bot = Helix.createChatBot(bot_name, oauth_token, user_name);
bot.on("chat", (channel, user, message) => {
const username = user["display-name"];
console.log(`${username}: ${message}`);
return;
});
Param | Type | Required | Description |
---|---|---|---|
bot_name | String | true | The name of the channel for the bot (you can specify your account nickname) |
ouath_token | String | true | OAuth Token that you receive |
user_name | String | true | The name of the channel from which the bot will receive messages |
You can report of any issues here
You can follow me on Twitch :)
FAQs
The Simple Helix API allows developers to easily develop applications for Twitch
The npm package simple-helix-api receives a total of 33 weekly downloads. As such, simple-helix-api popularity was classified as not popular.
We found that simple-helix-api demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.