npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

n8n-nodes-twitch-comprehensive

v2.1.11

Published

Comprehensive n8n node for Twitch API with full coverage including Schedule, Streams, Analytics, Bits, Chat, and Clips endpoints.

Readme

👀 n8n Twitch node features

Once installed, you will be able to add Twitch triggers and actions to your n8n workflows.

  1. Search for Twitch node:

  2. Select the desired action or trigger:

  3. Parametrize it:

ℹ️ About this project (attribution and scope)

This package started from the great foundational work by Codely (see credits and links below). It has since been significantly extended and maintained here as a community fork to cover a broader surface of the Twitch API:

  • Added dual authentication support with both User Access Tokens and App Access Tokens
  • Implemented 70+ actions and utilities beyond the original scope
  • Quality and structure aligned with n8n community node conventions

Credits: The original node and documentation were created by Codely. This repository acknowledges and builds upon that work while evolving the feature set and architecture. This is not the original Codely codebase and has diverged substantially.

🔐 Authentication overview

Twitch uses two OAuth token types and different endpoints accept different types:

  • User Access Token: Required for user-context actions (e.g., schedule changes, chat/moderation, clips creation, followed streams). These require scopes.
  • App Access Token: Suitable for app-context/server-to-server actions (e.g., EventSub management, some analytics/transactions).

This node lets you configure both credentials:

  • "Twitch API (User Access Token)" — standard OAuth2 credential with scopes
  • "Twitch API (App Access Token)" — client credentials flow

The node will automatically select the appropriate token for many endpoints, prefer user tokens when both are acceptable, and force the correct token where mandated (e.g., EventSub uses App tokens). You can also explicitly choose in the node when needed.

Required scopes by operation

  • Get Extension Analytics: analytics:read:extensions
  • Get Game Analytics: analytics:read:games
  • Get Bits Leaderboard: bits:read

Authentication notes for analytics

  • Analytics endpoints require a user access token. Ensure you configure twitchOAuth2Api and grant the appropriate scopes in Twitch Developer Console. The node auto-selects user auth for /analytics/extensions and /analytics/games.

Bits Leaderboard notes

  • Requires a User Access Token with the bits:read scope.
  • Supports count, period, started_at, and user_id query parameters. Do not send broadcaster_id (the authenticated broadcaster is implied).
  • If period is not all, you must provide started_at (RFC3339). Twitch computes the window in PST; adjust your timestamp accordingly if needed.

🚀 Installation instructions

This node is in the process to be officially verified by n8n. The installation process will be as simple as searching for "Twitch" in the nodes panel once we get that verification, but in the meantime, you have several options that depend on how you use n8n.

We recommend checking out the updated n8n instructions on how to install community nodes for possible updates to this process.

a) n8n cloud instance

It is not possible to install unverified community nodes in n8n cloud (documentation). Once we get that verification, you will be able to install this node following this step by step.

b) Self-hosted n8n instance

b.a) Not using queue mode: GUI installation

Follow the official instructions specifying @codelytv/n8n-nodes-twitch as the node name to install:

b.b) Using queue mode

b.b.a) Install as npm package

This is the officially recommended way for self-hosted n8n instances running in queue mode (documentation.

Go to the folder where n8n is installed (if you are using the standard Docker installation, it will probably be: /usr/local/lib/node_modules/n8n) and install the package as any other npm package:

npm i @codelytv/n8n-nodes-twitch

b.b.b) Install as Custom Docker image

Dockerfile contents example for a custom image with this node added:

ARG N8N_VERSION
FROM n8nio/n8n:${N8N_VERSION}

RUN if [ -z "$N8N_VERSION" ]; then echo "💥 N8N_VERSION argument missing."; exit 1; fi && \
    mkdir -p /home/node/.n8n/nodes && \
    npm install --prefix /home/node/.n8n/nodes --production --silent @codelytv/n8n-nodes-twitch

b.b.c) Install using Docker Compose / Docker Swarm with mapped volume

Take into account that this option has a considerable downside: The workflows you create will contain CUSTOM.twitchTrigger as the node type reference instead of @codelytv/n8n-nodes-twitch.twitchTrigger. However, it could be the best approach if you want a faster feedback loop while developing. Take into account that localhost will not be reachable from Twitch, so you probably are interested into exposing it with a tunnel using something like cloudflared`, or just expose a remote host to Twitch.

Docker Compose / Docker Swarm definition snippet:

volumes:
  n8n_data:
    name: '{{.Service.Name}}_{{.Task.Slot}}'

services:
  n8n-main:
    volumes:
      - n8n_data:/home/node/.n8n
      - /home/codely/n8n-custom-nodes:/home/node/.n8n/custom

Deploy process:

CUSTOM_NODES_DIR="$HOME/n8n-custom-nodes"

mkdir -p "$CUSTOM_NODES_DIR"

docker run --rm \
  --user "$(id -u):$(id -g)" \
  -v "$CUSTOM_NODES_DIR":/data \
  -w /data \
  node:22-alpine \
  sh -c "npm install @codelytv/n8n-nodes-twitch --production --silent"

docker stack deploy -c n8n-swarm.yml n8n

🔑 How to get Twitch credentials

You will need to create a new Twitch application to get Client ID and Client Secret following these steps:

  1. Go to the Twitch Developer Console.
  2. Log in using your Twitch account credentials.
  3. Click on the "+ Register Your Application" button.
  4. Fill out the form as follows and click "Create":
    • Name: Name your app (e.g., “n8nTwitchBot”).
    • OAuth Redirect URLs: Use a valid redirect URL. Something like http://localhost:5678/rest/oauth2-credential/callback works. For User Access Tokens you will authorize scopes via OAuth; for App Access Tokens you will use client credentials. A localhost redirect URL is fine for development.
    • Category: Application Integration
    • Client Type: Confidential
  5. Get your credentials:
    • Click on "Manage"
    • Client ID: Visible right away.
    • Client Secret: Click "New Secret" to generate one. Be sure to store this securely (it won’t be shown again).

💻 Documentation for node contributors

How to locally test this node (based on the official n8n guide):

  1. Clone and move to the node development folder
    cd ~/Code/work/codely/public/
    git clone [email protected]:CodelyTV/n8n-nodes-twitch.git
    cd n8n-nodes-twitch
  2. Build the node
    npm run build
  3. Create a npm global symlink to the locally installed package
    npm link
  4. Install n8n locally:
    npm install n8n -g
  5. Move to your n8n local installation
    cd ~/.n8n/
  6. Create a custom nodes folder
    mkdir custom
    cd custom
  7. Link the node package to the symlink previously created
    npm link @codelytv/n8n-nodes-twitch
  8. Validate that the local n8n instance has the Twitch node pointing to the local folder
    tree -L 3 -d
    Expected output:
    .
    └── node_modules
        └── @codelytv
            └── n8n-nodes-twitch -> ../../../../Code/work/codely/public/n8n-nodes-twitch
  9. Run n8n
    n8n start
  10. Enjoy!

👌 Codely Code Quality Standards

Publishing this package we are committing ourselves to the following code quality standards:

  • 🤝 Respect Semantic Versioning: No breaking changes in patch or minor versions
  • 🤏 No surprises in transitive dependencies: Use the bare minimum dependencies needed to meet the purpose
  • 🎯 One specific purpose to meet without having to carry a bunch of unnecessary other utilities
  • 📖 Well documented ReadMe showing how to install and use
  • ⚖️ License favoring Open Source and collaboration

🧪 Testing status and contributions

This project covers a wide range of Twitch endpoints. Not all newly implemented operations have been fully tested across every permutation. You may encounter issues or edge cases.

  • If you find a bug or need help, please open a GitHub issue with details and reproduction steps.
  • Contributions are welcome! PRs that add missing tests, fix bugs, or improve documentation/auth scope coverage are appreciated.