![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
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 yarn:
yarn add simple-helix-api
Creating Helix object
const HelixAPI = require("simple-helix-api"); // also you can user es6 import
const Helix = new HelixAPI({
access_token: "xxx",
cliend_id: "xxx"
});
Params for Helix:
Param | Required | Default | Description |
---|---|---|---|
access_token | false | null | Access Token |
client_id | true | null | Client ID of application |
increaseRate | false | false | Use Bearer instead of OAuth to increase Rate Limit |
disableWarns | false | false | Disabled warnings in console |
Then you can get your profile ID before start working with API
const { id } = await Helix.getUser(username);
This option uses Bearer authorization instead of OAuth, which allows you to increase the number of requests per minute to 800 instead of 30.
If you want to use this, you need to know that methods like updateStream(), createMarker()
force OAuth authorization.
Common methods do not require an access token.
The fields indicates as params?
are optional by default. You can read about all available optional params here
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);
Gets clip information by clip ID (one or more), broadcaster ID (one only), or game ID (one only)
const clips = await Helix.getClips(user_id, params?);
Gets all clips of channel
const all_clips = await Helix.getAllClips(user_id);
Get broadcast information (example usage: realtime viewers count)
const stream = await Helix.getStream(id);
Gets information about active streams. Streams are returned sorted by number of current viewers, in descending order. Across multiple pages of results, there may be duplicate or missing streams, as viewers join and leave streams.
const streams = await Helix.getStreams(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);
Returns a list of games or categories that match the query via name either entirely or partially
const game = await Helix.searchCategories("League of", params?);
Returns a list of channels (users who have streamed within the past 6 months) that match the query via channel name or description either entirely or partially. Results include both live and offline channels
const game = await Helix.searchChannels("InfiniteHorror", params?);
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 |
Returns all banned and timed-out users in a channel
const game = await Helix.getBannedUsers(id, params?);
Returns all moderators in a channel
const moderators = await Helix.getModerators(id, params?);
Gets the channel stream key for a user
const key = await Helix.getStreamKey(id);
Gets a ranked list of Bits leaderboard information for an authorized broadcaster
const leaders = await Helix.getBitsLeaderboard(params?);
Retrieves the list of available Cheermotes, animated emotes to which viewers can assign Bits, to cheer in chat. Cheermotes returned are available throughout Twitch, in all Bits-enabled channels
const leaders = await Helix.getCheermotes(id);
Attention: access_token is required
Update broadcast information
const response = 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 |
Creating 15 seconds length clip
const clip = await Helix.createClip(id, has_delay?);
Param | Type | Required | Description |
---|---|---|---|
id | Number | true | User ID |
has_delay | Boolean | false | If false, the clip is captured from the live stream when the API is called; otherwise, a delay is added before the clip is captured (to account for the brief delay between the broadcaster’s stream and the viewer’s experience of that stream). |
Starts a commercial on a specified channel
const commercial = await Helix.startCommercial(id, length?);
Param | Type | Required | Description |
---|---|---|---|
id | Number | true | User ID |
length | Number | false | Desired length of the commercial in seconds. Valid options are 30, 60, 90, 120, 150, 180 |
Creating stream marker with description
const marker = await Helix.createMarker(id, description?);
Param | Type | Required | Description |
---|---|---|---|
id | Number | true | User ID |
description | String | false | Marker description (can be empty) |
Return an array with markers of specified VOD
const markers = await Helix.getMarkers(id, video_id?);
Param | Type | Required | Description |
---|---|---|---|
id | Number | true | User ID |
video_id | String | false | ID of the VOD/video whose stream markers are returned |
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"];
return console.log(`${username}: ${message}`);
});
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 find events, methods and examples for chatbot here
You can report of any issues here
FAQs
The Simple Helix API allows developers to easily develop applications for Twitch
The npm package simple-helix-api receives a total of 0 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
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.