This is a bundle for NodeCG. This bundle provides a direct integration with the Twitch API, specifically the following:
- PubSub API
- Subscription Event
- Bits Event
- Bits Badge Event
- Channel Point Redemption
To use this bundle, install NodeCG as per the usual instructions, then:
cd bundles
git clone https://github.com/TBSliver/twitch-bundle.git
cd twitch-bundle
npm install
npm run build
This adds a new Settings workspace. you will need to have a Twitch Dev Application set up with the correct callback url
- this is displayed in the Twitch Auth panel, with form inputs for the Client ID and Secret.
The following messages are available:
bits
subscription
redemption
bitsBadgeUnlock
The data received by this is identical to that returned by Twitch - see the PubSub Documentation for more information. You will also need to specify the bundle name to receive the messages as well.
Example:
nodecg.listenFor('redemption', 'twitch-bundle', message => {
console.log(`${message.redemption.user.display_name} redeemed ${message.redemption.reward.title}`);
});
If you find any issues with this, please open an issue! or ask in my Discord, or the Official NodeCG Discord for general issues and development help!
Tom "TBSliver" Bloor