Get started with Alexa Widgets in 15 minutes or less

Staff Writer Apr 24, 2023
Alexa Skills

Amazon announced today the ability for all skill developers to create Alexa Widgets. Alexa Widgets display information related to your favorite Alexa content (like a recipe of the day, weather forecast, or shopping list) and let users take quick actions without leaving the home screen or asking for updates.

This blog supplements our technical documentation and can help you create a sample widget in 15 minutes or less. After it’s up and running and you’re comfortable with how all the pieces work together, you’ll have everything you need to build your own widget. 

Import the Skill/Widget Sample

  1. Go to the Alexa Developer Console to create a new skill (if you don’t already have a developer account you will need to create one).
  2. As part of the skill creation workflow you’ll need to do the following:
    1. Enter a skill name (don’t worry about what you name it, you can change it later).
    2. Set the primary locale to “English (US)”.
    3. Choose "Other" as the experience type.
    4. Keep default settings for model and hosting service (Model: Custom, Host: Alexa-hosted (Node.js)).
    5. Choose an hosting region (doesn’t matter which).
  3. Once you reach the “Templates” step, click the “Import skill” button in the upper right corner.
  4. When asked for a public git repository, provide and click “Import”.
    1. The import process will take a minute or two to complete.
  5. Once the import is completed, select “Invocations” > “Skill Invocation Name” from the left-hand navigation and update the invocation name from “change me”.
  6. Click “Build Model” to save and rebuild your model. Once the rebuild completes, move on to the next section.

Update Alexa Client ID and Secret

  1. Select "Tools" > "Permissions" from the left-hand navigation, scroll down to the bottom of the page, and copy the "Alexa Client Id" and "Alexa Client Secret" to a temporary location.
  2. Go to the "Code" tab, and replace AlexaClientID and AlexaClientSecret with your own values on lines 11 and 12 in index.js.


3. Once all the variables have been updated, click “Deploy” to save and deploy the changes.


Enable Skill Testing

  1. Go to the “Test” tab, click the drop down, and select “Development” to enable testing for your skill.


View Your Widget

  1. Go back to the “Build” tab, click “Multimodal Responses” from the left-hand navigation. Then select “Widget” from the section in the middle of the screen. At this point you should see a list showing one “plant-care” widget.
  2. Click “Edit” to open the “plant-care” widget it in the authoring tool.
    1. Note: The “plant-care” widget uses widget responsive templates that are designed to be responsive across different viewports.

Push to Device

  1. Assuming you have an Echo Show 8, 10, or 15, select any of those devices from the drop down list at the bottom of the screen, switch from “Preview” to “Install”, and click “Send to Device” to install the widget on that device.
    1. Note: You will see a placeholder appear in the Favorite Widgets Panel on the device you sent your widget to and within a few seconds the “plant-care” widget should appear in that location.
  2. A customer can install the same widget as many times as they like, generating a different instanceId each time. For the purposes of this demo, install multiple instances of the widget using the Send to Device button. You can choose to do it on the same device or on different devices. 


Test Data Store Push

  1. On one of the widget instances, press the "I watered my plant" button. If the button gets disabled on other widget instances and updates with the text "Plant already watered", everything is working as expected. 

Congratulations! You Now Have a Functioning Widget.

As a next step, we encourage you to take a look at the backend code (visible from the “Code” section of the Developer Console). The sample you’ve just imported demonstrates how to handle the most common events in a widget’s lifecycle including:

  1. UsagesInstalled - The event sent when a widget is installed by a user.
  2. UsagesRemoved - The event sent when a widget is removed by a user.
  3. UpdateRequest - The event sent when Alexa updates your widget on a user's device.

All of these concepts (and more) are covered in our technical documentation so be sure to reference that as well. As always, thank you for your interest in Alexa. We are excited to see what you build!

Recommended Reading

How Nick Schwab grew his Alexa skill from a hobby to a business with 5 employees
Grow your business on Alexa
Amazon product leader Sid Dube explains how skill builders can capitalize on the holiday season to grow revenue