diff --git a/README.md b/README.md index 9e8a338f..c420391f 100644 --- a/README.md +++ b/README.md @@ -1,372 +1,53 @@ -# How to Build a Fact-Based Alexa Skill +# Build An Alexa Fact Skill + -We want to introduce another way to help you build useful and meaningful skills for Alexa quickly. We have launched a fact skill template that makes it easy for developers or non-developers to create a skill similar to “Fact of the Day”, “Joke of the Day”, “Daily Reading” etc. The template leverages [AWS Lambda](https://aws.amazon.com/lambda/) the [Alexa Skills Kit (ASK)](https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit) and the [ASK SDK](https://developer.amazon.com/public/community/post/Tx213D2XQIYH864/Announcing-the-Alexa-Skills-Kit-for-Node-js) while providing the business logic, multiple language support, use cases, error handling and help functions for your skill. You just need to come up with a fact idea (like “Food Facts”), plug in your fact list and edit the sample provided (we walk you through how it’s done). It's a valuable way to quickly learn the end-to-end process for building and publishing an Alexa skill. +[![Voice User Interface](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/navigation/1-off._TTH_.png)](https://github.com/alexa/skill-sample-nodejs-fact/blob/master/step-by-step/1-voice-user-interface.md)[![Lambda Function](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/navigation/2-off._TTH_.png)](https://github.com/alexa/skill-sample-nodejs-fact/blob/master/step-by-step/2-lambda-function.md)[![Connect VUI to Code](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/navigation/3-off._TTH_.png)](https://github.com/alexa/skill-sample-nodejs-fact/blob/master/step-by-step/3-connect-vui-to-code.md)[![Testing](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/navigation/4-off._TTH_.png)](https://github.com/alexa/skill-sample-nodejs-fact/blob/master/step-by-step/4-testing.md)[![Customization](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/navigation/5-off._TTH_.png)](https://github.com/alexa/skill-sample-nodejs-fact/blob/master/step-by-step/5-customization.md)[![Publication](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/navigation/6-off._TTH_.png)](https://github.com/alexa/skill-sample-nodejs-fact/blob/master/step-by-step/6-publication.md) -This tutorial will walk first-time Alexa skills developers through all the required steps involved in creating a skill using this fact skill template, called ‘SpaceGeek’. This post assumes you have some familiarity with JavaScript/Node.js (or a similar programming language) and the Alexa Skills Kit. +## What You Will Learn +* AWS Lambda +* Alexa Skills Kit (ASK) +* Skill Builder +* Voice User Interface (VUI) Design +* Skill Certification -Using the Alexa Skills Kit, you can build an application that can receive and respond to voice requests made on the Alexa platform. In this tutorial, you’ll build a web service to handle notifications from Alexa and map this service to a skill in the Amazon Developer Portal, making it available on your device and to all Alexa users after certification. +## What You Will Need +* [Amazon Developer Portal Account](http://developer.amazon.com) +* [Amazon Web Services Account](http://aws.amazon.com/) +* The sample code on [GitHub](https://github.com/alexa/skill-sample-nodejs-fact). +* Simple graphical editing tool +* At least 25 facts about your favorite topic. - After completing this tutorial, you'll know how to do the following: +## What Your Skill Will Do +A fact skill for Alexa is a "Hello, World" example. You provide a list of interesting facts about a topic, and Alexa will read one of those facts to your user when they start your skill. The purpose of building this skill is to teach you how the different pieces of the Alexa development process fit together, while still producing an interesting, useful skill that others can enjoy. - * Create a fact-based skill - This tutorial will walk first-time Alexa skills developers through all the required steps involved in creating a fact-based skill using a template called ‘SpaceGeek’. - * Understand the basics of VUI design - Creating this skill will help you understand the basics of creating a working Voice User Interface (VUI) while using a cut/paste approach to development. You will learn by doing, and end up with a published Alexa skill. This tutorial includes instructions on how to customize the skill and submit it for certification. For guidance on designing a voice experience with Alexa you can also [watch this video](https://goto.webcasts.com/starthere.jsp?ei=1087592). - * Use JavaScript/Node.js and the Alexa Skills Kit to create a skill - You will use the template as a guide but the customization is up to you. For more background information on using the Alexa Skills Kit please [watch this video](https://goto.webcasts.com/starthere.jsp?ei=1087595). - * Get your skill published - Once you have completed your skill, this tutorial will guide you through testing your skill and sending your skill through the certification process, making it available to be enabled by any Alexa user. +This Alexa skill template helps you create your first fact skill. Your users will be able to say things like: -# Let's Get Started +* "Alexa, ask Superhero Facts for a new fact." +* "Alexa, start Baseball Facts." +* "Alexa, ask Titanic Facts to give me another fact." -## Step 1. Setting up Your Alexa Skill in the Developer Portal +Alexa will respond to all of these requests with responses like these: -Skills are managed through the Amazon Developer Portal. You’ll link the Lambda function you create to a skill defined in the [Developer Portal](https://developer.amazon.com/) +* "Here's your superhero fact: Iron Man's armor used to include roller skates." +* "Here's your baseball fact: Ralph Kiner is the only player ever to lead the league in homers for seven years in a row — his first seven years as a major league player." +* "Here's your Titanic fact: The ship burned around 600 tons of coal a day – hand shovelled into its furnaces by a team of 176 men. Almost 100 tons of ash were ejected into the sea each day." - 1. Navigate to the Amazon Developer Portal. Sign in or create a free account (upper right). You might see a different image if you have registered already or our page may have changed. If you see a similar menu and the ability to create an account or sign in, you are in the right place. +If you would like to see an example of this skill in action, you can enable the [Gloucester Facts](https://www.amazon.com/Robert-McCauley-Gloucester-Facts/dp/B01I5MOIA2/) from the [Alexa Skill Store](http://amazon.com/skills). - ![](https://s3.amazonaws.com/lantern-code-samples-images/fact/devsignin.png) + - 2. Once signed in, navigate to Alexa and select **"Getting Started"** under Alexa Skills Kit. + - ![](https://s3.amazonaws.com/lantern-code-samples-images/fact/Getstartedask.png) - 3. Here is where you will define and manage your skill. Select **"Add a New Skill"** - ![](https://s3.amazonaws.com/lantern-code-samples-images/fact/AddnewSkill.png) - 4. Select an initial language you want to support, and then optionally add additional languages later if needed (in Step 6). Make sure the radio button for the custom interaction model is selected for “Skill Type”. Add the name of the skill. You can use “My Fact Skill” for this example. Remember, when you create a skill that you will publish, you will use a name that you define for your skill. That name will be the one that shows up in the Alexa App. Add the invocation name. Since we are using the sample, type “space geek”. Since we will not use Audio Player for this skill, select "No". **Note**: "Global Fields" information apply to all languages supported by the skill. Finally, select **Next**. - ![](https://s3.amazonaws.com/lantern-code-samples-images/fact/skill_information.PNG) - 5. Now, notice you're in the Interaction Model section. - ![](https://s3.amazonaws.com/lantern-code-samples-images/fact/interactionmodel.png) - 6. Next, we need to define our skill’s Interaction Model. Let’s begin with the intent schema. In the context of Alexa, an intent represents an action that fulfills a user’s spoken request. Intents can optionally have arguments called slots. We will not be using custom slots in this template, but they are very useful if you want to parameterize your intents. Note: You will need to define both custom slot type values and sample utterances in language that matches current language tab. -* Review the intent schema below. This is written in JSON and provides the information needed to map the intents we want to handle programmatically. Copy this from the intent schema in the [GitHub repository here](https://github.com/alexa/skill-sample-nodejs-fact/blob/master/speechAssets/IntentSchema.json). -* You will see the intents for getting a new fact, and then a collection of built-in intents to simplify handling common user tasks. Help intent will handle any time the user asks for help, stop and cancel are built-in intents to make it easier for you to handle when a user wants to exit the application. For more on the use of built-in intents, go [here](https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/implementing-the-built-in-intents). -```JSON -{ - "intents": [ - { - "intent": "GetNewFactIntent" - }, - { - "intent": "AMAZON.HelpIntent" - }, - { - "intent": "AMAZON.StopIntent" - }, - { - "intent": "AMAZON.CancelIntent" - } - ] -} -``` - 7. The next step is to build the utterance list. - Given the flexibility and variation of spoken language in the real world, there will often be many different ways to express the same request. Providing these different phrases in your sample utterances will help improve voice recognition for the abilities you add to Alexa. It is important to include as wide a range of representative samples as you can -– all the phrases that you can think of that are possible in use (though do not include samples that users will never speak). Alexa also attempts to generalize based on the samples you provide to interpret spoken phrases that differ in minor ways from the samples specified. - Now it's time to add the utterances. Select and copy/paste the sample utterances from [GitHub](https://github.com/alexa/skill-sample-nodejs-fact/blob/master/speechAssets) with your initial language. For example, if your select English (US) as initial language above, then you will need to copy/paste SampleUtterances_en_US.txt in previous link. An example of utterances is listed below. Once they are copied, the screen should look similar to the following image: - - ``` - GetNewFactIntent a fact - GetNewFactIntent a space fact - GetNewFactIntent tell me a fact - GetNewFactIntent tell me a space fact - GetNewFactIntent give me a fact - GetNewFactIntent give me a space fact - GetNewFactIntent tell me trivia - GetNewFactIntent tell me a space trivia - GetNewFactIntent give me trivia - GetNewFactIntent give me a space trivia - GetNewFactIntent give me some information - GetNewFactIntent give me some space information - GetNewFactIntent tell me something - GetNewFactIntent give me something - ``` - - 8. Select **Save**. You should see the interaction model being built (this might a take a minute or two). If you select next, your changes will be saved and you will go directly to the Configuration screen. After selecting Save, it should now look like this: - - ![](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/fact/interaction_model._TTH_.png) - -Next we will configure the AWS Lambda function that will host the logic for our skill. - -## Step 2: Creating Your Skill Logic Using AWS Lambda - -### Installing and Working with the Alexa Skills Kit SDK for Node.js (alexa-sdk) - -To make the development of skills easier, we have created the ASK SDK for Node.js. We will be using this module to deploy the sample. The Alexa SDK is available on [GitHub](https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs) and can be deployed as a Node package from within your Node.js environment. - -### Create an AWS Account - - ![](https://s3.amazonaws.com/lantern-code-samples-images/fact/aws_home.png) - - 1. Open [aws.amazon.com](https://aws.amazon.com/) and then choose **‘Create a Free Account’** - -* Follow the online instructions. Do not worry about the IAM role, we will do that later. -* You will need a Valid Credit Card to set up your account (note the AWS Free Tier will suffice however. You can find out more about the free tier [here](https://aws.amazon.com/free/).) -* Part of the sign-up procedure involves receiving a phone call and entering a PIN using the phone keypad. - - 2. Sign in to the AWS Console - - ![](https://s3.amazonaws.com/lantern-code-samples-images/fact/aws_login.png) - - 3. It can sometimes take a couple of minutes for your new AWS account to go live. You will receive an e-mail when your account is active. - -### Create an AWS Lambda Function - -AWS Lambda lets you run code without provisioning or managing servers. You pay only for the compute time you consume - there is no charge when your code is not running. With Lambda, you can run code for virtually any type of application or backend service - all with zero administration. Just upload your code and Lambda takes care of everything required to run and scale your code with high availability. - -**Note: If you are new to Lambda and would like more information, visit the [Lambda Getting Started Guide](https://docs.aws.amazon.com/lambda/latest/dg/getting-started.html)** - - 1. **IMPORTANT**: For Regions (upper right) , Select **US East (N. Virginia)** for US skills and **EU (Ireland)** for UK/DE skills. These are the only two regions currently supported for Alexa skill development on AWS Lambda, and choosing the right region will guarantee lower latency. - - ![](https://s3.amazonaws.com/lantern-code-samples-images/fact/aws_region.png) - - 2. Select **Lambda** from Compute services (upper left) - - ![](https://s3.amazonaws.com/lantern-code-samples-images/fact/aws_lambda.png) - - 3. Select **“Create a Lambda Function”** to begin the process of defining your Lambda function. - - ![](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/fact/create_a_lambda_function._TTH_.png) - - 4. In the **‘Select Blueprint’** page, filter on **'Alexa'**, select **“alexa-skill-kit-sdk-factskill”**. This blueprint is a shortcut to getting the Fact Skill set up for you, and will install the sample code (and dependencies) that are needed for this project. - - ![](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/fact/select_blueprint._TTH_.png) - - 5. Now, you need to configure the event that will trigger your function to be called. As we are building skills with the Alexa Skills Kit, click on the gray dash-lined box and select Alexa Skills Kit from the dropdown menu. - - ![](https://s3.amazonaws.com/lantern-code-samples-images/fact/aws_lambda_ask.png) - - 6. Choose **Next** to continue. - - ![](https://s3.amazonaws.com/lantern-code-samples-images/fact/aws_next.png) - - 7. You should now be in the **"Configure Function"** section. Enter the Name, Description, and select "Node 4.3" as the Runtime for your skill as in the example. - - ![](https://s3.amazonaws.com/lantern-code-samples-images/fact/aws_config_function.png) - - 8. Set your handler and role as follows: - - * Keep Handler as ‘index.handler’ - * Drop down the “Role” menu and select **“Create a new custom role”**. (Note: if you have already used Lambda you may already have a ‘lambda_basic_execution’ role created that you can use.) This will launch a new tab in the IAM Management Console. - - ![](https://s3.amazonaws.com/lantern-code-samples-images/fact/aws_role.png) - - 9. You will be asked to set up your Identity and Access Management or “IAM” role if you have not done so. AWS Identity and Access Management (IAM) enables you to securely control access to AWS services and resources for your users. Using IAM, you can create and manage AWS users and groups, and use permissions to allow and deny their access to AWS resources. We need to create a role that allows our skill to invoke this Lambda function. In the Role Summary section, select "Create a new IAM Role" from the IAM Role dropdown menu. The Role Name and policy document will automatically populate. - - ![](https://s3.amazonaws.com/lantern-code-samples-images/fact/iam_role.png) - - 10. Select **“Allow”** in the lower right corner and you will be returned to your Lambda function. - - ![](https://s3.amazonaws.com/lantern-code-samples-images/fact/allowrole.png) - - 11. Keep the Advanced settings as default. Select **‘Next’** and review. You should see something like below. Then select **‘Create Function’**: - - ![](https://s3.amazonaws.com/lantern-code-samples-images/fact/CreateFunctionbuitton.png) - - 12. Congratulations, you have created your AWS Lambda function. **Copy** the ARN for use in the Configuration section of the Amazon Developer Portal. - -![](https://s3.amazonaws.com/lantern-code-samples-images/fact/ARN.png) - -## Step 3: Add Your Lambda Function to Your Skill - - 1. Navigate back to [developer.amazon.com](https://developer.amazon.com/) and select your skill from the list. You can select the skill name or the edit button. - - ![](https://s3.amazonaws.com/lantern-code-samples-images/fact/my_fact_skill_edit.png) - - 2. Select the Configuration section. Add the ARN from the Lambda function you created in the AWS Console earlier. Select the **Lambda ARN (Amazon Resource Name)** radio button and tick the corresponding region. Then, select **“No”** for account linking since we will not be connecting to an external account for this tutorial. Paste the ARN you copied earlier into the Endpoint field. Then select **Next**. **Note:** the region(s) here should match the region(s) of your Lambda function(s). - - ![](https://s3.amazonaws.com/lantern-code-samples-images/fact/configuration.png) - - 3. You have now completed the initial development of your skill. Now it's time to test. - -## Step 4: Testing Your Skill - - 1. In the Test area, we are going to enter a sample utterance in the Service Simulator section and see how Alexa will respond. In this example, we have called the skill ‘Space Geek’. This is the ‘Invocation Name’ we set up in the “Skill Information” section. - - * In the Service Simulator, type **‘open Space Geek’** and select **“Ask My Fact Skill”**. - - ![](https://s3.amazonaws.com/lantern-code-samples-images/fact/openspacegeek.png) - - 2. You should see the formatted JSON request from the Alexa Service and the response coming back. Verify that you get a correct Lambda response, and notice the card output. You will want to customize this output later. - - ![](https://s3.amazonaws.com/lantern-code-samples-images/fact/servicesimulator.png) - - 3. (Optional) Testing with your device. This is optional as you can do all the testing in the portal. Assuming your Alexa device is on-line (and logged in with the same account as your developer account), you should now see your skill enabled in the Alexa app and ask Alexa to launch your skill. For more information on testing an Alexa skill and registering an Alexa-enabled device, [check here](https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/testing-an-alexa-skill). - - ![](https://s3.amazonaws.com/lantern-code-samples-images/fact/alexaappskill.png) - -### Not working (getting an invalid response)? -* Do you have the right ARN copied from your Developer Portal/Skill into your your Lambda function? -* Are you calling the right invocation name? -* Are you saying launch, start or open? -* Are you sure you have no other skills in your accounts with the same invocation name? -* For this template specifically, you should have a minimum of 20 facts for a good customer experience. - -## Step 5: Make it Yours - - 1. In the Skill Information section in the Developer Console, edit the Skill Information Tab to reflect your new Fact Skill: - - * Provide a skill name that represents the new skill you are creating. - * Come up with a cool Invocation Name that users will use to invoke your skill. Ensure that the invocation name you choose stays clear of pitfalls listed in the table below. Column on the right provides examples of invocation names that will definitely fail certification. - - ![](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/general/invocation_name_requirements._TTH_.png) - - * Create a fun icon. Be sure you have the rights to whatever icons you are uploading – you will need to provide both 108x108px and 512x512px images. Need help finding an image? See PixelBay as a possible source for royalty-free images. Use an image editor (such as Paint on Windows or Preview on Mac) to change the size of the image. - - Everything else can stay as-is for now in the Developer Portal - - 2. [OPTIONAL] If you want to use your own code editor for these next steps, download the code from your Lambda function. From the **'Actions'** dropdown choose **'Export Function'**. Inside the .zip file you download, you will find the index.js file inside the "src" folder. - - ![](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/fact/export_your_function._TTH_.png) - - 3. On the code tab of your Lambda function in aws.amazon.com (or in your editor), you can edit your code. Look for corresponding locale strings in languageStrings object. "Ctrl-F" **en** for English and **de** for German. If there are different expressions between U.S. and U.K, we encourage you to specify them using **en-US** and **en-GB**. You can learn more about how language resources are looked up by visiting [i18next's documentation](http://i18next.com/translate/). These are the strings you will want to edit to customize this fact for your use. - - ![](https://s3.amazonaws.com/lantern-code-samples-images/fact/source_code1.png) - ![](https://s3.amazonaws.com/lantern-code-samples-images/fact/source_code2.png) - - 4. Change the SKILL_NAME variable to the name of your skill. - - ```JSON - "SKILL_NAME": "Space Geek" - ``` - - 5. Edit the strings to contain whatever facts or information you would like to make randomly available when a user invokes your skill. A few suggestions: - * Only change the "FACT" array values between the double quotes. These are your facts. - * Ensure you don’t accidentally delete any quotes or commas. You can always go back to GitHub and copy it again if you make a mistake. - * The skill uses a mathematical randomization on your list of facts. It is a good idea to have at least 20 facts in the skill to ensure that the facts do not repeat too quickly. Also remember that because it is random, it is possible that the same fact can be repeated twice. - * For extra credit and completely optional- If you would like to ensure that the facts don’t repeat (for a “Daily Fact Skill” for example), you can use a datastore like DynamoDB to store an id that you can check when the user accesses the skill and iterate through the facts. For more information on using DynamoDB with Lambda, [go here](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html). - - - 6. You will also want to make sure to change the “Space Geek” references to the name of your skill. You don’t have to edit them all, but the following reference changes are required for certification. - * Find this code in the HELP_MESSAGE, and change "space fact" to your custom words: - - ```JSON - "HELP_MESSAGE" : "You can say tell me a space fact, or, you can say exit... What can I help you with?", - ``` - 7. In order to control who accesses your web service, we should validate the Application Id in requests made to your web service. Let’s go back to your Alexa skill in your Developer Portal for a moment. Copy in your Application Id from the ‘Skill Information’ section in your developer portal - - ![](https://s3.amazonaws.com/lantern-code-samples-images/fact/changeAppId.png) - - - 8. Copy the Application Id into the value of the APP_ID variable in index.js. Make sure to place the app id in quotation marks. - ```JSON - var APP_ID = undefined; // TODO replace with your app ID (OPTIONAL). - ``` - - 9. A minimum of 20 facts is needed to get started, but about 100 is a good number to keep users engaged. The more the better. - - 10. Be sure to select **SAVE** when you are all done. Note: we test initially in the Developer Portal, not in our Lambda function (AWS). - - 11. If you've downloaded your code to use your own editor, log back into your AWS console and copy-and-paste the contents of your index.js file to the Code tab of your Lambda function. - - ![](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/fact/code_tab._TTH_.png) - - 12. Repeat the tests you performed earlier to ensure your changes are functioning properly. See step 4 for a review of how to performs functional tests. - -## Step 6: Add Additional Languages (Optional) -You can use the Alexa Skills Kit to create skills in multiple languages. A skill can support a single language, or any combination of the available languages: -* English (US) -* English (UK) -* German - -For more on developing skills in multiple languages, go [here](https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/developing-skills-in-multiple-languages) - -1. To add an additional language, simply select the Add New Language tab and choose your second language. Choose and fill all necessary information like we did for the initial language of your skill. You will need to define Name and Invocation Name for the current language (e.g. German name for German skills). Then click Save to continue. -![](https://s3.amazonaws.com/lantern-code-samples-images/fact/german_fact_info.png) - -2. In the Interaction Model section, our skill shares the same intent schema and uses different sample utterances and custom slot type values in different languages. Copy intent schema from the intent schema in the [GitHub repository here](https://github.com/alexa/skill-sample-nodejs-fact/blob/master/speechAssets/IntentSchema.json) and change sample utterances into your second language. We will not be using custom slots in this template, but slot type values should be put in the new language if your skill has them. - -![](https://s3.amazonaws.com/lantern-code-samples-images/fact/german_intent.png) - -3. Open the source file for your Lambda function, index.js. In the languageString variable, look up the locale for your current language, edit the facts strings and other message like you did for your initial language. Strings are supposed to be defined using your second language. -![](https://s3.amazonaws.com/lantern-code-samples-images/fact/de_german_strings.png) - -4. For better latency, deploying your code to different endpoints is recommended. Follow the Create Lambda Function instructions in Step 2 and be sure to select an appropriate Lambda region. Select **US East (N. Virginia)** for US skills and **EU (Ireland)** for UK/DE skills. Copy the ARN for use in the Configuration section of the Amazon Developer Portal. - -5. Go back to skill Configuration section, which contains Global fields for all languages. Add an extra endpoint and paste your Lambda ARN. Save your skill configuration information. - -![](https://s3.amazonaws.com/lantern-code-samples-images/fact/german_lambda.png) - -6. Test your skill in the second language using Service Simulator or a device. - - -## Step 7: Publish Your Skill - -Now we need to go back to our Developer Portal to test and edit our skill and we will be ready for certification. - - 1. In your skills Test section, enter your Utterances into the Simulator to make sure everything is working with your new facts. - - 2. Optionally, you can test with your Alexa-enabled device to make sure everything is working correctly. You may find a few words that need to be changed for a better user experience. - - Some things to think about: - - * Is every fact pronounced correctly? - * Do you need to change any words to avoid poor pronunciations? - - Because we are randomizing our facts, this could take a while. Instead, you can use the Voice Simulator in the Test section to simulate Alexa’s responses. In the Voice Simulator, type in each fact that you are using to test how Alexa will say it. Use additional punctuation or possibly SSML if you need to better control how Alexa responds. You can find out more about [SSML here](https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/speech-synthesis-markup-language-ssml-reference). - - * Have you added in YOUR Application Id as per the previous instruction? - - 3. Select the Publishing Information area of your skill next: - - ![](https://s3.amazonaws.com/lantern-code-samples-images/fact/publishing.png) - - For Global fields, choose an proper category. **IMPORTANT**: Add the text “This is based on the Fact Skill Template” to the Testing Instructions section. This alerts the Certification team of your submission using this standardized template, smoothing the road to a faster publish. Also select the countries that you want your skill to be available in. - - ![](https://s3.amazonaws.com/lantern-code-samples-images/fact/publishing_us.png) - - For other publishing information: - - * Spend some time coming up with an enticing, succinct description. This is the only place you have to attract new users. These descriptions show up on the list of [skills available](http://alexa.amazon.com/#skills) in the Alexa app. - * In your example phrases, be sure that the examples you use match the utterances that you created in the Interaction Model section. Remember, there are built-in intents such as help and cancel. You can learn more about [built-in intents here](https://developer.amazon.com/appsandservices/solutions/alexa/alexa-skills-kit/docs/implementing-the-built-in-intents#Available%20Built-in%20Intents). You can also review the list of [supported phrases](https://developer.amazon.com/appsandservices/solutions/alexa/alexa-skills-kit/docs/supported-phrases-to-begin-a-conversation) to begin a conversation. - - An incorrect example phrase is the most likely reason why your skill submission may fail. Here are the four most important failure points for example phrases. - 1. Example phrases do not adhere to supported phrases.
- *Example: Alexa start over (You cannot use wake word without the invocation name. Further, start over can be a response from the user when the stream is open, in which case, wake word and invocation name do not make sense.)
* - *Example: Alexa, Social Headline (A supported format would be Alexa, launch Social Headline)* - 2. Example phrases are not modeled on sample utterances specified in skill’s intent schema - 3. First example phrase does not contain wake word and invocation name
- *Example: Incorrect example phrase - Alexa, where can I eat (Missing invocation name)* - 4. Example phrases do not provide a contextual response. These are the invariably the phrases users are most likely to try the first time they interact with the skill. Therefore, make sure that they work well and provide a good user experience. - - - - 4. Be sure you have the rights to whatever icons you are uploading – you will need to provide both 108x108px and 512x512px images. If there is any question the Amazon certification team will fail your Alexa skill submission. - - ![](https://s3.amazonaws.com/lantern-code-samples-images/fact/publishing_english.png) - - Once you have uploaded your icons, you should see a success message at the bottom of the screen. Finally, **select Next**. - - 5. (Optional) For multiple language skill, once you finish and save publishing information for your initial language, you will need to do it again for your second language. Under your second language tab, select publishing infomation, and add additional publishing region(s) to the global fields and all other customer facing information in non-global fields. - ![](https://s3.amazonaws.com/lantern-code-samples-images/fact/publishing_de.png) - ![](https://s3.amazonaws.com/lantern-code-samples-images/fact/publishing_de_phrases.PNG) - ![](https://s3.amazonaws.com/lantern-code-samples-images/fact/publishing_de_icon.png) - - 6. Privacy and Compliance. On the Privacy and Compliance section, select ‘No’ for spending real money and collecting personal information. Privacy and Terms URL’s are optional. Choose to certify that your skill can be imported to and exported from the US. - - 7. Select **“Save”**. If your skill supports multiple languages, then you will need to complete Privacy and Compliance for each language before submission. - ![](https://s3.amazonaws.com/lantern-code-samples-images/fact/privacy.png) - - 8. Select “Submit for Certification” - ![](https://s3.amazonaws.com/lantern-code-samples-images/fact/privacy_check.png) - - 9. Finally, confirm your submission. Select “Yes” to submit your skill. - - - -Congratulations! You have successfully submitted your skill for publication. You will receive progress e-mails and possibly other suggestions from the team on how you can make your skill even better. You can update your skills at any time. - -## Check out These Other Developer Resources - -* [Alexa Skills Kit (ASK)](https://developer.amazon.com/ask) -* [Alexa Developer Forums](https://forums.developer.amazon.com/spaces/165/index.html) -* [Knowledge Base](https://goto.webcasts.com/starthere.jsp?ei=1090197) -* [Intro to Alexa Skills Kit - On Demand Webinar](https://goto.webcasts.com/starthere.jsp?ei=1090197) -* [Voice Design 101 - On Demand Webinar](https://goto.webcasts.com/starthere.jsp?ei=1087594) -* [Developer Office Hours](https://attendee.gotowebinar.com/rt/8389200425172113931) -* [Developing Skills in Multiple Languages](https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/developing-skills-in-multiple-languages) diff --git a/speechAssets/IntentSchema.json b/speechAssets/IntentSchema.json index 14ce0276..e06c6ab7 100644 --- a/speechAssets/IntentSchema.json +++ b/speechAssets/IntentSchema.json @@ -1,16 +1,6 @@ -{ - "intents": [ - { - "intent": "GetNewFactIntent" - }, - { - "intent": "AMAZON.HelpIntent" - }, - { - "intent": "AMAZON.StopIntent" - }, - { - "intent": "AMAZON.CancelIntent" - } - ] -} \ No newline at end of file +{ "intents": [ + { "intent": "GetNewFactIntent" }, + { "intent": "AMAZON.HelpIntent" }, + { "intent": "AMAZON.StopIntent" }, + { "intent": "AMAZON.CancelIntent" } +]} \ No newline at end of file diff --git a/speechAssets/interaction-model.json b/speechAssets/interaction-model.json new file mode 100644 index 00000000..e5d5a5e0 --- /dev/null +++ b/speechAssets/interaction-model.json @@ -0,0 +1,36 @@ +{ + "intents": [ + { + "name": "AMAZON.CancelIntent", + "samples": [] + }, + { + "name": "AMAZON.HelpIntent", + "samples": [] + }, + { + "name": "AMAZON.StopIntent", + "samples": [] + }, + { + "name": "GetNewFactIntent", + "samples": [ + "a fact", + "a space fact", + "tell me a fact", + "tell me a space fact", + "give me a fact", + "give me a space fact", + "tell me trivia", + "tell me a space trivia", + "give me trivia", + "give me a space trivia", + "give me some information", + "give me some space information", + "tell me something", + "give me something" + ], + "slots": [] + } + ] +} \ No newline at end of file diff --git a/src/index.js b/src/index.js index 6392d0df..d4a4b219 100644 --- a/src/index.js +++ b/src/index.js @@ -1,134 +1,69 @@ 'use strict'; var Alexa = require('alexa-sdk'); -var APP_ID = undefined; // TODO replace with your app ID (OPTIONAL). -var languageStrings = { - "en": { - "translation": { - "FACTS": [ - "A year on Mercury is just 88 days long.", - "Despite being farther from the Sun, Venus experiences higher temperatures than Mercury.", - "Venus rotates counter-clockwise, possibly because of a collision in the past with an asteroid.", - "On Mars, the Sun appears about half the size as it does on Earth.", - "Earth is the only planet not named after a god.", - "Jupiter has the shortest day of all the planets.", - "The Milky Way galaxy will collide with the Andromeda Galaxy in about 5 billion years.", - "The Sun contains 99.86% of the mass in the Solar System.", - "The Sun is an almost perfect sphere.", - "A total solar eclipse can happen once every 1 to 2 years. This makes them a rare event.", - "Saturn radiates two and a half times more energy into space than it receives from the sun.", - "The temperature inside the Sun can reach 15 million degrees Celsius.", - "The Moon is moving approximately 3.8 cm away from our planet every year." - ], - "SKILL_NAME" : "Space Facts", - "GET_FACT_MESSAGE" : "Here's your fact: ", - "HELP_MESSAGE" : "You can say tell me a space fact, or, you can say exit... What can I help you with?", - "HELP_REPROMPT" : "What can I help you with?", - "STOP_MESSAGE" : "Goodbye!" - } - }, - "en-US": { - "translation": { - "FACTS": [ - "A year on Mercury is just 88 days long.", - "Despite being farther from the Sun, Venus experiences higher temperatures than Mercury.", - "Venus rotates counter-clockwise, possibly because of a collision in the past with an asteroid.", - "On Mars, the Sun appears about half the size as it does on Earth.", - "Earth is the only planet not named after a god.", - "Jupiter has the shortest day of all the planets.", - "The Milky Way galaxy will collide with the Andromeda Galaxy in about 5 billion years.", - "The Sun contains 99.86% of the mass in the Solar System.", - "The Sun is an almost perfect sphere.", - "A total solar eclipse can happen once every 1 to 2 years. This makes them a rare event.", - "Saturn radiates two and a half times more energy into space than it receives from the sun.", - "The temperature inside the Sun can reach 15 million degrees Celsius.", - "The Moon is moving approximately 3.8 cm away from our planet every year." - ], - "SKILL_NAME" : "American Space Facts" - } - }, - "en-GB": { - "translation": { - "FACTS": [ - "A year on Mercury is just 88 days long.", - "Despite being farther from the Sun, Venus experiences higher temperatures than Mercury.", - "Venus rotates anti-clockwise, possibly because of a collision in the past with an asteroid.", - "On Mars, the Sun appears about half the size as it does on Earth.", - "Earth is the only planet not named after a god.", - "Jupiter has the shortest day of all the planets.", - "The Milky Way galaxy will collide with the Andromeda Galaxy in about 5 billion years.", - "The Sun contains 99.86% of the mass in the Solar System.", - "The Sun is an almost perfect sphere.", - "A total solar eclipse can happen once every 1 to 2 years. This makes them a rare event.", - "Saturn radiates two and a half times more energy into space than it receives from the sun.", - "The temperature inside the Sun can reach 15 million degrees Celsius.", - "The Moon is moving approximately 3.8 cm away from our planet every year." - ], - "SKILL_NAME" : "British Space Facts" - } - }, - "de": { - "translation": { - "FACTS": [ - "Ein Jahr dauert auf dem Merkur nur 88 Tage.", - "Die Venus ist zwar weiter von der Sonne entfernt, hat aber höhere Temperaturen als Merkur.", - "Venus dreht sich entgegen dem Uhrzeigersinn, möglicherweise aufgrund eines früheren Zusammenstoßes mit einem Asteroiden.", - "Auf dem Mars erscheint die Sonne nur halb so groß wie auf der Erde.", - "Die Erde ist der einzige Planet, der nicht nach einem Gott benannt ist.", - "Jupiter hat den kürzesten Tag aller Planeten.", - "Die Milchstraßengalaxis wird in etwa 5 Milliarden Jahren mit der Andromeda-Galaxis zusammenstoßen.", - "Die Sonne macht rund 99,86 % der Masse im Sonnensystem aus.", - "Die Sonne ist eine fast perfekte Kugel.", - "Eine Sonnenfinsternis kann alle ein bis zwei Jahre eintreten. Sie ist daher ein seltenes Ereignis.", - "Der Saturn strahlt zweieinhalb mal mehr Energie in den Weltraum aus als er von der Sonne erhält.", - "Die Temperatur in der Sonne kann 15 Millionen Grad Celsius erreichen.", - "Der Mond entfernt sich von unserem Planeten etwa 3,8 cm pro Jahr." - ], - "SKILL_NAME" : "Weltraumwissen auf Deutsch", - "GET_FACT_MESSAGE" : "Hier sind deine Fakten: ", - "HELP_MESSAGE" : "Du kannst sagen, „Nenne mir einen Fakt über den Weltraum“, oder du kannst „Beenden“ sagen... Wie kann ich dir helfen?", - "HELP_REPROMPT" : "Wie kann ich dir helfen?", - "STOP_MESSAGE" : "Auf Wiedersehen!" - } - } -}; +//========================================================================================================================================= +//TODO: The items below this comment need your attention. +//========================================================================================================================================= +//Replace with your app ID (OPTIONAL). You can find this value at the top of your skill's page on http://developer.amazon.com. +//Make sure to enclose your value in quotes, like this: var APP_ID = "amzn1.ask.skill.bb4045e6-b3e8-4133-b650-72923c5980f1"; +var APP_ID = undefined; + +var SKILL_NAME = "Space Facts"; +var GET_FACT_MESSAGE = "Here's your fact: "; +var HELP_MESSAGE = "You can say tell me a space fact, or, you can say exit... What can I help you with?"; +var HELP_REPROMPT = "What can I help you with?"; +var STOP_MESSAGE = "Goodbye!"; + +//========================================================================================================================================= +//TODO: Replace this data with your own. You can find translations of this data at http://github.com/alexa/skill-sample-node-js-fact/data +//========================================================================================================================================= +var data = [ + "A year on Mercury is just 88 days long.", + "Despite being farther from the Sun, Venus experiences higher temperatures than Mercury.", + "Venus rotates counter-clockwise, possibly because of a collision in the past with an asteroid.", + "On Mars, the Sun appears about half the size as it does on Earth.", + "Earth is the only planet not named after a god.", + "Jupiter has the shortest day of all the planets.", + "The Milky Way galaxy will collide with the Andromeda Galaxy in about 5 billion years.", + "The Sun contains 99.86% of the mass in the Solar System.", + "The Sun is an almost perfect sphere.", + "A total solar eclipse can happen once every 1 to 2 years. This makes them a rare event.", + "Saturn radiates two and a half times more energy into space than it receives from the sun.", + "The temperature inside the Sun can reach 15 million degrees Celsius.", + "The Moon is moving approximately 3.8 cm away from our planet every year." +]; + +//========================================================================================================================================= +//Editing anything below this line might break your skill. +//========================================================================================================================================= exports.handler = function(event, context, callback) { var 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(); }; var handlers = { 'LaunchRequest': function () { - this.emit('GetFact'); + this.emit('GetNewFactIntent'); }, 'GetNewFactIntent': function () { - this.emit('GetFact'); - }, - 'GetFact': function () { - // Get a random space fact from the space facts list - // Use this.t() to get corresponding language data - var factArr = this.t('FACTS'); + var factArr = data; var factIndex = Math.floor(Math.random() * factArr.length); var randomFact = factArr[factIndex]; - - // Create speech output - var speechOutput = this.t("GET_FACT_MESSAGE") + randomFact; - this.emit(':tellWithCard', speechOutput, this.t("SKILL_NAME"), randomFact) + var speechOutput = GET_FACT_MESSAGE + randomFact; + this.emit(':tellWithCard', speechOutput, SKILL_NAME, randomFact) }, 'AMAZON.HelpIntent': function () { - var speechOutput = this.t("HELP_MESSAGE"); - var reprompt = this.t("HELP_MESSAGE"); + var speechOutput = HELP_MESSAGE; + var reprompt = HELP_REPROMPT; this.emit(':ask', speechOutput, reprompt); }, 'AMAZON.CancelIntent': function () { - this.emit(':tell', this.t("STOP_MESSAGE")); + this.emit(':tell', STOP_MESSAGE); }, 'AMAZON.StopIntent': function () { - this.emit(':tell', this.t("STOP_MESSAGE")); + this.emit(':tell', STOP_MESSAGE); } }; \ No newline at end of file diff --git a/step-by-step/1-voice-user-interface.md b/step-by-step/1-voice-user-interface.md new file mode 100644 index 00000000..4ab48148 --- /dev/null +++ b/step-by-step/1-voice-user-interface.md @@ -0,0 +1,131 @@ +# Build An Alexa Fact Skill +[![Voice User Interface](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/navigation/1-on._TTH_.png)](https://github.com/alexa/skill-sample-nodejs-fact/blob/master/step-by-step/1-voice-user-interface.md)[![Lambda Function](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/navigation/2-off._TTH_.png)](https://github.com/alexa/skill-sample-nodejs-fact/blob/master/step-by-step/2-lambda-function.md)[![Connect VUI to Code](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/navigation/3-off._TTH_.png)](https://github.com/alexa/skill-sample-nodejs-fact/blob/master/step-by-step/3-connect-vui-to-code.md)[![Testing](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/navigation/4-off._TTH_.png)](https://github.com/alexa/skill-sample-nodejs-fact/blob/master/step-by-step/4-testing.md)[![Customization](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/navigation/5-off._TTH_.png)](https://github.com/alexa/skill-sample-nodejs-fact/blob/master/step-by-step/5-customization.md)[![Publication](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/navigation/6-off._TTH_.png)](https://github.com/alexa/skill-sample-nodejs-fact/blob/master/step-by-step/6-publication.md) + +## Setting up Your Alexa Skill in the Developer Portal + +There are two parts to an Alexa skill. The first part is the [Voice User Interface (VUI)](https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/defining-the-voice-interface). This is where we define how we will handle a user's voice input, and which code should be executed when specific commands are uttered. The second part is the actual code logic for our skill, and we will handle that on [page #2](https://github.com/alexa/skill-sample-nodejs-fact/blob/master/step-by-step/2-lambda-function.md) of this step-by-step guide. + +1. **Go to the [Amazon Developer Portal](http://developer.amazon.com). In the top-right corner of the screen, click the "Sign In" button.**
(If you don't already have an account, you will be able to create a new one for free.) + + + +2. **Once you have signed in, click the Alexa button at the top of the screen.** + + + +3. **On the Alexa page, choose the "Get Started" button for the Alexa Skills Kit.** + + + +4. **Select "Add A New Skill."** This will get you to the first page of your new Alexa skill. + + + +5. **Fill out the Skill Information screen.** Make sure to review the tips we provide below the screenshot. + + + + ### Skill Information Tips + 1. **Skill Type** For this skill, we are creating a skill using the Custom Interaction Model. This is the default choice. + + 2. **Language** Choose the first language you want to support. You can add additional languages in the future, but we need to start with one. (This guide is using U.S. English to start.) + + 3. **Name** This is the name that will be shown in the Alexa Skills Store, and the name your users will refer to. + + 4. **Invocation Name** This is the name that your users will need to say to start your skill. We have provided some common issues developers encounter in the list below, but you should also review the entire [Invocation Name Requirements](https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/choosing-the-invocation-name-for-an-alexa-skill). + + | Invocation Name Requirements | Examples of incorrect invocation names | + | ---------------------------- | -------------------------------------- | + | The skill invocation name must not infringe upon the intellectual property rights of an entity or person. | korean air; septa check | + | Invocation names should be more than one word (unless it is a brand or intellectual property), and must not be a name or place | horoscope; trivia; guide; new york | + | Two word invocation names are not allowed when one of the words is a definite article, indefinite article, or a preposition | any poet; the bookie; the fool | + | The invocation name must not contain any of the Alexa skill launch phrases and connecting words. Launch phrase examples include "launch," "ask," "tell," "load," and "begin." Connecting word examples include "to," "from," "by," "if," "and," "whether." | trivia game for star wars; better with bacon | + | The invocation name must not contain the wake words "Alexa," "Amazon," "Echo," or the words "skill" or "app." | hackster initial skill; word skills | + | The invocation name must be written in each language you choose to support. For example, the German version of your skill must have an invocation name written in German, while the English (US) version must have an invocation name written in English. | kitchen stories (German skill) | + + 5. **Audio Player** For this Fact skill, we won't be using any audio files, so you can select No for this option. If you would like to learn more about adding audio to your skills, please check out our [Audio Player Guide](https://github.com/alexa/skill-sample-nodejs-audio-player). + +6. **Click the Next button to move to the Interaction Model.** + + + +7. Click on the **Launch Skill Builder** (Beta) button . This will launch the new Skill Builder Dashboard. + + ![Launch Skill Builder](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/general/1-7-skill-builder-launch._TTH_.png) + +8. Click on the "Add+" button near **Intents** on the top left corner of the dashboard. + + ![Add Intent Button](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/general/1-8-intents-button._TTH_.png) + +9. In the textbox provided, enter the new intent name: **GetNewFactIntent.**, and click the **Create Intent** button. + + ![Add Intent](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/general/1-9-add-custom-intent._TTH_.png) + +10. Add 10-15 sample utterances for your intent. These are the things a user would say to make this intent happen. Here are a few examples: + + * Give me a fact + * Tell me a fact + * Tell me something + * Tell me a space fact + + ![](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/general/1-10-sample-utterances._TTH_.png) + +11. Click on the **Save Model** button, and then click on the **Build Model** button. + + ![](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/general/1-12-skill-builder-build-save-model._TTH_.png) + + + +12. If your interaction model builds successfully, click on **Configuration button** to move on to Configuration. In our next step of this guide, we will be creating our Lambda function in the AWS developer console, but keep this browser tab open, because we will be returning here on [Page #3: Connect VUI to Code](https://github.com/alexa/skill-sample-nodejs-fact/blob/master/step-by-step/3-connect-vui-to-code.md). + ![](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/general/1-13-skill-builder-configuration.png) + + If you get an error from your interaction model, check through this list: + + * **Did you copy & paste the provided code into the appropriate boxes?** + * **Did you accidentally add any characters to the Interaction Model or Sample Utterances?** + +

+ + + diff --git a/step-by-step/2-lambda-function.md b/step-by-step/2-lambda-function.md new file mode 100644 index 00000000..8929e6f7 --- /dev/null +++ b/step-by-step/2-lambda-function.md @@ -0,0 +1,63 @@ +# Build An Alexa Fact Skill +[![Voice User Interface](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/navigation/1-locked._TTH_.png)](https://github.com/alexa/skill-sample-nodejs-fact/blob/master/step-by-step/1-voice-user-interface.md)[![Lambda Function](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/navigation/2-on._TTH_.png)](https://github.com/alexa/skill-sample-nodejs-fact/blob/master/step-by-step/2-lambda-function.md)[![Connect VUI to Code](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/navigation/3-off._TTH_.png)](https://github.com/alexa/skill-sample-nodejs-fact/blob/master/step-by-step/3-connect-vui-to-code.md)[![Testing](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/navigation/4-off._TTH_.png)](https://github.com/alexa/skill-sample-nodejs-fact/blob/master/step-by-step/4-testing.md)[![Customization](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/navigation/5-off._TTH_.png)](https://github.com/alexa/skill-sample-nodejs-fact/blob/master/step-by-step/5-customization.md)[![Publication](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/navigation/6-off._TTH_.png)](https://github.com/alexa/skill-sample-nodejs-fact/blob/master/step-by-step/6-publication.md) + +## Setting Up A Lambda Function Using Amazon Web Services + +In the [first step of this guide](https://github.com/alexa/skill-sample-nodejs-fact/blob/master/step-by-step/1-voice-user-interface.md), we built the Voice User Interface (VUI) for our Alexa skill. On this page, we will be creating a Lambda function using [Amazon Web Services](http://aws.amazon.com). You can [read more about what a Lambda function is](http://aws.amazon.com/lambda), but for the purposes of this guide, what you need to know is that Lambda is where our code lives. When a user asks Alexa to use our skill, it is our Lambda function that interprets the appropriate interaction, and provides the conversation back to the user. + +1. **Go to http://aws.amazon.com and sign in to the console.** If you don't already have an account, you will need to create one. [Check out this quick walkthrough for setting up a new AWS account](/set-up-aws.md). + + + +2. **Choose "Services" at the top of the screen, and type "Lambda" in the search box.** You can also find it in the list of services. It is in the "Compute" section. + + + +3. **Check your AWS region.** Lambda only works with the Alexa Skills Kit in two regions: US East (N. Virginia) and EU (Ireland). Make sure you choose the region closest to your customers. + + + +4. **Click the "Create a Lambda function" button.** It should be near the top of your screen. + + + +5. **Choose the blueprint named "alexa-nodejs-template".** We have created a blueprint as a shortcut to getting everything set up for your skill. It adds the alexa-sdk to your Lambda function so that you don't have to upload it yourself. + + + +6. **Configure your trigger.** There are many different AWS services that can trigger a Lambda function, but for the purposes of this guide, we need to select "Alexa Skills Kit." If you don't see Alexa Skills Kit in the list, jump back to step #3 on this page. + + + + Once you have selected Alexa Skills Kit, click the **Next** button. + +7. **Configure your function.** This screen is where we will enter the important parts of our Lambda function. These values will only ever be visible to you, but make sure that you name your function something meaningful. "FactSkill" is sufficient if you don't have another idea for a name. + + + +8. **Paste the provided code into the Lambda function code box.** We have provided the code for this skill on [GitHub](https://github.com/alexa/skill-sample-nodejs-fact/blob/master/src/index.js). Simply delete the contents of the code box, and paste the contents of the new code. + +9. **Set up your Lambda function role.** If you haven't done this before, we have a [detailed walkthrough for setting up your first role for Lambda](LAMBDAROLE.md). If you have done this before, you only need to set your **Existing role** value to "lambda_basic_execution." + + + +10. **For this guide, you can skip all of the Advanced settings.** You can just click the **Next** button to move to the Review screen. + + + +11. **The Review screen is just a summary of your choices. Click the Create Function bottom in the bottom left corner.** + + + +12. **As a final step, copy the ARN value from the top right corner of the screen.** You will need this value in the next section of this guide. + + + +

+ + + + + + + diff --git a/step-by-step/3-connect-vui-to-code.md b/step-by-step/3-connect-vui-to-code.md new file mode 100644 index 00000000..ced906e7 --- /dev/null +++ b/step-by-step/3-connect-vui-to-code.md @@ -0,0 +1,33 @@ +# Build An Alexa Fact Skill +[![Voice User Interface](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/navigation/1-locked._TTH_.png)](https://github.com/alexa/skill-sample-nodejs-fact/blob/master/step-by-step/1-voice-user-interface.md)[![Lambda Function](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/navigation/2-locked._TTH_.png)](https://github.com/alexa/skill-sample-nodejs-fact/blob/master/step-by-step/2-lambda-function.md)[![Connect VUI to Code](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/navigation/3-on._TTH_.png)](https://github.com/alexa/skill-sample-nodejs-fact/blob/master/step-by-step/3-connect-vui-to-code.md)[![Testing](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/navigation/4-off._TTH_.png)](https://github.com/alexa/skill-sample-nodejs-fact/blob/master/step-by-step/4-testing.md)[![Customization](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/navigation/5-off._TTH_.png)](https://github.com/alexa/skill-sample-nodejs-fact/blob/master/step-by-step/5-customization.md)[![Publication](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/navigation/6-off._TTH_.png)](https://github.com/alexa/skill-sample-nodejs-fact/blob/master/step-by-step/6-publication.md) + +## Connecting Your Voice User Interface To Your Lambda Function + +On [page #1](https://github.com/alexa/skill-sample-nodejs-fact/blob/master/step-by-step/1-voice-user-interface.md) of this guide, we created a voice user interface for the intents and utterances we expect from our users. On [page #2](https://github.com/alexa/skill-sample-nodejs-fact/blob/master/step-by-step/2-lambda-function.md), we created a Lambda function that contains all of our logic for the skill. On this page, we need to connect those two pieces together. + +1. **Go back to the [Amazon Developer Portal](https://developer.amazon.com/edw/home.html#/skills/list) and select your skill from the list.** You may still have a browser tab open if you started at the beginning of this tutorial. + +2. **Open the "Configuration" tab on the left side.** + + + +3. **Select the "AWS Lambda ARN" option for your endpoint.** You have the ability to host your code anywhere that you would like, but for the purposes of simplicity and frugality, we are using AWS Lambda. ([Read more about Hosting Your Own Custom Skill Web Service](https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/developing-an-alexa-skill-as-a-web-service).) With the AWS Free Tier, you get 1,000,000 free requests per month, up to 3.2 million seconds of compute time per month. Learn more at https://aws.amazon.com/free/. In addition, Amazon now offers [AWS Promotional Credits for developers who have live Alexa skills that incur costs on AWS related to those skills](https://developer.amazon.com/alexa-skills-kit/alexa-aws-credits). + + + +4. **Select "North America" or "Europe" as your geographical region.** IMPORTANT: Make sure you select the same region that you created your Lambda in. Remember, Alexa skills using AWS Lambda can only run in N. Virginia (North America) and Ireland (Europe). + + + +5. **Paste your Lambda's ARN (Amazon Resource Name) into the textbox provided.** It should look similar to the screenshot above. + +6. **Leave "Account Linking" set to "No."** For this skill, we won't be using Account Linking, but you can learn more about [Linking an Alexa User with a User in Your System.](https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/linking-an-alexa-user-with-a-user-in-your-system) + +7. **Click the "Next" button to continue to page #4 of this guide.** + + [![Testing](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/general/3-7-next-button._TTH_.png)](https://github.com/alexa/skill-sample-nodejs-fact/blob/master/step-by-step/4-testing.md) + +

+ + + \ No newline at end of file diff --git a/step-by-step/4-testing.md b/step-by-step/4-testing.md new file mode 100644 index 00000000..6ecbbfce --- /dev/null +++ b/step-by-step/4-testing.md @@ -0,0 +1,118 @@ +# Build An Alexa Fact Skill +[![Voice User Interface](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/navigation/1-locked._TTH_.png)](https://github.com/alexa/skill-sample-nodejs-fact/blob/master/step-by-step/1-voice-user-interface.md)[![Lambda Function](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/navigation/2-locked._TTH_.png)](https://github.com/alexa/skill-sample-nodejs-fact/blob/master/step-by-step/2-lambda-function.md)[![Connect VUI to Code](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/navigation/3-locked._TTH_.png)](https://github.com/alexa/skill-sample-nodejs-fact/blob/master/step-by-step/3-connect-vui-to-code.md)[![Testing](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/navigation/4-on._TTH_.png)](https://github.com/alexa/skill-sample-nodejs-fact/blob/master/step-by-step/4-testing.md)[![Customization](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/navigation/5-off._TTH_.png)](https://github.com/alexa/skill-sample-nodejs-fact/blob/master/step-by-step/5-customization.md)[![Publication](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/navigation/6-off._TTH_.png)](https://github.com/alexa/skill-sample-nodejs-fact/blob/master/step-by-step/6-publication.md) + +## Testing Your Alexa Skill + +So far, we have [created a Voice User Interface](https://github.com/alexa/skill-sample-nodejs-fact/blob/master/step-by-step/1-voice-user-interface.md) and [a Lambda function](https://github.com/alexa/skill-sample-nodejs-fact/blob/master/step-by-step/2-lambda-function.md), and [connected the two together](https://github.com/alexa/skill-sample-nodejs-fact/blob/master/step-by-step/3-connect-vui-to-lambda.md). Your skill is now ready to test. + +1. **Go back to the [Amazon Developer Portal](https://developer.amazon.com/edw/home.html#/skills/list) and select your skill from the list.** You may still have a browser tab open if you started at the beginning of this tutorial. + +2. **Open the "Test" tab on the left side.** + + + +3. **Understand the voice simulator.** While it's not specific to your skill, the Voice Simulator is a valuable testing tool for every skill. Type a word into the box, and click the "Listen" button to hear how Alexa will +pronounce it. To make changes to her pronunciation, use Speech Synthesis Markup Language [(SSML)](https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/speech-synthesis-markup-language-ssml-reference) to modify how Alexa will interpret text to speech. Try these examples: + + ```html + 12345 + ``` + + ```html + 12345 + ``` + + ```html + 12345 + ``` + + + + Return to the Voice Simulator as needed to ensure that Alexa says words and phrases as you would expect. + +4. **Test your skill with the Service Simulator.** To validate that your skill is working as expected, use the Service Simulator. In the **Enter Utterance** text box, type "give me a fact" + + + + ### Service Simulator Tips + * After you click the "Ask [Your Skill Name]" button, you should see the **Lambda Request** and **Lambda Response** boxes get populated with JSON data like in the screenshot above. + * Click the **Listen** button in the bottom right corner to hear Alexa read the response. + + * If you receive a response that reads: *"The remote endpoint could not be called, or the response it returned was invalid,"* this is an indication that something is broken. AWS Lambda offers an additional testing tool to help you troubleshoot your skill. + +5. **Configure a test event in AWS Lambda.** Now that you are familiar with the **request** and **response** boxes in the Service Simulator, it's important for you to know that you can use your **requests** to directly test your Lambda function every time you update it. To do this: + 1. Create & copy a new response with the Service Simulator, or grab the sample text from the box below: + + ```JAVASCRIPT + { + "session": { + "sessionId": "SessionId.ce5b9874-0f86-49d0-8fe2-85f5a2008386", + "application": { + "applicationId": "amzn1.ask.skill.ac4240ad-4b18-484a-ab67-d740ed1320ac" + }, + "attributes": {}, + "user": { + "userId": "amzn1.ask.account.AGZFAKNV3GFD5OWVXLULBF2NNRHHUSJEHVDEMNQ2ZHTN5N6FPCIOQAJBBJCJ7M4TR254CLS5HPRW25NQL22M5XFR3MV73KJ52MOAD5E4MSKEMZWV2626OF6IOU3YZ6G5ZC5KQW7RP63GUFDRTB5PACWW3375W2E5JQBORIFUEZUYWVGOBHC7Z33C4UOE4QGBFYFFDGHMXW4OL5I" + }, + "new": true + }, + "request": { + "type": "IntentRequest", + "requestId": "EdwRequestId.1181fc5e-453e-4bb4-8ec5-ba48bcaf88ec", + "locale": "en-US", + "timestamp": "2017-05-03T15:09:42Z", + "intent": { + "name": "GetNewFactIntent", + "slots": {} + } + }, + "version": "1.0" + } + ``` + + 2. **Open your Lambda function in AWS, open the Actions menu, and select "Configure test event."** + + + + 3. **Choose "Alexa Start Session" from the Sample Event Template dropdown list.** You can choose any item in the list, as they are just templated event requests, but using "Alexa Start Session" is an easy one to remember. This will also be the sample request that fires every time you update and "Save and Test" your Lambda code. + + + + 4. **Delete the contents of the box, and paste your request into the box.** + + + + 5. **Click the "Save and test" button.** This will save your test event, and run it against your Lambda function. + + + + This gives you visibility into four things: + + * **Your response, listed in the "Execution Result."** + + + + * **A Summary of the statistics for your request.** This includes things like duration, resources, and memory used. + + + + * **Log output.** By effectively using console.log() statements in your Lambda code, you can track what is happening inside your function, and help to figure out what is happening when something goes wrong. You will find the log to be incredibly valuable as you move into more advanced skills. + + + + * **A link to your [CloudWatch](https://console.aws.amazon.com/cloudwatch/home?region=us-east-1#logs:) logs for this function.** This will show you **all** of the responses and log statements from every user interaction. This is very useful, especially when you are testing your skill from a device with your voice. (It is the "[Click here](https://console.aws.amazon.com/cloudwatch/home?region=us-east-1#logs:)" link in the Log Output description.) + +6. **Other testing methods to consider:** + + * [Echosim.io](https://echosim.io) - a browser-based Alexa skill testing tool that makes it easy to test your skills without carrying a physical device everywhere you go. + * [Unit Testing with Alexa](https://github.com/alexa/skill-sample-nodejs-fact/blob/master/unit-testing.md) - a modern approach to unit testing your Alexa skills with [Postman](http://getpostman.com) and [Amazon API Gateway](http://aws.amazon.com/apigateway). + +7. **If your sample skill is working properly, you can now customize your skill.** + +

+ + + + + + diff --git a/step-by-step/5-customization.md b/step-by-step/5-customization.md new file mode 100644 index 00000000..e0c6446a --- /dev/null +++ b/step-by-step/5-customization.md @@ -0,0 +1,39 @@ +# Build An Alexa Fact Skill +[![Voice User Interface](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/navigation/1-locked._TTH_.png)](https://github.com/alexa/skill-sample-nodejs-fact/blob/master/step-by-step/1-voice-user-interface.md)[![Lambda Function](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/navigation/2-locked._TTH_.png)](https://github.com/alexa/skill-sample-nodejs-fact/blob/master/step-by-step/2-lambda-function.md)[![Connect VUI to Code](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/navigation/3-locked._TTH_.png)](https://github.com/alexa/skill-sample-nodejs-fact/blob/master/step-by-step/3-connect-vui-to-code.md)[![Testing](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/navigation/4-locked._TTH_.png)](https://github.com/alexa/skill-sample-nodejs-fact/blob/master/step-by-step/4-testing.md)[![Customization](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/navigation/5-on._TTH_.png)](https://github.com/alexa/skill-sample-nodejs-fact/blob/master/step-by-step/5-customization.md)[![Publication](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/navigation/6-off._TTH_.png)](https://github.com/alexa/skill-sample-nodejs-fact/blob/master/step-by-step/6-publication.md) + +## Customize the Skill to be Yours + +At this point, you should have a working copy of our Fact skill. In order to make it your own, you will need to customize it with data and responses that you create. Here are the things you will need to change: + +1. **New data.** You will need to provide a set of facts for your topic. We recommend a minimum of 25, but a total closer to 100 offers a better experience. + + 1. **Open a copy of index.js.** If you haven't already downloaded the code for this project, [you can find a copy of index.js here on GitHub](https://github.com/alexa/skill-sample-nodejs-fact/blob/master/src/index.js). You can use a simple, lightweight code editor like [Atom](http://atom.io), [Sublime Text](http://sublimetext.com), or [VSCode](http://code.visualstudio.com), but you also have the option to edit the code directly in your Lambda function. + + 2. **Search for the comment "TODO: Replace this data with your own."** This is the data for our skill. You can see that it is a simple list of facts. + + 3. **When you have replaced the data in index.js, copy the contents of your file to your Lambda function.** This should be as simple as copying the text, and pasting it into the code box for your Lambda. + + + +2. **New sentences to respond to your users.** There are several sentences and responses that you will want to customize for your skill. + + 1. **Go back to your copy of [index.js]((https://github.com/alexa/skill-sample-nodejs-fact/blob/master/src/index.js)).** + + 2. **Look for the comment "TODO: The items below this comment need your attention."** This is the beginning of the section where you need to customize several text strings for your skill. + + 3. **Continue through index.js until you reach the bottom of the file.** This will ensure that you cover each of the values that you need to update. + +3. **New language.** If you are creating this skill for another language other than English, you will need to make sure Alexa's responses are also in that language. + + * For example, if you are creating your skill in German, every single response that Alexa makes has to be in German. You can't use English responses or your skill will fail certification. + +4. **Once you have made the updates listed on this page, you can click "Next" to move on to Publishing and Certification of your skill.** + + + +

+ + + + + diff --git a/step-by-step/6-publication.md b/step-by-step/6-publication.md new file mode 100644 index 00000000..f029372e --- /dev/null +++ b/step-by-step/6-publication.md @@ -0,0 +1,128 @@ +# Build An Alexa Fact Skill +[![Voice User Interface](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/navigation/1-locked._TTH_.png)](https://github.com/alexa/skill-sample-nodejs-fact/blob/master/step-by-step/1-voice-user-interface.md)[![Lambda Function](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/navigation/2-locked._TTH_.png)](https://github.com/alexa/skill-sample-nodejs-fact/blob/master/step-by-step/2-lambda-function.md)[![Connect VUI to Code](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/navigation/3-locked._TTH_.png)](https://github.com/alexa/skill-sample-nodejs-fact/blob/master/step-by-step/3-connect-vui-to-code.md)[![Testing](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/navigation/4-locked._TTH_.png)](https://github.com/alexa/skill-sample-nodejs-fact/blob/master/step-by-step/4-testing.md)[![Customization](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/navigation/5-locked._TTH_.png)](https://github.com/alexa/skill-sample-nodejs-fact/blob/master/step-by-step/5-customization.md)[![Publication](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/navigation/6-on._TTH_.png)](https://github.com/alexa/skill-sample-nodejs-fact/blob/master/step-by-step/6-publication.md) + +## Get Your Skill Certified and Published + +We are almost done! The last step is to add the metadata that your skill will use in the [Alexa app](http://amazon.com/skills). This page will walk you through the remaining steps, and give you some tips on how to avoid the common mistakes developers make that result in a failed certification. + +1. **Go to your skill's Publishing Information tab on the [Amazon Developer Portal](https://developer.amazon.com/edw/home.html#/skills/list).** + + + +2. **Complete the Global Fields data.** These fields apply across all of the languges that your skill supports. + + + + * **For Category, we are building a fact skill, so select "Games, Trivia, and Accessories."** You will also be presented with a **Sub-Category** option. For this skill, choose "Knowledge and Trivia." + + * **Provide testing instructions.** Testing instructions give you an opportunity to explain your skill, and any special or possibly confusing features, to the certification team. A value is required in this box. + + * Since you are using our Fact Sample, make sure to add this sentence to your Testing Instructions: + + ``` + This was built using the Fact Sample. + ``` + + This will let the testing team understand what you're providing them, and should decrease the testing time required. + + * **Countries and Region can be for "all countries", unless you have a specific reason to exclude a specific location.** This gives Amazon the ability to distribute your skill globally. Remember that you will need to create additional versions of your skill in the other available languages before they will be available in those countries. + +3. **Write your skill descriptions.** + + + + * **Spend some time coming up with an enticing, succinct description.** This is one of the few places you have an opportunity to attract new users, so make the most of it! These descriptions show up in the list of skills available in the [Alexa app](http://alexa.amazon.com/spa/index.html#skills). + +4. **For your example phrases, come up with the three most exciting ways a user can talk to your skill.** + + + + * **Make sure that each of your example phrases are a perfect match with one of your Sample Utterances.** Incorrect example phrases are one of the most common reasons that skills fail certification, so we have provided a short list of things to consider as you write your example phrases: + + | Common Failure Points for Example Phrases | + | ----------------------------------------- | + | Example phrases **must** adhere to the [supported phrases](https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/supported-phrases-to-begin-a-conversation). | + | Example phrases **must** be based on sample utterances specified in your Intent Schema. | + | Your first example phrase **must** include a wake word and your invocation name. | + | Example phrases **must** provide a contextual response. | + + * **Choose three example phrases that are likely to be the most common ways that users will attempt to interact with your skill.** Make sure that each of them works well, and provides an excellent user experience. + +5. **Provide a comprehensive list of keywords for users that are searching for new skills.** This is an optional field, and searching the [Alexa app](http://alexa.amazon.com) will also find the words in your Skill Name and descriptions, so you don't need to overdo it. That being said, if there are words that you want users to find your skill with, you should include them here. Separate the keywords with commas. + + + +6. **Create your skill's icons.** You need two sizes of your icon: 108x108px and 512x512px. + + + + * **Make sure you have the rights to the icons you create.** Please don't violate any trademarks or copyrights. + * **If you don't have software to make icons, try one of these free options:** + + * [GIMP](https://www.gimp.org/) (Windows/Mac/Linux) + * [Paint.NET](http://www.getpaint.net/index.html) (Windows) + * [Inkscape](http://inkscape.org) (Windows/Mac/Linux) + * [Iconion](http://iconion.com/) (Windows/Mac) + + * To make it easier to get started, we've created blank versions of these icons in both sizes for many formats: + + * [PSD](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/general/icon-templates/psd._TTH_.zip) + * [PNG](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/general/icon-templates/png._TTH_.zip) + * [GIF](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/general/icon-templates/gif._TTH_.zip) + * [PDF](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/general/icon-templates/pdf._TTH_.zip) + * [JPG](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/general/icon-templates/jpg._TTH_.zip) + * [SVG](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/general/icon-templates/svg._TTH_.zip) + * [PDN](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/general/icon-templates/pdn._TTH_.zip) - for [Paint.NET](http://www.getpaint.net/index.html) + * [XCF](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/general/icon-templates/xcf._TTH_.zip) - for [GIMP](https://www.gimp.org/) + +7. **Open the Privacy & Compliance tab on the left side of your skill in the [Developer Portal](https://developer.amazon.com/edw/home.html#/skills/list).** + + + +8. **Answer each of the Global Fields questions using the guidance below.** These fields also apply across all of the languages that your skill supports. + + + + * **Does this skill allow users to make purchases or spend real money?** For this fact skill, the answer is no. For future skills, make sure you answer this appropriately. + + * **Does this Alexa skill collect users' personal information?** Again, for this fact skill, the answer is no. If you do collect information about a user, such as names, email addresses, phone numbers, and so forth, ensure that you answer Yes to this question. + * Answering "yes" to this question will also require you to provide a link to your Privacy Policy at the bottom of the page. + + * **Is your skill directed to children under the age of 13?** Because you customized this skill with data you provided, it is possible that you created a skill that targets children under the age of 13. For this fact skill, the answer is **no** because it doesn't target a specific age group. + * Factors to consider in determining if this skill is directed to children under 13 include: + * Subject matter of the skill + * Presence of child-oriented activities and incentives + * Type of language used in the skill + * Music and other audio content in the skill + * How the skill is described and marketed + * Intended audience for the skill + + If you're not sure, please see the [FTC's COPPA Guidance and FAQ](https://www.ftc.gov/tips-advice/business-center/guidance/complying-coppa-frequently-asked-questions) for more information. + +9. **Export Compliance.** Be certain that you agree with all of the conditions. If you do, make sure to check this box, as Amazon requires this permission to distribute your skill around the globe. + +10. **Privacy Policy URL.** This is an optional field, and should not be required for this Fact skill sample. You can leave it blank. + +11. **Terms of Use URL.** This is also optional, and you can leave it blank. + +12. **Click the Save button at the bottom of the page.** + + + +13. **Each checkmark should be green, as shown.** + + + +14. **If you feel that your skill is ready for certification, click the "Submit for Certification" button at the bottom of the page.** + + + +15. **You're done with your submission!** Here are a few things you might need to know: + + * **Certification can take several days to complete.** Please be patient. It takes time because we want to get it right. + + * **Did something go wrong?** Our team of evangelists run [online office hours every Tuesday from 1-2pm Pacific Time](https://attendee.gotowebinar.com/rt/8389200425172113931). They can help answer any questions you might have. + + * **Want the coolest t-shirt you've ever seen?** Every month, we create a brand-new Alexa Developer t-shirt or hoodie, and send them out to developers that published a skill that month. [You can get yours here if you live in the US](https://developer.amazon.com/alexa-skills-kit/alexa-developer-skill-promotion), [here for the UK](https://developer.amazon.com/en-gb/alexa-skills-kit/alexa-developer-skill-promotion), and [here for Germany](https://developer.amazon.com/de-de/alexa-skills-kit/alexa-developer-skill-promotion). + +