starter kit to help you develop your alexa skills via aws lambdas
alexa, tell hello world that i said hi
"hello world"
alexa, tell hello world that i said bye
"goodbye world"
tutorial outlined below for simple hello world example. it is highly recommended you follow the tutorial prior to editing code
lambdas refer to AWS hosted functions
// local.js
function() { //do stuff }
// lambda.js (remote)
const handler function() {}
module.exports.handler = handler
as seen above, the lambda is just an aws hosted function which weve named handler, the main difference being that it can be communicated with by other remote services.
We will be compressing the js files in this repo to an Archive.zip and uploading the zip to AWS lambda so we can edit our lambdas locally.
- log into ambda
- create a new function named
helloWorld
- configure your lambda runtime for node 6x
- make sure you select
alexa skill
as the trigger for your lambda - upload your code (from this repo,
npm run zip
, select the Archive.zip, and upload through the lambda website)
- make sure the handler field reads
index.handler
- click next or save
- copy the ARN of your lambda for later use
make sure you are logging in to the same account configured with your device
- log into alexa dev portal
- click alexa skills kit 3 click 'add a new skill'
- give your app a name and invocation, use
Hello World
for both - continue to 'Interaction Model' section
- copy and paste the intent schema to the intent schema section from below.
- copy and paste the utterances to the utterances section from below.
- continue to configuration
- click 'AWS Lambda ARN (Amazon Resource Name)'
- select a region (eg North America) and paste the ARN from steps outlined above
- click save
your skill should now be able to talk to lambda
- you can edit your code and upload to lambda with
npm run lambda
(note, this requires aws commandline tools) OR by manually uploading the recompressed zip archive (npm run zip
)- see package.json scripts for more information
- log errors by configuring cloudwatch for your lambda
{
"intents": [
{
"intent": "Hello"
},
{
"intent": "Goodbye"
}
]
}
utterances are what the user speaks
Hello that I said hi
Goodbye that I said bye
alexa, launch hello world
"launching your custom skill"
alexa, tell hello world that i said hi
alexa says "hello world"
alexa, tell hello world that i said bye
alexa says "goodbye world"