Alexa skill that provides actions for streamers on Twitch.tv
- add utils to the
modules/utils.jsfile - to test the util on its own, add it to the
tests/utils-run-example.jsfile - add util unit tests to the
tests/utils.tests.jsfile tests/all-the-tests.tests.jsis where the handlers are tested (TODO: Rename this file...)index.jsfile has all of the intent handlersresponses.jsis where all strings should live
Run npm run deploy to run the gulp script to upload files to Lambda function.
This function will inject Environment variables from the secrets file, add relevant files to the dist/ folder, zip all these files, and then upload to the selected Lambda function.
To change which Lambda function is deployed to, change functionName in lambda-config.js
If you need to deploy to the TestSkill, ensure you also update the
AlexaAppIdin thecredentials.jsfile to match. If you forget to do this step, the App will not run and will giveError: Invalid ApplicationId.
TODO: Upgrade the deploy script to ask which environment (EU vs US) to deploy to along with which lambda function (test vs prod) to deploy to
To test the Util functions locally:
- Open Integrated Terminal in VS Code
- Call functions that need to be tested from file
- Run
node fileName.js- example
node utilsTest.js
- example
Use npm run test-utils to run the utils unit tests.
Use npm run test to run all of the tests (including handler tests).
- Use nock to mock responses from APIs (looks very similar to what is in the utils tests)
If Twitch updates the scope permissions to hit an API follow these steps to update the skills
1d. Better error handling for all functions 1dd. If API call fails, need to handle err, or if invalid data returned 3. How to update the account linking and get users to reauth (forcibly) rather than, option, if they dont update they wont get the new subscriber endpoint