Make your product talk with Amazon Alexa

Agenda

  1. Use cases
  2. Implementation and distribution
  3. Demo
  4. Q&A

Use cases

  1. Smart home
  2. Healthcare
  3. E-commerce
  4. Use your imagination 😉

Implementation

  1. Skill interaction model on AWS Developer Portal
  2. Code for handling intent requests
  • Any programming language, but AWS provides a lot of Node.js examples
  • AWS Lambda is recommended for hosting and running the code, but you can also create a custom web service if this fits your use case better.

Create a Lambda function

lambda-function-creation

Link Alexa Skills Kit with your Lambda Function

lambda-alexa-kit-link

Provide the link to Lambda function to ASK

ask-lambda-arn-specify

The code

module.exports = {
    canHandle(handlerInput) {
        const { request } = handlerInput.requestEnvelope;
        return request.type === 'IntentRequest'
            && request.intent.name === '<INTENT_NAME>';
    },
    handle(handlerInput) {
        // do any required operations like API calls
        // or just respond
        return handlerInput.responseBuilder
            .speak('Alexa will speak this out')
            // Will keep the session, useful for dialogs
            .reprompt('Alexa will wait for your further input if you add this')
            .getResponse();
    }
}

Testing

testing the interaction

Debugging on Lambda

console.log and check Cloudwatch

cloudwatch

Name-free interaction

Distribution

A small demo

Demo time!