Testing a Custom Alexa Skill On Your Device

Denis Wells
6 min readJun 8, 2016

--

I know I’m skipping a few steps here. Like, actually writing a custom Alexa Skill with Node. But I’m writing this out for someone and figured this would be a great platform for it. You can clone down the example I’m working with here.

The best source for learning how to test your custom skill is the Amazon Documentation. It’s how I learned and there’s nothing wrong with it unless you aren’t used to reading documentation. So this will be accessible for anybody to understand, plus pictures!

I’m gonna test out my Mad Libs app that I’ve been working on. To start I open the project directory, select all the components, and zip them up.

Click that compress option.

Now that you have that .zip file, head over to Amazon Web Services and login using the Amazon account that your device is registered to. You may have to go through some set up if it’s your first time here. Just a quick phone call. Maybe even have to enter your credit card, but you won’t get charged for what we’re doing today! Select Basic and free tiers for anything they ask you for.

Once you’re logged in, first thing you want to do is make sure your region is US East (N. Virginia). In the top right corner, near your name, if you don’t see N.Virginia, go ahead and change that now.

Woah, we lost some quality on that one.

After that were going to create our Lambda function using our .zip file. Locate “Lambda” should be near the top left corner if you have the newer AWS dashboard.

Click “Get Started” if you get the Lambda splash page. Now we get into the meat of it!

Step one: Select a Blueprint. This one is easy. Scroll all the way down and click “Skip”. Bam, Step one done.

Step two: Configure function. Start by naming your function and select your runtime. I write my function using Node, so that’s what I’ll choose. Feel free to give it a description if you want.

The next section is Lambda function code. Select “Upload a .ZIP file” and click the “Upload” button that appears.

Locate and select your .zip file that you created at the beginning. Last thing we need to do in this step is in the next section called “Lambda function handler and role”. Click the dropdown marked “Role*” and select “Basic Execution role”. Another tab will open prompting you to allow an IAM role to access Lambda.

The IAM tab is another easy one. Click “Allow” in the bottom right corner.

Now you should be back on the Lambda configure function page. We’re done here, so go ahead and click “Next” at the bottom of the page.

Step three: Review Function. Nothing needs to happen here. Soak in the options you selected and click the “Create Function” button.

Now that you Lambda function is created, there’s one more setting to tweak. Click the “Event sources” tab in your console. Then click the “Add event source” link.

The “Add event source” modal will open. Here you can select “Alexa Skills Kit”, then “Submit”.

Now were done setting up the function. Next, we have to set up the actual skill for Alexa to know about it. Keep this page open, because we’re going to need the Amazon Resource Number of this function soon.

Head over to the Amazon Developer Console and login using the same account. It may require some setup, but all they want to know is if you’re gonna be making money off of anything you’re using. Tell them no and once you’re in the site, click the Alexa tab in the nav bar at top of the page. You’ll be asked if you want to create an Alexa Skills Kit or an Alexa Voice Service. Go ahead and click “Get Started” in the Alexa Skills Kit card.

Now you’re in the your skills dashboard. Click “Add a New Skill” near the top and we’ll start the final stretch!

Step one: Skill Information. Here, you’re gonna name your skill and give it an invocation name for Alexa to listen for.

Step two: Interaction Model. This part can be tricky if you don’t have a lot of experience with building Alexa skills. The intent schema should be built based on the intents Alexa is listening for. If you’re using the Alexa-App-Server as a local test environment, it does a lot of the intent and utterance building for you.

If you can use a Custom Slot type rather than Amazon.Literal I recommend you do so. Here I have a simple Custom Slot type (I’m still testing…) as well as Amazon.Literal. Using Amazon.Literal requires many example utterances to get it working right and even then it can still be buggy. Once your Interaction Model is accepted, click “Next” to continue.

Step three: Configuration. Remember when I told you to keep the AWS console open on your Lambda function? I hope you did. Go back there so we can get our ARN located in the upper right corner.

Copy that bad boy

Let’s head back to the Alexa Skill Configuration now. Make sure you have “Lambda ARN (Amazon Resource Name)” selected in the endpoint section. Paste in your function’s ARN here. Click “Next” and we can start testing our Alexa app.

Step four: Test. This page provides you an input for typing in intents and seeing the request and response objects created. Which is nice, but we want to talk to Alexa. As long as the toggle at the top of the page is enabled, you’re ready. State your Invocation name and try it out!

If you have any problems, again, check out Amazon’s documentation. It is much more thorough and really has nothing wrong with it. Feel free to shoot me any questions:

Twitter — @deniswells59

--

--