7 April 2018
Alexa SDK isn't that new, I think it's available since 2015. Yet, there isn't much support, isn't enough StackOverflow, and certainly isn't enough YouTube videos. So it can be tricky to debug where the app went wrong between Amazon dev portal, Alexa skill set-up, and AWS Lambda set-up and function. So this is what went wrong in my 'hello world' skill, that, hopefully, may help someone to debug quicker.
Only US East (N. Virginia) and EU West (Ireland) can support Alexa Voice Services. I, somehow, ended up in Oregon at first. That did not work well for me when I was trying to setup Default Region (Endpoint section) in my Alexa Skill app on my Amazon dev portal.
The language settings affect who uses your app and whether it will play on your own device. Make sure your skill has the same language as your device, even the dialects, i .e. US, UK, etc.
When publishing/launching your skills, do choose the languages you want to support as well as regions, i.e. countries who can use them. Read more on that here.
This MUST be lambda_basic_execution
.
After you activate 'Alexa Skills Kit' as a trigger on your AWS Lambda function, insert the Alexa Skill ID first, and only THEN configure your arn:aws
endpoint in your Alexa skill.
node_modules
have to be in your zip folderTher are no npm install
commands for Alexa skills as far as I'm aware. So when you'll be zipping your skill files, include your node_modules
there as well.
NOTE: index.js should be in the root.
APP_ID
is appId
nowWhen writing your exports.handler function, you'll need to set your appId there. Forums say it's done with APP_ID
:
const Alexa = require("alexa-sdk"); exports.handler = function (event, context, callback) { const alexa = Alexa.handler(event, context); // Right here alexa.APP_ID = "amzn1.ask.skill.sample-skill-id"; alexa.registerHandlers(handlers); alexa.execute(); };
This is wrong. This is out of date. Use appId instead:
const Alexa = require("alexa-sdk"); exports.handler = function (event, context, callback) { const alexa = Alexa.handler(event, context); // Do this instead alexa.appId = "amzn1.ask.skill.sample-skill-id"; alexa.registerHandlers(handlers); alexa.execute(); };
I don't know why. Just doesn't. Might be a bug. Might be me (more likely). I just use Echo dot, AWS Lambda Logs, and Amazon Alexa Andoird app for some error printing.
Hope this helps. Feel free to comment what went wrong with your skill dev process, or share a link to your blog. :)