
Fixes #6 This required a few changes to the code base. First of all, we need to update our lambda function to use Node v4.3. This can be done in the Lambda console on AWS, and is also done in the default.env file. Next, since Node 4.3 doesn't offer full ES6 support yet, we need to run our source code through babel to transform it to be ES5-friendly. The ES6 source now lives in the src/ directory, and the transformed js is output into a dist/ directory. The dist/ package is what ends up getting uploaded to lambda. One last issue is that node-lambda doesn't work with ES6 either, so we need to make sure it runs against the files in the dist/ directory instead. You can use the test-lambda npm script to do this automatically for you by executing npm run test-lambda in the terminal. This will trigger running babel to transform the js and then running node-lambda against the newly transformed files in dist/.
Couch Potato Alexa Skill
This is a skill built for Amazon's Alexa service that tells you about your Couch Potato queue. It allows you to ask Alexa the following:
Alexa, ask Couch Potato to add The Godfather
Alexa, ask Couch Potato if The Dark Knight is on the list
If you're just getting started developing skills for Alexa, I'd recommend reading Getting Started with the Alexa Skills Kit and Developing an Alexa Skill as a Lambda Function to get familiar with the process.
Configuring The Skill
To configure the skill, copy default.env
to .env
and fill in the correct values for CP_URL
, which
should point to your Couch Potato server, and CP_API_KEY
which should have your server's API key.
Testing The Skill Locally
You can use node-lambda to test this skill locally. In
the test_events
directory are several event files you can use for testing, and they should map
pretty well to each Intent. To test an intent, simply copy the contents of one of the json files in
that directory and overwrite the contents of event.json
. Make sure you run npm install
from the
command line to get the the latest npm packages, and then run npm run test-lambda
.
Setting up the Skill
To set up the skill, head on over to Alexa skills kit
development console and add a new skill. Fill in the
basic skill information however you choose. For Endpoint, you'll need to fill in your Lambda ARN
which you'll get in the next step. Next, head on over to Interaction Model. In the Intent
Schema field, copy and paste the contents of the interaction_model/intent_schema.json
file. Then
in the Sample Utterances field, copy and paste the contents of
interaction_model/sample_utterances.txt
.
Hosting the Skill
The skill is built to be easily hosted on Amazon's AWS Lambda service. Create your Lambda function (using the alexa-skills-kit-color-expert blueprint) and make sure you choose Node.js as the runtime. After you've created your Lambda function, look at the top right of the page to get your Lambda ARN number and put that in the Alexa Skill Information Endpoint field.
To deploy to Lambda, first makes sure you do an npm install
at the root of the project.
Once all the dependencies are installed, run npm run bundle
, which will create a lambda.zip file.
You can then upload that zip file to Lambda for use in your function and skill.
You can also use node-lambda to deploy to your Lambda
function directly from the command line. Simply add a deploy.env file with your environment
configuration (and double check the supplied .env file in this repository) and then run
node-lambda deploy
. Please visit the node-lambda
project page for more information on deploying from the command line.