Basic shopping list code
- Go to https://developer.amazon.com and login (or sign-up if you haven’t done so yet)
- Create new Alexa Skill, give it a name and choose “Custom” type with “Provision your own” backend
- Choose “Start from scratch”
- Under “Invocation” give your skills an invocation name, such as “shopping mate”
- Add new Intent, call it “AddIntent” and click “Create custom intent”
- Add a sample utterance “Add {item} to my shopping list”
- Add more utterances as you feel necessary
- Choose type “AMAZON.food” under slot type to get a better voice recognition model
- Add another intent, “ListIntent”, for listing items on your shopping list
- Click “Save Model”, and then “Build Model”
- Click “Evaluate Model” and test your intents by typing different messages
- Under endpoints choose “AWS Lambda Arn” and note your skill ID. You will need it when creating backend
- Login into your AWS account and make sure you’re in the Ireland region
- Go to Lambda service (Services->Lambda)
- Click “Create function”
- Choose serverless app repository and find “alexa-skills-kit-nodejs-factskill”
- Give your application a name and click “Deploy”
- Wait until deployment succeeds
- Click on “alexaskillskitnodejsfactskill” resource (It’s your Lambda function)
- Click on “Alexa Skills Kit” trigger and delete it.
- Click on “Add new trigger”, choose “Alexa Skills Kit” and use the skill ID that you got from Skill Builder
- Click back on your lambda function, and click on “view role” under “Execution role” section
- Under “Permissions” click “Attach Policies” and search for “AmazonDynamoDBFullAccess”
- Select AmazonDynamoDBFullAccess policy and click “Attach Policy”
- Go back to your lambda function and add code for the shopping mate skill. Check index.js if you need reference.
Don’t forget to update your skill endpoint to point to your new lambda ARN Test your new Alexa Skill by going under “Test” section of Alexa Developer Console. You can use either voice or text for testing If something doesn’t work, you can debug your backend by going to “Monitoring” section of Lambda console and clicking “View Logs in CloudWatch”