A basic Express server example for logging in with Twitch.
- Clone the repository:
git clone https://github.com/AlcaDesign/Twitch-AuthServer-Example.git
. - Create the file "config.json" based on the
/config/config.default.json
.- Create or edit a Twitch app that will redirect to
http://127.0.0.1:3000/auth/twitch/callback
. - Insert the generated client ID and client secret into their respective fields.
- Change the scope as needed.
- Create a random key to put in
session.secret
(a phrase or just random bits if you'd prefer).
- Create or edit a Twitch app that will redirect to
- Run the
npm install
command in the repository folder to install the node dependencies. - Run the server:
node index.js
. - Open to this page in your browser:
http://127.0.0.1:3000/
. - Click "Login" and authorize your app with your credentials.
- Once you're redirected, you should be back to the first page and your name should have appeared.