@yuniruyuni/n8n-nodes-twitch 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +19 -0
- package/README.ja.md +243 -0
- package/README.md +243 -0
- package/dist/credentials/TwitchApi.credentials.d.ts +10 -0
- package/dist/credentials/TwitchApi.credentials.js +47 -0
- package/dist/credentials/TwitchApi.credentials.js.map +1 -0
- package/dist/credentials/TwitchOAuth2Api.credentials.d.ts +10 -0
- package/dist/credentials/TwitchOAuth2Api.credentials.js +434 -0
- package/dist/credentials/TwitchOAuth2Api.credentials.js.map +1 -0
- package/dist/icons/twitch.dark.svg +1 -0
- package/dist/icons/twitch.svg +1 -0
- package/dist/nodes/TwitchAnnouncements/TwitchAnnouncements.node.d.ts +4 -0
- package/dist/nodes/TwitchAnnouncements/TwitchAnnouncements.node.js +196 -0
- package/dist/nodes/TwitchAnnouncements/TwitchAnnouncements.node.js.map +1 -0
- package/dist/nodes/TwitchAnnouncements/twitch.dark.svg +1 -0
- package/dist/nodes/TwitchAnnouncements/twitch.svg +1 -0
- package/dist/nodes/TwitchBans/TwitchBans.node.d.ts +4 -0
- package/dist/nodes/TwitchBans/TwitchBans.node.js +354 -0
- package/dist/nodes/TwitchBans/TwitchBans.node.js.map +1 -0
- package/dist/nodes/TwitchBans/twitch.dark.svg +1 -0
- package/dist/nodes/TwitchBans/twitch.svg +1 -0
- package/dist/nodes/TwitchBitsLeaderboard/TwitchBitsLeaderboard.node.d.ts +4 -0
- package/dist/nodes/TwitchBitsLeaderboard/TwitchBitsLeaderboard.node.js +202 -0
- package/dist/nodes/TwitchBitsLeaderboard/TwitchBitsLeaderboard.node.js.map +1 -0
- package/dist/nodes/TwitchBitsLeaderboard/twitch.dark.svg +1 -0
- package/dist/nodes/TwitchBitsLeaderboard/twitch.svg +1 -0
- package/dist/nodes/TwitchChannels/TwitchChannels.node.d.ts +4 -0
- package/dist/nodes/TwitchChannels/TwitchChannels.node.js +124 -0
- package/dist/nodes/TwitchChannels/TwitchChannels.node.js.map +1 -0
- package/dist/nodes/TwitchChannels/twitch.dark.svg +1 -0
- package/dist/nodes/TwitchChannels/twitch.svg +1 -0
- package/dist/nodes/TwitchChatMessages/TwitchChatMessages.node.d.ts +4 -0
- package/dist/nodes/TwitchChatMessages/TwitchChatMessages.node.js +160 -0
- package/dist/nodes/TwitchChatMessages/TwitchChatMessages.node.js.map +1 -0
- package/dist/nodes/TwitchChatMessages/twitch.dark.svg +1 -0
- package/dist/nodes/TwitchChatMessages/twitch.svg +1 -0
- package/dist/nodes/TwitchChatters/TwitchChatters.node.d.ts +4 -0
- package/dist/nodes/TwitchChatters/TwitchChatters.node.js +148 -0
- package/dist/nodes/TwitchChatters/TwitchChatters.node.js.map +1 -0
- package/dist/nodes/TwitchChatters/twitch.dark.svg +1 -0
- package/dist/nodes/TwitchChatters/twitch.svg +1 -0
- package/dist/nodes/TwitchCheermotes/TwitchCheermotes.node.d.ts +4 -0
- package/dist/nodes/TwitchCheermotes/TwitchCheermotes.node.js +113 -0
- package/dist/nodes/TwitchCheermotes/TwitchCheermotes.node.js.map +1 -0
- package/dist/nodes/TwitchCheermotes/twitch.dark.svg +1 -0
- package/dist/nodes/TwitchCheermotes/twitch.svg +1 -0
- package/dist/nodes/TwitchClips/TwitchClips.node.d.ts +4 -0
- package/dist/nodes/TwitchClips/TwitchClips.node.js +308 -0
- package/dist/nodes/TwitchClips/TwitchClips.node.js.map +1 -0
- package/dist/nodes/TwitchClips/twitch.dark.svg +1 -0
- package/dist/nodes/TwitchClips/twitch.svg +1 -0
- package/dist/nodes/TwitchCustomRewards/TwitchCustomRewards.node.d.ts +4 -0
- package/dist/nodes/TwitchCustomRewards/TwitchCustomRewards.node.js +606 -0
- package/dist/nodes/TwitchCustomRewards/TwitchCustomRewards.node.js.map +1 -0
- package/dist/nodes/TwitchCustomRewards/twitch.dark.svg +1 -0
- package/dist/nodes/TwitchCustomRewards/twitch.svg +1 -0
- package/dist/nodes/TwitchEmotes/TwitchEmotes.node.d.ts +4 -0
- package/dist/nodes/TwitchEmotes/TwitchEmotes.node.js +125 -0
- package/dist/nodes/TwitchEmotes/TwitchEmotes.node.js.map +1 -0
- package/dist/nodes/TwitchEmotes/twitch.dark.svg +1 -0
- package/dist/nodes/TwitchEmotes/twitch.svg +1 -0
- package/dist/nodes/TwitchGames/TwitchGames.node.d.ts +4 -0
- package/dist/nodes/TwitchGames/TwitchGames.node.js +260 -0
- package/dist/nodes/TwitchGames/TwitchGames.node.js.map +1 -0
- package/dist/nodes/TwitchGames/twitch.dark.svg +1 -0
- package/dist/nodes/TwitchGames/twitch.svg +1 -0
- package/dist/nodes/TwitchModerators/TwitchModerators.node.d.ts +4 -0
- package/dist/nodes/TwitchModerators/TwitchModerators.node.js +310 -0
- package/dist/nodes/TwitchModerators/TwitchModerators.node.js.map +1 -0
- package/dist/nodes/TwitchModerators/twitch.dark.svg +1 -0
- package/dist/nodes/TwitchModerators/twitch.svg +1 -0
- package/dist/nodes/TwitchPolls/TwitchPolls.node.d.ts +4 -0
- package/dist/nodes/TwitchPolls/TwitchPolls.node.js +452 -0
- package/dist/nodes/TwitchPolls/TwitchPolls.node.js.map +1 -0
- package/dist/nodes/TwitchPolls/twitch.dark.svg +1 -0
- package/dist/nodes/TwitchPolls/twitch.svg +1 -0
- package/dist/nodes/TwitchPredictions/TwitchPredictions.node.d.ts +4 -0
- package/dist/nodes/TwitchPredictions/TwitchPredictions.node.js +408 -0
- package/dist/nodes/TwitchPredictions/TwitchPredictions.node.js.map +1 -0
- package/dist/nodes/TwitchPredictions/twitch.dark.svg +1 -0
- package/dist/nodes/TwitchPredictions/twitch.svg +1 -0
- package/dist/nodes/TwitchRaids/TwitchRaids.node.d.ts +4 -0
- package/dist/nodes/TwitchRaids/TwitchRaids.node.js +192 -0
- package/dist/nodes/TwitchRaids/TwitchRaids.node.js.map +1 -0
- package/dist/nodes/TwitchRaids/twitch.dark.svg +1 -0
- package/dist/nodes/TwitchRaids/twitch.svg +1 -0
- package/dist/nodes/TwitchRedemptions/TwitchRedemptions.node.d.ts +4 -0
- package/dist/nodes/TwitchRedemptions/TwitchRedemptions.node.js +301 -0
- package/dist/nodes/TwitchRedemptions/TwitchRedemptions.node.js.map +1 -0
- package/dist/nodes/TwitchRedemptions/twitch.dark.svg +1 -0
- package/dist/nodes/TwitchRedemptions/twitch.svg +1 -0
- package/dist/nodes/TwitchSchedule/TwitchSchedule.node.d.ts +4 -0
- package/dist/nodes/TwitchSchedule/TwitchSchedule.node.js +457 -0
- package/dist/nodes/TwitchSchedule/TwitchSchedule.node.js.map +1 -0
- package/dist/nodes/TwitchSchedule/twitch.dark.svg +1 -0
- package/dist/nodes/TwitchSchedule/twitch.svg +1 -0
- package/dist/nodes/TwitchSearch/TwitchSearch.node.d.ts +4 -0
- package/dist/nodes/TwitchSearch/TwitchSearch.node.js +164 -0
- package/dist/nodes/TwitchSearch/TwitchSearch.node.js.map +1 -0
- package/dist/nodes/TwitchSearch/twitch.dark.svg +1 -0
- package/dist/nodes/TwitchSearch/twitch.svg +1 -0
- package/dist/nodes/TwitchStreams/TwitchStreams.node.d.ts +4 -0
- package/dist/nodes/TwitchStreams/TwitchStreams.node.js +124 -0
- package/dist/nodes/TwitchStreams/TwitchStreams.node.js.map +1 -0
- package/dist/nodes/TwitchStreams/twitch.dark.svg +1 -0
- package/dist/nodes/TwitchStreams/twitch.svg +1 -0
- package/dist/nodes/TwitchSubscriptions/TwitchSubscriptions.node.d.ts +4 -0
- package/dist/nodes/TwitchSubscriptions/TwitchSubscriptions.node.js +232 -0
- package/dist/nodes/TwitchSubscriptions/TwitchSubscriptions.node.js.map +1 -0
- package/dist/nodes/TwitchSubscriptions/twitch.dark.svg +1 -0
- package/dist/nodes/TwitchSubscriptions/twitch.svg +1 -0
- package/dist/nodes/TwitchTeams/TwitchTeams.node.d.ts +4 -0
- package/dist/nodes/TwitchTeams/TwitchTeams.node.js +219 -0
- package/dist/nodes/TwitchTeams/TwitchTeams.node.js.map +1 -0
- package/dist/nodes/TwitchTeams/twitch.dark.svg +1 -0
- package/dist/nodes/TwitchTeams/twitch.svg +1 -0
- package/dist/nodes/TwitchTrigger/TwitchTrigger.node.d.ts +12 -0
- package/dist/nodes/TwitchTrigger/TwitchTrigger.node.js +418 -0
- package/dist/nodes/TwitchTrigger/TwitchTrigger.node.js.map +1 -0
- package/dist/nodes/TwitchTrigger/twitch.dark.svg +1 -0
- package/dist/nodes/TwitchTrigger/twitch.svg +1 -0
- package/dist/nodes/TwitchUsers/TwitchUsers.node.d.ts +4 -0
- package/dist/nodes/TwitchUsers/TwitchUsers.node.js +124 -0
- package/dist/nodes/TwitchUsers/TwitchUsers.node.js.map +1 -0
- package/dist/nodes/TwitchUsers/twitch.dark.svg +1 -0
- package/dist/nodes/TwitchUsers/twitch.svg +1 -0
- package/dist/nodes/TwitchVideos/TwitchVideos.node.d.ts +4 -0
- package/dist/nodes/TwitchVideos/TwitchVideos.node.js +371 -0
- package/dist/nodes/TwitchVideos/TwitchVideos.node.js.map +1 -0
- package/dist/nodes/TwitchVideos/twitch.dark.svg +1 -0
- package/dist/nodes/TwitchVideos/twitch.svg +1 -0
- package/dist/nodes/TwitchWhispers/TwitchWhispers.node.d.ts +4 -0
- package/dist/nodes/TwitchWhispers/TwitchWhispers.node.js +105 -0
- package/dist/nodes/TwitchWhispers/TwitchWhispers.node.js.map +1 -0
- package/dist/nodes/TwitchWhispers/twitch.dark.svg +1 -0
- package/dist/nodes/TwitchWhispers/twitch.svg +1 -0
- package/dist/package.json +86 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +86 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Copyright 2025 yuniruyuni
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
4
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
5
|
+
the Software without restriction, including without limitation the rights to
|
|
6
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
7
|
+
of the Software, and to permit persons to whom the Software is furnished to do
|
|
8
|
+
so, subject to the following conditions:
|
|
9
|
+
|
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
|
11
|
+
copies or substantial portions of the Software.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
19
|
+
SOFTWARE.
|
package/README.ja.md
ADDED
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
# n8n-nodes-twitch
|
|
2
|
+
|
|
3
|
+
[](https://github.com/yuniruyuni/n8n-nodes-twitch/actions/workflows/ci.yml)
|
|
4
|
+
[](https://www.npmjs.com/package/@yuniruyuni/n8n-nodes-twitch)
|
|
5
|
+
|
|
6
|
+
Twitch API統合のためのn8nコミュニティノードパッケージです。Twitch Helix APIの包括的なサポートと、WebSocket経由のリアルタイムEventSub通知を提供します。
|
|
7
|
+
|
|
8
|
+
[n8n](https://n8n.io/)は[フェアコードライセンス](https://docs.n8n.io/reference/license/)のワークフロー自動化プラットフォームです。
|
|
9
|
+
|
|
10
|
+
[English](README.md) | 日本語
|
|
11
|
+
|
|
12
|
+
## 機能
|
|
13
|
+
|
|
14
|
+
### 25個のTwitch APIノード
|
|
15
|
+
|
|
16
|
+
すべてのノードはTwitch Helix APIのリソース指向構造に従っています:
|
|
17
|
+
|
|
18
|
+
**ユーザー&チャンネル管理:**
|
|
19
|
+
- **Twitch Users** - ユーザー情報の取得
|
|
20
|
+
- **Twitch Channels** - チャンネル情報の取得
|
|
21
|
+
- **Twitch Streams** - 配信情報の取得
|
|
22
|
+
|
|
23
|
+
**コンテンツ&メディア:**
|
|
24
|
+
- **Twitch Clips** - クリップの取得、作成
|
|
25
|
+
- **Twitch Videos** - 動画の取得
|
|
26
|
+
- **Twitch Games** - ゲーム情報の取得、人気ゲームの取得
|
|
27
|
+
- **Twitch Search** - カテゴリ、チャンネル、配信の検索
|
|
28
|
+
|
|
29
|
+
**チャット&コミュニケーション:**
|
|
30
|
+
- **Twitch Chat Messages** - メッセージの送信
|
|
31
|
+
- **Twitch Chatters** - チャット参加者リストの取得
|
|
32
|
+
- **Twitch Emotes** - チャンネルエモートの取得
|
|
33
|
+
- **Twitch Announcements** - アナウンスの送信
|
|
34
|
+
- **Twitch Whispers** - ウィスパーの送信
|
|
35
|
+
|
|
36
|
+
**チャンネルポイント&報酬:**
|
|
37
|
+
- **Twitch Custom Rewards** - カスタム報酬の作成、取得、更新、削除
|
|
38
|
+
- **Twitch Redemptions** - 引き換え状況の取得、更新
|
|
39
|
+
|
|
40
|
+
**モデレーション:**
|
|
41
|
+
- **Twitch Bans** - ユーザーのBAN、BAN解除、BANユーザーの取得
|
|
42
|
+
- **Twitch Moderators** - モデレーターの取得、追加、削除
|
|
43
|
+
|
|
44
|
+
**エンゲージメント:**
|
|
45
|
+
- **Twitch Polls** - 投票の取得、作成、終了
|
|
46
|
+
- **Twitch Predictions** - 予想の取得、作成、ロック、解決
|
|
47
|
+
- **Twitch Raids** - レイドの開始、キャンセル
|
|
48
|
+
|
|
49
|
+
**収益化:**
|
|
50
|
+
- **Twitch Bits Leaderboard** - Bitsリーダーボードの取得
|
|
51
|
+
- **Twitch Cheermotes** - Cheermotesの取得
|
|
52
|
+
- **Twitch Subscriptions** - 配信者のサブスクリプション取得、ユーザーサブスクリプション確認
|
|
53
|
+
|
|
54
|
+
**スケジュール&チーム:**
|
|
55
|
+
- **Twitch Schedule** - 配信スケジュールの取得、作成、更新、削除
|
|
56
|
+
- **Twitch Teams** - チャンネルチーム、チーム情報の取得
|
|
57
|
+
|
|
58
|
+
### EventSub トリガーノード
|
|
59
|
+
|
|
60
|
+
**Twitch Trigger** - Webhook経由のリアルタイムイベント通知:
|
|
61
|
+
|
|
62
|
+
- **配信イベント:** オンライン、オフライン
|
|
63
|
+
- **チャンネルイベント:** 更新、フォロー、サブスクライブ、サブスク終了/ギフト/メッセージ、Cheer、レイド、BAN、BAN解除
|
|
64
|
+
- **チャットイベント:** メッセージ、クリア、通知、メッセージ削除、ユーザーメッセージクリア
|
|
65
|
+
- **チャンネルポイント:** カスタム報酬の追加/更新/削除、引き換えの追加/更新
|
|
66
|
+
- **投票:** 開始、進行、終了
|
|
67
|
+
- **予想:** 開始、進行、ロック、終了
|
|
68
|
+
- **目標:** 開始、進行、終了
|
|
69
|
+
- **Hype Train:** 開始、進行、終了
|
|
70
|
+
- **モデレーター:** 追加、削除
|
|
71
|
+
- **シールドモード:** 開始、終了
|
|
72
|
+
- **シャウトアウト:** 作成、受信
|
|
73
|
+
|
|
74
|
+
**45種類以上のEventSubイベントをサポート**、自動サブスクリプション管理と署名検証を実装しています。
|
|
75
|
+
|
|
76
|
+
## 認証
|
|
77
|
+
|
|
78
|
+
2つの認証方法をサポートしています:
|
|
79
|
+
|
|
80
|
+
1. **Client Credentials** (TwitchApi) - Client IDとSecretを使用したアプリアクセストークン
|
|
81
|
+
2. **OAuth2** (TwitchOAuth2Api) - カスタマイズ可能なスコープを持つユーザーアクセストークン
|
|
82
|
+
|
|
83
|
+
OAuth2認証では以下のスコープを選択できます:
|
|
84
|
+
- ユーザー情報 (`user:read:email`)
|
|
85
|
+
- チャンネル管理 (`channel:manage:*`)
|
|
86
|
+
- モデレーション (`moderator:manage:*`)
|
|
87
|
+
- チャット操作 (`chat:read`, `chat:edit`)
|
|
88
|
+
- その他多数...
|
|
89
|
+
|
|
90
|
+
## インストール
|
|
91
|
+
|
|
92
|
+
### セルフホスト版n8n
|
|
93
|
+
|
|
94
|
+
n8nのインストールディレクトリでnpm経由でインストール:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
npm install @yuniruyuni/n8n-nodes-twitch
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
またはn8n環境に追加:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
N8N_CUSTOM_EXTENSIONS="/path/to/@yuniruyuni/n8n-nodes-twitch"
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Dockerインストールの場合は、パッケージをマウントするかカスタムノードディレクトリに追加してください。
|
|
107
|
+
|
|
108
|
+
### n8n Cloud
|
|
109
|
+
|
|
110
|
+
**完全互換** - このパッケージは外部依存関係のない宣言的ルーティングパターンを使用しています。Twitch TriggerノードはEventSub通知にWebhookを使用しており、n8n Cloudでシームレスに動作します。
|
|
111
|
+
|
|
112
|
+
## 互換性
|
|
113
|
+
|
|
114
|
+
- **n8nバージョン:** 1.0.0以上
|
|
115
|
+
- **Node.jsバージョン:** 18.10.0以上(推奨: 20.x)
|
|
116
|
+
|
|
117
|
+
## 使い方
|
|
118
|
+
|
|
119
|
+
### Twitch認証情報の設定
|
|
120
|
+
|
|
121
|
+
1. [Twitch Developer Console](https://dev.twitch.tv/console/apps)にアクセス
|
|
122
|
+
2. 新しいアプリケーションを作成するか、既存のものを使用
|
|
123
|
+
3. Client IDとClient Secretをメモ
|
|
124
|
+
4. OAuth2の場合、OAuth Redirect URLをn8nインスタンスに設定(例: `https://your-n8n.com/rest/oauth2-credential/callback`)
|
|
125
|
+
|
|
126
|
+
### Twitchノードの使用
|
|
127
|
+
|
|
128
|
+
1. ワークフローにTwitchノードを追加
|
|
129
|
+
2. 新しい認証情報を作成(Client CredentialsまたはOAuth2)
|
|
130
|
+
3. 実行したい操作を選択
|
|
131
|
+
4. 必要なパラメータを設定
|
|
132
|
+
5. ワークフローを実行
|
|
133
|
+
|
|
134
|
+
### Twitch Triggerの使用
|
|
135
|
+
|
|
136
|
+
1. ワークフローにTwitch Triggerノードを追加
|
|
137
|
+
2. 認証情報を作成(Client CredentialsまたはOAuth2、適切なスコープを設定)
|
|
138
|
+
3. リッスンしたいEventSubイベントタイプを選択
|
|
139
|
+
4. broadcaster IDとその他の必要なパラメータを設定
|
|
140
|
+
5. ワークフローをアクティブ化してイベントの受信を開始
|
|
141
|
+
|
|
142
|
+
トリガーはWebhookを使用してTwitchからリアルタイムイベントを受信します。n8nが自動的に安全なHTTPS Webhook URLを提供するため、手動でのWebhook設定は不要です。ワークフローをアクティブ化すると、ノードは自動的に:
|
|
143
|
+
- TwitchにEventSubサブスクリプションを作成
|
|
144
|
+
- TwitchのチャレンジメカニズムでWebhookを検証
|
|
145
|
+
- セキュリティのためにイベント署名を検証
|
|
146
|
+
- ワークフロー非アクティブ化時にサブスクリプションを自動クリーンアップ
|
|
147
|
+
|
|
148
|
+
## 開発
|
|
149
|
+
|
|
150
|
+
### 必要要件
|
|
151
|
+
|
|
152
|
+
- Node.js 18.10.0以上
|
|
153
|
+
- npm
|
|
154
|
+
|
|
155
|
+
### セットアップ
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
# リポジトリをクローン
|
|
159
|
+
git clone https://github.com/yuniruyuni/n8n-nodes-twitch.git
|
|
160
|
+
cd n8n-nodes-twitch
|
|
161
|
+
|
|
162
|
+
# 依存関係をインストール
|
|
163
|
+
npm install
|
|
164
|
+
|
|
165
|
+
# ノードをビルド
|
|
166
|
+
npm run build
|
|
167
|
+
|
|
168
|
+
# ノードをロードしてn8nを起動(開発モード)
|
|
169
|
+
npm run dev
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### 利用可能なスクリプト
|
|
173
|
+
|
|
174
|
+
| スクリプト | 説明 |
|
|
175
|
+
| --------------------- | --------------------------------------------------------- |
|
|
176
|
+
| `npm run dev` | ノードをロードしてn8nを起動、変更を監視 |
|
|
177
|
+
| `npm run build` | TypeScriptをJavaScriptにコンパイル |
|
|
178
|
+
| `npm run build:watch` | ウォッチモードでビルド(自動再ビルド) |
|
|
179
|
+
| `npm run lint` | コードのエラーとスタイルの問題をチェック |
|
|
180
|
+
| `npm run lint:fix` | lintの問題を自動修正 |
|
|
181
|
+
| `npm run release` | 新しいリリースを作成 |
|
|
182
|
+
|
|
183
|
+
### リリースプロセス
|
|
184
|
+
|
|
185
|
+
このプロジェクトは `n8n-node release`(内部で`release-it`を使用)で自動リリースを行います:
|
|
186
|
+
|
|
187
|
+
**推奨: GitHub Actions**
|
|
188
|
+
|
|
189
|
+
1. **Actions** → **Release** → **Run workflow** に移動
|
|
190
|
+
2. **Run workflow** をクリック
|
|
191
|
+
3. GitHub Actionsが自動的に:
|
|
192
|
+
- lintとbuildを実行
|
|
193
|
+
- package.jsonのバージョンを更新(デフォルトの増分)
|
|
194
|
+
- CHANGELOGを生成
|
|
195
|
+
- gitのcommitとtagを作成
|
|
196
|
+
- npmに公開
|
|
197
|
+
- リリースノート付きのGitHubリリースを作成
|
|
198
|
+
|
|
199
|
+
**代替: ローカルリリース**
|
|
200
|
+
|
|
201
|
+
ローカル開発環境で実行する場合:
|
|
202
|
+
```bash
|
|
203
|
+
npm run release
|
|
204
|
+
```
|
|
205
|
+
`n8n-node release`による対話的なリリースプロセスを提供します。
|
|
206
|
+
|
|
207
|
+
**前提条件**:
|
|
208
|
+
- GitHubリポジトリ設定で `NPM_TOKEN` シークレットを設定
|
|
209
|
+
- `@yuniruyuni/n8n-nodes-twitch` のnpm公開権限があること
|
|
210
|
+
- ローカルリリースの場合: `npm login` と `master` ブランチでクリーンなgit状態が必要
|
|
211
|
+
|
|
212
|
+
## アーキテクチャ
|
|
213
|
+
|
|
214
|
+
このパッケージはすべてのノードで**宣言的/ローコードスタイル**を使用しています:
|
|
215
|
+
|
|
216
|
+
- Twitch Helix API (`https://api.twitch.tv/helix`) への直接呼び出し
|
|
217
|
+
- HTTPリクエストにn8nの `routing` プロパティを使用
|
|
218
|
+
- **外部依存関係なし** - n8n Cloudと完全互換
|
|
219
|
+
- Twitch Helix APIに合わせたリソース指向設計
|
|
220
|
+
|
|
221
|
+
Twitch Triggerノードはn8nのWebhookシステムを使用してHTTPS経由でEventSub通知を受信し、セキュリティのための署名検証が組み込まれています。
|
|
222
|
+
|
|
223
|
+
## リソース
|
|
224
|
+
|
|
225
|
+
- [n8nドキュメント](https://docs.n8n.io/)
|
|
226
|
+
- [Twitch APIドキュメント](https://dev.twitch.tv/docs/api/)
|
|
227
|
+
- [Twitch EventSubドキュメント](https://dev.twitch.tv/docs/eventsub/)
|
|
228
|
+
- [Twitch Developer Console](https://dev.twitch.tv/console)
|
|
229
|
+
|
|
230
|
+
## ライセンス
|
|
231
|
+
|
|
232
|
+
[MIT](LICENSE.md)
|
|
233
|
+
|
|
234
|
+
## バージョン履歴
|
|
235
|
+
|
|
236
|
+
### 0.1.0
|
|
237
|
+
|
|
238
|
+
- 初回リリース
|
|
239
|
+
- Users、Channels、Streams、Chat、Moderation、Channel Pointsなどをカバーする25個のTwitch APIノード
|
|
240
|
+
- EventSub Webhookサポート(45種類以上のイベント)を持つTwitch Triggerノード
|
|
241
|
+
- Client CredentialsとOAuth2認証
|
|
242
|
+
- Twitch Helix API構造に合わせたリソース指向アーキテクチャ
|
|
243
|
+
- **n8n Cloud互換** - 外部依存関係なし
|
package/README.md
ADDED
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
# n8n-nodes-twitch
|
|
2
|
+
|
|
3
|
+
[](https://github.com/yuniruyuni/n8n-nodes-twitch/actions/workflows/ci.yml)
|
|
4
|
+
[](https://www.npmjs.com/package/@yuniruyuni/n8n-nodes-twitch)
|
|
5
|
+
|
|
6
|
+
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.
|
|
7
|
+
|
|
8
|
+
[n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/reference/license/) workflow automation platform.
|
|
9
|
+
|
|
10
|
+
English | [日本語](README.ja.md)
|
|
11
|
+
|
|
12
|
+
## Features
|
|
13
|
+
|
|
14
|
+
### 25 Twitch API Nodes
|
|
15
|
+
|
|
16
|
+
All nodes follow Twitch Helix API's resource-oriented structure:
|
|
17
|
+
|
|
18
|
+
**User & Channel Management:**
|
|
19
|
+
- **Twitch Users** - Get user information
|
|
20
|
+
- **Twitch Channels** - Get channel information
|
|
21
|
+
- **Twitch Streams** - Get stream information
|
|
22
|
+
|
|
23
|
+
**Content & Media:**
|
|
24
|
+
- **Twitch Clips** - Get, create clips
|
|
25
|
+
- **Twitch Videos** - Get videos
|
|
26
|
+
- **Twitch Games** - Get games, top games
|
|
27
|
+
- **Twitch Search** - Search categories, channels, streams
|
|
28
|
+
|
|
29
|
+
**Chat & Communication:**
|
|
30
|
+
- **Twitch Chat Messages** - Send messages
|
|
31
|
+
- **Twitch Chatters** - Get chatters list
|
|
32
|
+
- **Twitch Emotes** - Get channel emotes
|
|
33
|
+
- **Twitch Announcements** - Send announcements
|
|
34
|
+
- **Twitch Whispers** - Send whispers
|
|
35
|
+
|
|
36
|
+
**Channel Points & Rewards:**
|
|
37
|
+
- **Twitch Custom Rewards** - Create, get, update, delete custom rewards
|
|
38
|
+
- **Twitch Redemptions** - Get, update redemption status
|
|
39
|
+
|
|
40
|
+
**Moderation:**
|
|
41
|
+
- **Twitch Bans** - Ban, unban users, get banned users
|
|
42
|
+
- **Twitch Moderators** - Get, add, remove moderators
|
|
43
|
+
|
|
44
|
+
**Engagement:**
|
|
45
|
+
- **Twitch Polls** - Get, create, end polls
|
|
46
|
+
- **Twitch Predictions** - Get, create, lock, resolve predictions
|
|
47
|
+
- **Twitch Raids** - Start, cancel raids
|
|
48
|
+
|
|
49
|
+
**Monetization:**
|
|
50
|
+
- **Twitch Bits Leaderboard** - Get bits leaderboard
|
|
51
|
+
- **Twitch Cheermotes** - Get cheermotes
|
|
52
|
+
- **Twitch Subscriptions** - Get broadcaster subscriptions, check user subscription
|
|
53
|
+
|
|
54
|
+
**Scheduling & Teams:**
|
|
55
|
+
- **Twitch Schedule** - Get, create, update, delete stream segments
|
|
56
|
+
- **Twitch Teams** - Get channel teams, team information
|
|
57
|
+
|
|
58
|
+
### EventSub Trigger Node
|
|
59
|
+
|
|
60
|
+
**Twitch Trigger** - Real-time event notifications via Webhook:
|
|
61
|
+
|
|
62
|
+
- **Stream Events:** online, offline
|
|
63
|
+
- **Channel Events:** update, follow, subscribe, subscription end/gift/message, cheer, raid, ban, unban
|
|
64
|
+
- **Chat Events:** message, clear, notification, message delete, clear user messages
|
|
65
|
+
- **Channel Points:** custom reward add/update/remove, redemption add/update
|
|
66
|
+
- **Polls:** begin, progress, end
|
|
67
|
+
- **Predictions:** begin, progress, lock, end
|
|
68
|
+
- **Goals:** begin, progress, end
|
|
69
|
+
- **Hype Train:** begin, progress, end
|
|
70
|
+
- **Moderator:** add, remove
|
|
71
|
+
- **Shield Mode:** begin, end
|
|
72
|
+
- **Shoutout:** create, receive
|
|
73
|
+
|
|
74
|
+
**Supports 45+ EventSub events** with automatic subscription management and signature verification.
|
|
75
|
+
|
|
76
|
+
## Authentication
|
|
77
|
+
|
|
78
|
+
Two authentication methods are supported:
|
|
79
|
+
|
|
80
|
+
1. **Client Credentials** (TwitchApi) - App access tokens using Client ID and Secret
|
|
81
|
+
2. **OAuth2** (TwitchOAuth2Api) - User access tokens with customizable scopes
|
|
82
|
+
|
|
83
|
+
OAuth2 credentials include scope selection for:
|
|
84
|
+
- User information (`user:read:email`)
|
|
85
|
+
- Channel management (`channel:manage:*`)
|
|
86
|
+
- Moderation (`moderator:manage:*`)
|
|
87
|
+
- Chat operations (`chat:read`, `chat:edit`)
|
|
88
|
+
- And many more...
|
|
89
|
+
|
|
90
|
+
## Installation
|
|
91
|
+
|
|
92
|
+
### Self-Hosted n8n
|
|
93
|
+
|
|
94
|
+
Install via npm in your n8n installation directory:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
npm install @yuniruyuni/n8n-nodes-twitch
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Or add to your n8n environment:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
N8N_CUSTOM_EXTENSIONS="/path/to/@yuniruyuni/n8n-nodes-twitch"
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
For Docker installations, mount the package or add to your custom nodes directory.
|
|
107
|
+
|
|
108
|
+
### n8n Cloud
|
|
109
|
+
|
|
110
|
+
**Fully compatible** - This package uses the declarative routing pattern with no external dependencies. The Twitch Trigger node uses webhooks for EventSub notifications, which work seamlessly on n8n Cloud.
|
|
111
|
+
|
|
112
|
+
## Compatibility
|
|
113
|
+
|
|
114
|
+
- **n8n version:** 1.0.0 or higher
|
|
115
|
+
- **Node.js version:** 18.10.0 or higher (recommended: 20.x)
|
|
116
|
+
|
|
117
|
+
## Usage
|
|
118
|
+
|
|
119
|
+
### Setting up Twitch Credentials
|
|
120
|
+
|
|
121
|
+
1. Go to [Twitch Developer Console](https://dev.twitch.tv/console/apps)
|
|
122
|
+
2. Create a new application or use an existing one
|
|
123
|
+
3. Note your Client ID and Client Secret
|
|
124
|
+
4. For OAuth2, set the OAuth Redirect URL to your n8n instance (e.g., `https://your-n8n.com/rest/oauth2-credential/callback`)
|
|
125
|
+
|
|
126
|
+
### Using Twitch Nodes
|
|
127
|
+
|
|
128
|
+
1. Add a Twitch node to your workflow
|
|
129
|
+
2. Create new credentials (Client Credentials or OAuth2)
|
|
130
|
+
3. Select the operation you want to perform
|
|
131
|
+
4. Configure the required parameters
|
|
132
|
+
5. Execute the workflow
|
|
133
|
+
|
|
134
|
+
### Using Twitch Trigger
|
|
135
|
+
|
|
136
|
+
1. Add the Twitch Trigger node to your workflow
|
|
137
|
+
2. Create credentials (Client Credentials or OAuth2 with appropriate scopes)
|
|
138
|
+
3. Select the EventSub event type you want to listen for
|
|
139
|
+
4. Configure broadcaster ID and other required parameters
|
|
140
|
+
5. Activate the workflow to start receiving events
|
|
141
|
+
|
|
142
|
+
The trigger uses webhooks to receive real-time events from Twitch. n8n automatically provides a secure HTTPS webhook URL (no manual webhook setup required on your end). When you activate the workflow, the node automatically:
|
|
143
|
+
- Creates an EventSub subscription on Twitch
|
|
144
|
+
- Verifies the webhook with Twitch's challenge mechanism
|
|
145
|
+
- Validates event signatures for security
|
|
146
|
+
- Automatically cleans up the subscription when the workflow is deactivated
|
|
147
|
+
|
|
148
|
+
## Development
|
|
149
|
+
|
|
150
|
+
### Prerequisites
|
|
151
|
+
|
|
152
|
+
- Node.js 18.10.0 or higher
|
|
153
|
+
- npm
|
|
154
|
+
|
|
155
|
+
### Setup
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
# Clone the repository
|
|
159
|
+
git clone https://github.com/yuniruyuni/n8n-nodes-twitch.git
|
|
160
|
+
cd n8n-nodes-twitch
|
|
161
|
+
|
|
162
|
+
# Install dependencies
|
|
163
|
+
npm install
|
|
164
|
+
|
|
165
|
+
# Build the nodes
|
|
166
|
+
npm run build
|
|
167
|
+
|
|
168
|
+
# Start n8n with the nodes loaded (development mode)
|
|
169
|
+
npm run dev
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### Available Scripts
|
|
173
|
+
|
|
174
|
+
| Script | Description |
|
|
175
|
+
| --------------------- | ---------------------------------------------------------------- |
|
|
176
|
+
| `npm run dev` | Start n8n with your node and watch for changes |
|
|
177
|
+
| `npm run build` | Compile TypeScript to JavaScript |
|
|
178
|
+
| `npm run build:watch` | Build in watch mode (auto-rebuild on changes) |
|
|
179
|
+
| `npm run lint` | Check code for errors and style issues |
|
|
180
|
+
| `npm run lint:fix` | Automatically fix linting issues |
|
|
181
|
+
| `npm run release` | Create a new release |
|
|
182
|
+
|
|
183
|
+
### Release Process
|
|
184
|
+
|
|
185
|
+
This project uses `n8n-node release` (powered by `release-it`) for automated releases:
|
|
186
|
+
|
|
187
|
+
**Recommended: GitHub Actions**
|
|
188
|
+
|
|
189
|
+
1. Go to **Actions** → **Release** → **Run workflow**
|
|
190
|
+
2. Click **Run workflow**
|
|
191
|
+
3. GitHub Actions automatically:
|
|
192
|
+
- Runs lint and build
|
|
193
|
+
- Updates version in package.json (default increment)
|
|
194
|
+
- Generates CHANGELOG
|
|
195
|
+
- Creates git commit and tag
|
|
196
|
+
- Publishes to npm
|
|
197
|
+
- Creates GitHub release with notes
|
|
198
|
+
|
|
199
|
+
**Alternative: Local Release**
|
|
200
|
+
|
|
201
|
+
For local development workflow:
|
|
202
|
+
```bash
|
|
203
|
+
npm run release
|
|
204
|
+
```
|
|
205
|
+
This provides an interactive release process managed by `n8n-node release`.
|
|
206
|
+
|
|
207
|
+
**Prerequisites**:
|
|
208
|
+
- Set `NPM_TOKEN` secret in GitHub repository settings
|
|
209
|
+
- Ensure you have npm publishing rights for `@yuniruyuni/n8n-nodes-twitch`
|
|
210
|
+
- For local releases: `npm login` and clean git state on `master` branch required
|
|
211
|
+
|
|
212
|
+
## Architecture
|
|
213
|
+
|
|
214
|
+
This package uses the **declarative/low-code style** for all nodes:
|
|
215
|
+
|
|
216
|
+
- Direct calls to Twitch Helix API (`https://api.twitch.tv/helix`)
|
|
217
|
+
- n8n's `routing` property for HTTP requests
|
|
218
|
+
- **No external dependencies** - fully compatible with n8n Cloud
|
|
219
|
+
- Resource-oriented structure aligned with Twitch Helix API
|
|
220
|
+
|
|
221
|
+
The Twitch Trigger node uses n8n's webhook system to receive EventSub notifications via HTTPS, with built-in signature verification for security.
|
|
222
|
+
|
|
223
|
+
## Resources
|
|
224
|
+
|
|
225
|
+
- [n8n Documentation](https://docs.n8n.io/)
|
|
226
|
+
- [Twitch API Documentation](https://dev.twitch.tv/docs/api/)
|
|
227
|
+
- [Twitch EventSub Documentation](https://dev.twitch.tv/docs/eventsub/)
|
|
228
|
+
- [Twitch Developer Console](https://dev.twitch.tv/console)
|
|
229
|
+
|
|
230
|
+
## License
|
|
231
|
+
|
|
232
|
+
[MIT](LICENSE.md)
|
|
233
|
+
|
|
234
|
+
## Version History
|
|
235
|
+
|
|
236
|
+
### 0.1.0
|
|
237
|
+
|
|
238
|
+
- Initial release
|
|
239
|
+
- 25 Twitch API nodes covering Users, Channels, Streams, Chat, Moderation, Channel Points, and more
|
|
240
|
+
- Twitch Trigger node with EventSub Webhook support (45+ events)
|
|
241
|
+
- Client Credentials and OAuth2 authentication
|
|
242
|
+
- Resource-oriented architecture aligned with Twitch Helix API structure
|
|
243
|
+
- **n8n Cloud compatible** - No external dependencies
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IAuthenticateGeneric, Icon, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare class TwitchApi implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
icon: Icon;
|
|
6
|
+
documentationUrl: string;
|
|
7
|
+
properties: INodeProperties[];
|
|
8
|
+
authenticate: IAuthenticateGeneric;
|
|
9
|
+
test: ICredentialTestRequest;
|
|
10
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TwitchApi = void 0;
|
|
4
|
+
class TwitchApi {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'twitchApi';
|
|
7
|
+
this.displayName = 'Twitch API';
|
|
8
|
+
this.icon = { light: 'file:../icons/twitch.svg', dark: 'file:../icons/twitch.dark.svg' };
|
|
9
|
+
this.documentationUrl = 'https://dev.twitch.tv/docs/authentication/';
|
|
10
|
+
this.properties = [
|
|
11
|
+
{
|
|
12
|
+
displayName: 'Client ID',
|
|
13
|
+
name: 'clientId',
|
|
14
|
+
type: 'string',
|
|
15
|
+
default: '',
|
|
16
|
+
required: true,
|
|
17
|
+
description: 'The Client ID from your Twitch application',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
displayName: 'Client Secret',
|
|
21
|
+
name: 'clientSecret',
|
|
22
|
+
type: 'string',
|
|
23
|
+
typeOptions: { password: true },
|
|
24
|
+
default: '',
|
|
25
|
+
required: true,
|
|
26
|
+
description: 'The Client Secret from your Twitch application',
|
|
27
|
+
},
|
|
28
|
+
];
|
|
29
|
+
this.authenticate = {
|
|
30
|
+
type: 'generic',
|
|
31
|
+
properties: {
|
|
32
|
+
headers: {
|
|
33
|
+
'Client-ID': '={{$credentials.clientId}}',
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
this.test = {
|
|
38
|
+
request: {
|
|
39
|
+
baseURL: 'https://api.twitch.tv/helix',
|
|
40
|
+
url: '/users',
|
|
41
|
+
method: 'GET',
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
exports.TwitchApi = TwitchApi;
|
|
47
|
+
//# sourceMappingURL=TwitchApi.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TwitchApi.credentials.js","sourceRoot":"","sources":["../../credentials/TwitchApi.credentials.ts"],"names":[],"mappings":";;;AAQA,MAAa,SAAS;IAAtB;QACC,SAAI,GAAG,WAAW,CAAC;QAEnB,gBAAW,GAAG,YAAY,CAAC;QAE3B,SAAI,GAAS,EAAE,KAAK,EAAE,0BAA0B,EAAE,IAAI,EAAE,+BAA+B,EAAE,CAAC;QAE1F,qBAAgB,GAAG,4CAA4C,CAAC;QAEhE,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,WAAW;gBACxB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,4CAA4C;aACzD;YACD;gBACC,WAAW,EAAE,eAAe;gBAC5B,IAAI,EAAE,cAAc;gBACpB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,gDAAgD;aAC7D;SACD,CAAC;QAEF,iBAAY,GAAyB;YACpC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE;gBACX,OAAO,EAAE;oBACR,WAAW,EAAE,4BAA4B;iBACzC;aACD;SACD,CAAC;QAEF,SAAI,GAA2B;YAC9B,OAAO,EAAE;gBACR,OAAO,EAAE,6BAA6B;gBACtC,GAAG,EAAE,QAAQ;gBACb,MAAM,EAAE,KAAK;aACb;SACD,CAAC;IACH,CAAC;CAAA;AA7CD,8BA6CC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Icon, ICredentialDataDecryptedObject, ICredentialType, IDataObject, IHttpRequestHelper, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare class TwitchOAuth2Api implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
extends: string[];
|
|
5
|
+
displayName: string;
|
|
6
|
+
icon: Icon;
|
|
7
|
+
documentationUrl: string;
|
|
8
|
+
properties: INodeProperties[];
|
|
9
|
+
preAuthentication(this: IHttpRequestHelper, credentials: ICredentialDataDecryptedObject): Promise<IDataObject>;
|
|
10
|
+
}
|