# simple-helix-api

> The Simple Helix API allows developers to easily develop applications for Twitch

Latest version **4.2.0** (published 2026-10-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install simple-helix-api
pnpm add simple-helix-api
yarn add simple-helix-api
bun add simple-helix-api
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 4.2.0 |
| Published | 2026-10-20 |
| First published | 2019-12-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 115.5 KB |
| Known vulnerabilities | 0 (+34 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Maxim |
| Maintainers | infinitehorror |
| Keywords | Twitch, Helix, Helix API, Broadcasts, Streams |

## Links

- npm: https://www.npmjs.com/package/simple-helix-api
- Repository: https://github.com/PurpleHorrorRus/simple-helix-api
- Homepage: https://github.com/PurpleHorrorRus/simple-helix-api#readme
- Issues: https://github.com/PurpleHorrorRus/simple-helix-api/issues
- npm.io page: https://npm.io/package/simple-helix-api

## Dependencies (5)

- [ws](https://npm.io/package/ws.md) ^8.17.0
- [axios](https://npm.io/package/axios.md) 1.7.2
- [irc-message](https://npm.io/package/irc-message.md) ^3.0.2
- [irc-message-ts](https://npm.io/package/irc-message-ts.md) ^3.0.6
- [reconnecting-websocket](https://npm.io/package/reconnecting-websocket.md) ^4.4.0

## Alternatives

- [byte-size](https://npm.io/package/byte-size.md) — 2.1M weekly downloads
- [speed-limiter](https://npm.io/package/speed-limiter.md) — 16.0K weekly downloads
- [@powersync/node](https://npm.io/package/@powersync/node.md) — 10.9K weekly downloads
- [@ledgerhq/coin-cardano](https://npm.io/package/@ledgerhq/coin-cardano.md) — 1.0K weekly downloads
- [@jayesol/jayeson.lib.streamfinder](https://npm.io/package/@jayesol/jayeson.lib.streamfinder.md) — 1.0K weekly downloads

## Recent versions

- 4.2.0 (latest) — 2026-10-20
- 3.4.0-beta.1 (beta) — 2022-12-07
- 4.1.9 — 2024-06-03
- 4.1.7 — 2024-03-01
- 4.1.6 — 2024-02-24
- 4.1.5 — 2024-02-24
- 4.1.4 — 2024-02-24
- 4.1.2 — 2023-09-09
- 4.1.1 — 2023-09-09
- 4.1.0 — 2023-07-22
- 4.0.4 — 2023-04-30
- 4.0.3 — 2023-04-28
- 4.0.2 — 2023-02-08
- 4.0.1 — 2023-02-07
- 4.0.0 — 2023-02-07
- … 37 more at https://npm.io/package/simple-helix-api/versions

## README

# About

simple-helix-api is a package needed to simplify working with the Twitch API.

The library was created following the Twitch API documentation as much as possible. 
All requests are divided into categories for ease of use. Below is a list of current categories supported by package.

```
analytics, automod, channel, chat, clips, commercial, events, games, markers, moderation, other, polls, predictions, rewards, schedule, search, streams, subscriptions, tags, teams, users, videos
```

In addition, some requests that are associated with a list of something (a list of users, categories, clips, etc.) have one request in order to get a complete list.

# Navigation

- [Installation](#installation)
- [Usage](#usage)
    - [Fetching access token](#access-token)
    - [Example](#example)
- [EventSub (WebSocket)](/documentation/EVENTSUB.md)
- [Twitch Chat Client](/documentation/CHAT.md)
- [Contribution](#contribution)

# Installation
npm:

```bash
npm install simple-helix-api
```

or using yarn:

```bash
yarn add simple-helix-api
```

# Usage

Before we starting, be sure you have client_id registered in Dev Dashboard on Twitch.

## Access Token

First, you need for Access Token provided by Twitch. With this package you can generate link to the endpoint that returns Access Token to you. If you already have, then skip this step.

```javascript
const HelixAPI = require("simple-helix-api"); // you can use import

// Create client
const Helix = new HelixAPI({
    client_id: "xxxxxxx" // client_id from Twitch Dev Dashboard
});

// List of scopes you need for your application. Left it empty to request all scopes. See scopes list: https://dev.twitch.tv/docs/authentication#scopes
const scopes = ["chat:read", "channel:manage:predictions", "moderation:read"];

// Redirect uri must match to specified in Twitch Dev Dashboard
const redirect_uri = "http://localhost...";

// Generate auth link
const link = Helix.getAuthLink(scopes, redirect_uri);
console.log(link);
```

Now you can use this package on full power.

## Example

Let's look at a basic example of working with package. In this example, we will get and output user information to the console.

Almost all requests requires an user ID. Get yours, store it and use everywhere.

**Attetion!** All requests and categories names matches with Twitch API documentation, but recommended to use autocomplete of your favorite code editor to see all categories and requests.

```javascript
const HelixAPI = require("simple-helix-api");

const Helix = new HelixAPI({
    access_token: "xxxxxxx", // Your personal Access Token provided by Twitch. If you don't have one, see step above.
    client_id: "xxxxxxx" // Client ID from Twitch Dev Dashboard
});

(async () => {
    const user = await Helix.users.get("InfiniteHorror"); // Also you can specify user ID instead of user login
    console.log(user);
})();
```


## More examples

There is a several examples of requests you can use with this package. Be aware that some requests requires additional parameters, so check the official documentation on the Twitch Dev Portal.

### Update stream title and category

```javascript
const game = await Helix.games.get("League of Legends");
const updated = await Helix.channel.modify(user_id, game.id, "en", "Title has been changed with simple-helix-api");
```

### Start commercial

```javascript
await Helix.commercial.start(user_id, 30);
```

### Update chat settings

```javascript
await Helix.chat.updateSettings(user_id, {
    follower_mode: true,
    follower_mode_duration: 10
});
```

### Ban user

```javascript
const user = await Helix.users.get("anyToxicPerson");
await Helix.moderation.ban(user_id, {
    user_id: user.id,
    reason: "Friendship is Magic"
});
```

### Get all followers of channel

```javascript
const followers = await Helix.users.allFollows(user_id);
console.log(followers);
```

### Get all clips of channel

The time of response depends on count of clips of your channel.

```javascript
const clips = await Helix.clips.all(user_id);
console.log(clips);
```

# Contribution
Sometimes I may miss some changes in the Twitch API, so I will be glad of any help. Feel free to fork and share PR's.

You can report of any issues [here](https://github.com/PurpleHorrorRus/simple-helix-api/issues).

---
_Source: https://npm.io/package/simple-helix-api · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
