Coder Social home page Coder Social logo

alexa-lambda-starter-kit's Introduction

alexa lambda starter kit

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

what are lambdas

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.

tutorial

setup lambda

  1. log into ambda
  2. create a new function named helloWorld
  3. configure your lambda runtime for node 6x
  4. make sure you select alexa skill as the trigger for your lambda
  5. 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
  1. click next or save
  2. copy the ARN of your lambda for later use

setup alexa dev portal

make sure you are logging in to the same account configured with your device

  1. log into alexa dev portal
  2. click alexa skills kit 3 click 'add a new skill'
  3. give your app a name and invocation, use Hello World for both
  4. continue to 'Interaction Model' section
  5. copy and paste the intent schema to the intent schema section from below.
  6. copy and paste the utterances to the utterances section from below.
  7. continue to configuration
  8. click 'AWS Lambda ARN (Amazon Resource Name)'
  9. select a region (eg North America) and paste the ARN from steps outlined above
  10. click save

your skill should now be able to talk to lambda

setup your code

  • 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

example intent schemas

{
  "intents": [
    {
      "intent": "Hello"
    },
    {
      "intent": "Goodbye"
    }
  ]
}

example utterances

utterances are what the user speaks

Hello that I said hi
Goodbye that I said bye

finally, try it out

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"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.