Amazon Alexa

Integration published by Jovo | 13,496 downloads

Build apps for Amazon's Alexa assistant platform

Amazon Alexa Platform Integration

Learn more about Alexa specific features that can be used with the Jovo Framework.

Introduction

Installation

Import the installed module, initialize and add it to the app object:

Quickstart

Install the Jovo CLI

We highly recommend using the Jovo CLI if you want to benefit from all the features coming with Jovo. You can learn more and find alternatives on our installation page.

Create a new Jovo Project

You can create a Jovo project into a new directory with the following command:

This will create a new folder, download the Jovo "Hello World" template, and install all the necessary dependencies so you can get started right away.

This is how a typical Jovo project looks like:

Find out more about the Jovo project structure here.

Run and Test the Code

To test the logic of your code, you can use the local development server provided by Jovo, and the Jovo Debugger.

To get started, use the following command:

This will start the development server on port 3000 and create a Jovo Webhook URL that can be used for local development. Copy this link and open it in your browser to use the Jovo Debugger.

Jovo Debugger

In the Debugger, you can quickly test if the flow of your voice app works. For this example, click on the LAUNCH button, and then specify a name on the MyNameIsIntent button. The Debugger will create requests and run them against your local webhook.

Find out more about requests and responses here.

Configuration

Using the project.js in your project directory, you can configure your skill specifically for your needs. Using stages, you can also utilize different configurations for different environments.

The following elements can be added to the alexaSkill object:

In the deployment process with the Jovo CLI (jovo deploy), skillId and askProfile are by default taken from the existing config in the /platforms/alexaSkill/.ask folder. Specifying those in the project.js to override the existing platform files is especially useful if you have different versions of the Alexa Skill in separate developer accounts (see Stages).

skill.json Overrides

You can also add information to go into the skill.json. You can basically add or override any element that you can find in the skill manifest:

To add an object, make sure to add the same path it has in the skill.json. The below example (from our Alexa Audioplayer Template) adds the Audioplayer Directive to the Alexa Skill:

$alexaSkill Object

The $alexaSkill object holds references to every Alexa-specific feature:

Jovo Language Model

For a general understanding of the Jovo Language Model, check out the platform-independent docs

When using the Jovo Language Model you can add an alexa object to each intent. In there you can define the intent name for Alexa specifically:

But, that way, the AMAZON.NextIntent would still be extended using the utterances in the phrases array. To specify Alexa-specific utterances you can add a samples array as well. If you keep the array empty, the intent won't be extended at all:

When using slots in your intents, you can define platform-specific slot types:

Last but not least, you can add an alexa object at the root of the Jovo Language Model which has the same syntax as the original Alexa interaction model. Both the platform-independent Jovo Language Model and the alexa part will be merged when building:

Dynamic Entities

If you want to augment your existing entities depending on a dynamic change in data or context, you can use Dynamic Entities to dynamically create new entities during your session. These will be resolved in addition to your static slot values and are valid for a total time of 30 minutes, even after the user session has ended, although we recommend to clear every dynamic entity as soon as the session ends.

Here is the official reference by Amazon: Dynamic Entities.

Permissions and Data

There are a lot of Alexa specific permissions and data that a Skill can use, such as:

  • Location
  • Contact Information
  • Lists
  • Reminders
  • Settings
  • Skill Events

You can find more about Alexa Permissions and Data here.

Alexa Skill Interfaces

Learn more about the different Alexa Skill Interface types here: Alexa Skill Interfaces.

Monetization

Amazon Pay

Learn how to sell physical goods and services in your Alexa Skills using Amazon Pay and Jovo. Find out more here: Amazon Pay Docs.

In-Skill-Purchasing (ISP)

Learn how to sell digital goods in your Alexa Skills using Alexa In-Skill Purchases (ISPs). Find out more here: Alexa ISP Docs.

Progressive Responses

For responses that require long processing times, you can use progressive responses to tell your users that you are currently working on fulfilling their request.

Here is the official reference by Amazon: Send the User a Progressive Response.

Find an example file here: appProgressiveResponse.js.

Amazon Alexa Changelog

Jovo Marketplace | GitHub | npm

Current version might be higher than the latest changes displayed below because of updates of dependencies.

2021-10-27 [3.5.5]

2021-02-22 [3.5]

  • #901 Move setResponse from response to after.response middleware (@aswetlow)
  • #901 Route Alexa.Presentation.APLA.RuntimeError requests to ON_ERROR (@aswetlow)

2020-11-10 [3.2.1]

2020-08-21 [3.0.30]

3.0.17 (2020-05-13)

🐛 Bug fix

  • jovo-platform-alexa Fix http status in ReminderAPI

Committers: 1

3.0.13 (2020-05-04)

💅 Enhancements

  • jovo-platform-alexa #734 Add getPermissionIsCardThrown (@rmtuckerphx)
  • jovo-platform-alexa Add types for skill event body objects

Committers: 2

3.0.11 (2020-04-06)

  • Updated Typescript to 3.8.x
  • Updated Prettier to 2.x

Committers: 2

2.x

Find the 2.x changelog here.

Join Our Newsletter

Be the first to get our free tutorials, courses, and other resources for voice app developers.