@yuniruyuni/n8n-nodes-twitch
v0.1.41
Published
n8n node for Twitch API integration. Supports Twitch operations and EventSub triggers.
Maintainers
Readme
n8n-nodes-twitch
This is an n8n community node package for Twitch API integration. It provides comprehensive support for Twitch Helix API operations and real-time EventSub notifications via WebSocket.
n8n is a fair-code licensed workflow automation platform.
English | 日本語
Features
34 Twitch API Resources
All nodes follow Twitch Helix API's resource-oriented structure:
User & Channel Management:
- Twitch Users - Get user information
- Twitch Channels - Get channel information
- Twitch Streams - Get stream information
Content & Media:
- Twitch Clips - Get, create clips
- Twitch Videos - Get videos
- Twitch Games - Get games, top games
- Twitch Search - Search categories, channels, streams
Chat & Communication:
- Twitch Chat Messages - Send messages
- Twitch Chatters - Get chatters list
- Twitch Emotes - Get channel emotes
- Twitch Announcements - Send announcements
- Twitch Whispers - Send whispers
Channel Points & Rewards:
- Twitch Custom Rewards - Create, get, update, delete custom rewards
- Twitch Redemptions - Get, update redemption status
Moderation:
- Twitch Bans - Ban, unban users, get banned users
- Twitch Moderators - Get, add, remove moderators
Engagement:
- Twitch Polls - Get, create, end polls
- Twitch Predictions - Get, create, lock, resolve predictions
- Twitch Raids - Start, cancel raids
Monetization:
- Twitch Bits Leaderboard - Get bits leaderboard
- Twitch Cheermotes - Get cheermotes
- Twitch Subscriptions - Get broadcaster subscriptions, check user subscription
Scheduling & Teams:
- Twitch Schedule - Get, create, update, delete stream segments
- Twitch Teams - Get channel teams, team information
EventSub Trigger Node
Twitch Trigger - Real-time event notifications via WebSocket:
- Stream Events: online, offline
- Channel Events: update, follow, subscribe, subscription end/gift/message, cheer, raid, ban, unban
- Chat Events: message, clear, notification, message delete, clear user messages
- Channel Points: custom reward add/update/remove, redemption add/update
- Polls: begin, progress, end
- Predictions: begin, progress, lock, end
- Goals: begin, progress, end
- Hype Train: begin, progress, end
- Moderator: add, remove
- Shield Mode: begin, end
- Shoutout: create, receive
Supports 76 EventSub events with automatic subscription management.
Authentication
Twitch User Access Token - User access tokens for all operations
- Uses Authorization Code Grant Flow
- Required for both API operations and EventSub WebSocket subscriptions
- Pre-configured with comprehensive scopes (80 scopes) covering:
- All 76 EventSub events
- All Twitch Helix API operations
- Chat, moderation, channel management, and more
- Requires: Client ID, Client Secret, and OAuth redirect URL
Installation
Install from n8n (Recommended)
- Go to Settings > Community Nodes
- Click Install
- Enter
@yuniruyuni/n8n-nodes-twitchin the package name field - Click Install
This works for both n8n Cloud and self-hosted instances.
Install manually (For development)
If you're developing or debugging this package:
Via npm:
npm install @yuniruyuni/n8n-nodes-twitchVia custom extensions path:
N8N_CUSTOM_EXTENSIONS="/path/to/@yuniruyuni/n8n-nodes-twitch"For Docker: Mount the package directory or add it to your custom nodes directory.
Compatibility
- n8n version: 1.0.0 or higher
- Node.js version: 21.0.0 or higher (required for global WebSocket support)
Usage
Setting up Twitch Credentials
- Go to Twitch Developer Console
- Create a new application or use an existing one
- Note your Client ID and Client Secret
- Set the OAuth Redirect URL to your n8n instance (e.g.,
https://your-n8n.com/rest/oauth2-credential/callback)
Using Twitch Nodes
- Add a Twitch node to your workflow
- Create new Twitch User Access Token credentials
- Select the resource and operation you want to perform
- Configure the required parameters
- Execute the workflow
Using Twitch Trigger
- Add the Twitch Trigger node to your workflow
- Create Twitch User Access Token credentials
- Select the EventSub event type you want to listen for
- Configure broadcaster ID and other required parameters
- Activate the workflow to start receiving events
The trigger uses WebSocket to receive real-time events from Twitch. When you activate the workflow, the node automatically:
- Connects to Twitch EventSub WebSocket (
wss://eventsub.wss.twitch.tv/ws) - Receives a session ID and creates an EventSub subscription
- Receives real-time event notifications via WebSocket
- Handles reconnections automatically
- Automatically cleans up the subscription when the workflow is deactivated
Development
Prerequisites
- Node.js 21.0.0 or higher (required for global WebSocket support)
- npm
Setup
# Clone the repository
git clone https://github.com/yuniruyuni/n8n-nodes-twitch.git
cd n8n-nodes-twitch
# Install dependencies
npm install
# Build the nodes
npm run build
# Start n8n with the nodes loaded (development mode)
npm run devAvailable Scripts
| Script | Description |
| --------------------- | ---------------------------------------------------------------- |
| npm run dev | Start n8n with your node and watch for changes |
| npm run build | Compile TypeScript to JavaScript |
| npm run build:watch | Build in watch mode (auto-rebuild on changes) |
| npm run lint | Check code for errors and style issues |
| npm run lint:fix | Automatically fix linting issues |
| npm run release | Create a new release |
Release Process
This project uses n8n-node release (powered by release-it) for automated releases:
Recommended: GitHub Actions
- Go to Actions → Release → Run workflow
- Click Run workflow
- GitHub Actions automatically:
- Runs lint and build
- Updates version in package.json (default increment)
- Generates CHANGELOG
- Creates git commit and tag
- Publishes to npm
- Creates GitHub release with notes
Alternative: Local Release
For local development workflow:
npm run releaseThis provides an interactive release process managed by n8n-node release.
Prerequisites:
- Set
NPM_TOKENsecret in GitHub repository settings - Ensure you have npm publishing rights for
@yuniruyuni/n8n-nodes-twitch - For local releases:
npm loginand clean git state onmasterbranch required
Architecture
This package uses the declarative/low-code style for Twitch API operations:
- Direct calls to Twitch Helix API (
https://api.twitch.tv/helix) - n8n's
routingproperty for HTTP requests - Resource-oriented structure aligned with Twitch Helix API
The Twitch Trigger node uses Node.js global WebSocket (available in Node.js 21+) to receive EventSub notifications via WebSocket (wss://eventsub.wss.twitch.tv/ws). No external dependencies required.
