Go to https://dev.twitch.tv/console/apps/create and register a new app
Check that your app shows up at https://dev.twitch.tv/console
mkdir TwitchChatbot <---------- create new folder called TwitchChatbot
cd TwitchChatbot <---------- go into that folder
yarn init <---------- sets up Yarn and creates package.json file
yarn add dotenv <---------- for managing secret keys
yarn add tmi.js <---------- for talking to Twitch API
Open the TwitchChatbot folder in your code editor (Ie. VSCode). Folder structure should look like this now:
Inside package.json, add a line for “type”
{
"name": "TwitchChatbot",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"type": "module", <----------- add this
"dependencies": {
"dotenv": "^16.0.3",
"tmi.js": "^1.8.5"
}
}