Import an Alexa-hosted Skill from a Public Git Repository
When you create an Alexa-hosted skill, Alexa provisions and manages resources on AWS for you. The service also stores code that you can develop by using the online code editor or offline tools such as the Alexa Skills Kit Command Line Interface (ASK CLI) or Visual Studio Code. For an overview of hosted skills, see About Alexa-hosted Skills.
You can create a new Alexa-hosted skill by importing a skill project from a public Git repository as described in this documentation. By importing your skill from a public Git project, you can start your skill from a wide variety of open source templates shared by the skill building community on platforms such as GitHub, GitLab, and Bitbucket.
You can also create an Alexa-hosted skill in the following alternate ways:
- You can create an Alexa-hosted skill by using the Alexa developer console.
- You can create an Alexa-hosted skill by using the ASK CLI.
- You can create an Alexa-hosted skill by converting an existing Alexa skill.
Prerequisites and requirements
The following are the prerequisites and requirements for importing an Alexa-hosted skill from a public Git project:
- The size of the Git project archive must not exceed 50MB.
- The Git project must use the Node.js or Python programming language.
- The Git project must contain the language that you select as the default language when you create the skill.
- The skill code in the Git project must contain the voice interaction model and response code.
- The project files must have the correct structure. For details, see supported project structure.
- The code files that contain your handlers must be named index.js (for Node.js) or lambda_function.py (for Python).
Import an Alexa-hosted skill from a public Git project
To import an Alexa-hosted skill from a public Git repository
- Open the Alexa developer console and log in.
- Click Create Skill. The Create a new skill page appears.
- For Skill name, type a name.
- For Default language, choose a language.
- For Choose a model to add to your skill, select Custom.
- For Choose a method to host your skill's backend resources, select Alexa-Hosted (Node.js) or Alexa-Hosted (Python).
- Click Create Skill. The Choose a template to add to your skill page appears.
- Click Import skill. The Import skill dialog appears.
- Enter the .git link to the Git repository that contains the skill that you want to import.
- Click Continue. The message Creating your Alexa-hosted skill appears. If Alexa validates that the Git repository contains an Alexa skill that it can import, Alexa creates your Alexa-hosted skill.
After you import your Alexa-hosted skill, you might have some additional tasks to perform, such as the following:
- If your skill includes dependent services that are not supported by Alexa-hosted Skills, such as SageMaker or Amazon Translate, you must use your personal AWS resources in your skill. For details, see Use Personal AWS Resources with Your Alexa-hosted Skill.
- If your skill requires account linking, you must configure it. For details, see Understand Account Linking for Alexa Skills.
Supported project structure
The project that you import to create an Alexa-hosted skill must have a particular structure. There are two options for the project structure. You can use the skill package format, or you can use the ASK CLI v1 format. Choose a project structure that corresponds to your preferred programming language.
Skill package format (Node.js)
SkillName └── lambda │ ├── index.js │ └── package.json | └── skill-package └── assets | └── images | ├── en-US_largeIcon.png | ├── en-US_smallIcon.png | ├── isp1 | │ ├── en-US_largeIcon.png | │ └── en-US_smallIcon.png | └── isp2 | ├── en-US_largeIcon.png | └── en-US_smallIcon.png | └── interactionModels | └── custom | └── en-US.json | └── isps | ├── isps.json | ├── isp1.json | └── exampleDirectory | └── isp2.json | └── skill.json
Skill package format (Python)
SkillName └── lambda │ ├── lambda_function.py │ └── requirements.txt | └── skill-package └── assets | └── images | ├── en-US_largeIcon.png | ├── en-US_smallIcon.png | ├── isp1 | │ ├── en-US_largeIcon.png | │ └── en-US_smallIcon.png | └── isp2 | ├── en-US_largeIcon.png | └── en-US_smallIcon.png | └── interactionModels | └── custom | └── en-US.json | └── isps | ├── isps.json | ├── isp1.json | └── exampleDirectory | └── isp2.json | └── skill.json
ASK CLI v1 format (Node.js)
SkillName ├── .ask/config ├── skill.json └── isps/ | └── lambda/ │ ├── index.js │ └── package.json | └── models └── xx-YY.json
ASK CLI v1 format (Python)
SkillName ├── .ask/config ├── skill.json └── isps/ | └── lambda/ │ ├── lambda_function.py │ └── requirements.txt | └── models └── xx-YY.json
- Use Media Files with Your Alexa-Hosted Skill
- Use DynamoDB for Data Persistence with Your Alexa-hosted Skill
- Use Personal AWS Resources with Your Alexa-hosted Skill
- Create and Manage Alexa-hosted Skills Using the ASK CLI
Last updated: Mar 23, 2023