Note: If this is your first time logging in to an Amazon Developer Account, you might need to enter a few more details
Note: This page will list all Alexa Skills that you have already created.
- Skill type is used to target devices with different capabilities, keep on
Custom Interaction Model
. - The name is what is displayed to the customers of your skill. In this case, name it
Greeter
. - The invocation are the words that you use to activate this skill. In this case, we'll use the name of the Skill,
greeter
. - These are settings that allow for more complex Alexa Skills, leave them as
No
. Click Save
on the bottom left of the screen.
Note: If there where problems with the form in the previous step, this button will not show.
Note: This is where you will add Intents to your skill. Intents are how you communicate with the Skill, for example 'What is the weather like today' can be made into an intent.
Note: This will let us add a brand new Intent. Notice the three intents (Cancel, Help, and Stop) that Amazon has provided as defaults.
https://aws.amazon.com/console/
Once you clicked on Lambda
your screen should look as follows. Next, click on the button Create a function
on the right side of the scree.
This creates a filter that leaves the option that we are looking for. Click on the alexa-skill-kit-sdk-factskill
card
Once you selectd the alexa-skill-kit-sdk-factskill
, your screen should look as follows. Here is where we finish creating the Lambda function
Make sure that you are creating a lambda in N. Virginia
. The Alexa Skills is not available in any other areas.
In this new screen, you don't have to change anything, just click on the Allow
button in the bottom right.
Note: this migth look different for you, but the words lambda_basic_execution
should be there.
Scroll down to the window that contains the code for your function, select it all and delete it. After you are done, your screen should look as follows.
/* eslint-disable func-names */
/* eslint quote-props: ["error", "consistent"]*/
'use strict';
const Alexa = require('alexa-sdk');
const APP_ID = undefined; // TODO replace with your app ID (OPTIONAL).
const languageStrings = {
'en': {
translation: {
SKILL_NAME: 'Greeter',
HELP_MESSAGE: 'You can say exit to quit skill',
HELP_REPROMPT: 'What can I help you with?',
STOP_MESSAGE: 'Goodbye!',
},
},
};
const handlers = {
'LaunchRequest': function () {
this.emit('SayHello');
},
'SayHello': function () {
this.emit(':tell', 'Hello');
},
'AMAZON.HelpIntent': function () {
const speechOutput = this.t('HELP_MESSAGE');
const reprompt = this.t('HELP_MESSAGE');
this.emit(':ask', speechOutput, reprompt);
},
'AMAZON.CancelIntent': function () {
this.emit(':tell', this.t('STOP_MESSAGE'));
},
'AMAZON.StopIntent': function () {
this.emit(':tell', this.t('STOP_MESSAGE'));
},
};
exports.handler = function (event, context) {
const alexa = Alexa.handler(event, context);
alexa.APP_ID = APP_ID;
// To enable string internationalization (i18n) features, set a resources object.
alexa.resources = languageStrings;
alexa.registerHandlers(handlers);
alexa.execute();
};
Note: The blue arrow points to the code that we are going to be working on. SayHello
here matches the name of the intent created earlier