Giter Club home page Giter Club logo

apex-alexa-sample's Introduction

Mobiquity Standard Sample Alexa+Lambda Project

This contains sample code for the setup of a Mobiquity-style Alexa project backed by lambda and deployed by apex.

Installation

Run yarn install (or npm install) to install development dependencies.

For sample function

We are using a version of the VoiceLabs SDK that has not been published so you must download it here: https://s3-us-west-1.amazonaws.com/voicelabs/static/voicelabs-sdk.zip

Unzip it and move it to functions/sample.

Functions that you create that depend on this VoiceLabs SDK will also require this folder in their function directory.

Deployment

Update project.json to add an appropriate IAM role for your lambda function. You should only need to do this once, but if you are using multiple different roles for different functions or environments, a different setup may be required.

Also add a name attribute for your project. The resulting project.json should look like this:

{
  "name": "<YOUR_NAME>_sample",
  "description": "<YOUR_DESCRIPTION>",
  "memory": 128,
  "timeout": 5,
  "handler": "lib.default",
  "role": "arn.aws:iam:us-east-1:#:<ROLE_NAME>",
  "hooks": {
    "build": "yarn install --production && ../../node_modules/.bin/webpack --config ../../webpack.config.js --bail",
    "clean": "rm -rf lib node_modules"
  },
  "runtime": "nodejs4.3"
}

Use apex deploy to deploy the lambda function. You can use --set to set environment variables used by the deployment. For example:

apex --profile mobschool --region us-east-1 deploy \
  --set 'APP_ID=1234' \
  --set 'USER_TABLE_NAME=alexa_Users' \
  --set 'VOICELABS_APP_TOKEN=1234'

You can also set the environment variables using env settings or a separate file. See the apex docs for details.

Environment variables for the sample function

  • APP_ID Skill ID for your Alexa app
  • USER_TABLE_NAME DynamoDB table name for your user attriburtes data
  • VOICELABS_APP_TOKEN for tracking events in voicelabs (optional)

Creating an Alexa Skill

TODO -- this section

Manual Testing

Once you have deployed the lambda function, you can test it in the AWS console or command line using a sample Alexa request event.

TODO add instructions for a device or echosim.io.

Automated Testing

TODO all of this

apex-alexa-sample's People

Contributors

ajcrites avatar

Stargazers

 avatar  avatar

Watchers

 avatar

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.