Talk to Alexa skills running on your local machine. Stop waiting for Lambda deployments. Debug step-by-step.
- Works with skills developed using the official Alexa NodeJS SDK v2.
- Uses ngrok to expose your local endpoint to Alexa and inspect requests and responses.
- Find the
index.js
file containing your ASK SDK NodeJS skill handler code (usually inskill-name/lambda/custom
) - Add
server.js
to the same folder whereindex.js
is located
- Run
node lambda/custom/server.js
(or wherever it is located) - In a separate terminal, run
ngrok http 8080
. This will create a public HTTPS endpoint that forwards requests to your local HTTP server listening on port 8080. - In your Alexa Developer Console go to the Build tab, and in the Endpoint section update the HTTPS endpoint with the one provided by ngrok, e.g.
https://abc123.ngrok.io
and check the optionMy development endpoint is a sub-domain of a domain that has a wildcard certificate from a certificate authority
. - Check that the skill is enabled for your account in the Test section of your Alexa Developer Console. You can also enable it using
ask api enable-skill -s SKILL_ID
- Invoke the skill as usual. You should see each request on ngrok. You can open http://127.0.0.1:4040 to inspect the requests and responses.
- You can run
server.js
in debug mode and use breakpoints. On VS Code, openserver.js
and click Debug > Start Debugging
This is an extremely simple piece of code meant only for initial testing purposes.
- Each time
ngrok
is executed, the public endpoint will change and you will need to update it on the Alexa console - HTTPS is provided by ngrok. If you want to expose a public HTTPS endpoint follow this tutorial
- No access to AWS DynamoDB. Check the Alexa Developer Blog Post on how to debug locally with access to AWS resources