Your Alexa Consoles
?
Support

Alexa Skills Node.js Tutorial

Build a voice experience in 5 minutes or less

Start building for voice with Alexa

Learn to build for voice with Alexa, Amazon’s voice service and the brain behind millions of devices including Amazon Echo. Alexa provides capabilities, or skills, that enable customers to create a more personalized experience.

Start building for Alexa with this quick walkthrough of the skill-building process. You’ll end with a simple but complete Alexa skill that can run on Amazon Echo or any device with Alexa. This tutorial uses the Alexa Skills Kit, AWS Lambda, and Node.js.

How fast can you build? Let us know by tweeting @alexadevs.

Sign in to Amazon Web Services (AWS) and create a function

1.

Log in to the AWS Management Console. If you haven’t done so already, you’ll need to create a free account.

2.

From the list of services, select Lambda.

3.

In the upper-right corner of the console, select the region drop-down. Then, select US East (N. Virginia), which is a supported region for Lambda functions used with the Alexa Skills Kit.

4.

Select Create a Lambda Function. Or select Get Started Now if this is the first Lambda function on your account.

5.

In the search filter box, type alexa.

6.

Select blueprint alexa-skills-kit-color-expert.

7.

Make sure the trigger is set to Alexa Skills Kit, then select Next.

8.

Name your function. We’ll use myColorSkillNodejs for this walkthrough.

9.

Ensure pop-ups are enabled in your browser. Scroll down the page. Then, under Lambda function handler and role, choose Create a custom role.

10.

When the IAM role management console opens, select Allow to go back to the previous Lambda console.

11.

The role is now populated with lambda_ basic_execution. Choose Next, then choose Create function.

12.

Copy the Amazon Resource Name (ARN) displayed in the upper-right corner of the console that starts with arn:aws:lambda....

Use the Amazon developer portal to configure your skill

1.

Sign in to the Amazon developer portal. If you haven’t done so already, you’ll need to create a free account.

2.

From the top navigation bar, select Alexa.

3.

Under Alexa Skills Kit, choose Get Started.

4.

Choose Add a New Skill.

5.

Name your skill. This is the name displayed to users in the Alexa app. For this example, we’ll call it Color Picker.

6.

Create an invocation name. This is the word or phrase that users will speak to activate the skill. For this walkthrough, we’ll use the skill name Color Picker (case-sensitive). Users will say, "Alexa, open Color Picker" to interact with your skill. Choose Next to continue to development for Color Picker.

7.

Choose Next to continue to development for Color Picker.

8.

In the Intent Schema box, paste the following JSON code.

{
  "intents": [
    {
      "intent": "MyColorIsIntent",
      "slots": [
        {
          "name": "Color",
          "type": "LIST_OF_COLORS"
        }
      ]
    },
    {
      "intent": "WhatsMyColorIntent"
    },
    {
      "intent": "AMAZON.HelpIntent"
    }
  ]
}
9.

Under Custom Slot Types, choose Add Slot Type.

10.

Enter type LIST_OF_COLORS, and enter the following values.

green
red
blue
orange
gold
silver
yellow
black
white
11.

Enter additional values if you'd like, then choose Save.

12.

Under Sample Utterances, enter all the phrases that you think users might say to interact with your skill. The more phrases you enter, the better the results. For our example, paste the following:

WhatsMyColorIntent what's my favorite color
WhatsMyColorIntent what is my favorite color
WhatsMyColorIntent what's my color
WhatsMyColorIntent what is my color
WhatsMyColorIntent my color
WhatsMyColorIntent my favorite color
WhatsMyColorIntent get my color
WhatsMyColorIntent get my favorite color
WhatsMyColorIntent give me my favorite color
WhatsMyColorIntent give me my color
WhatsMyColorIntent what my color is
WhatsMyColorIntent what my favorite color is
WhatsMyColorIntent yes
WhatsMyColorIntent yup
WhatsMyColorIntent sure
WhatsMyColorIntent yes please
MyColorIsIntent my favorite color is {Color}
13.

Choose Next and wait until the interaction model finishes loading in just a few seconds.

14.

Select the endpoint AWS Lambda ARN. Select the appropriate geographical region. Paste the ARN code in the box that appears. Ensure No is selected for Account Linking, and choose Next.

Test your skill one of three ways

Test your skill on your Amazon Echo, Echo Dot, or any Alexa device by saying, "Alexa, open Color Picker."

Use the Service Simulator from the Test step of Color Picker development. Try entering Open Color Picker or My favorite color is red to see how Alexa responds.

Try the Echo Simulator Community Edition at Echosim.io. Simply click and hold the microphone icon and speak your commands.

Success!

Congratulations! You've created your very first Alexa skill. Now build a skill that's all your own.

With the Alexa Skills Kit (ASK), designers, developers, and brands can build engaging skills and reach millions of customers. ASK is a collection of self-service APIs, tools, documentation, and code samples that makes it fast and easy for you to add skills to Alexa. With ASK, you can leverage Amazon’s knowledge and pioneering work in the field of voice design.

Start building your next skill today.