npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@jovotech/output-alexa

v4.0.0-beta.8

Published

--- title: 'Alexa Output' excerpt: 'Learn more about Jovo output templates for Alexa.' --- # Alexa Output

Readme


title: 'Alexa Output' excerpt: 'Learn more about Jovo output templates for Alexa.'

Alexa Output

Learn more about output templates for Alexa.

Introduction

Jovo offers the ability to create structured output that is then translated into native platform responses.

This structured output is called output template. Its root properties are generic output elements that work across platforms. Learn more about how generic output is translated into an Alexa response below.

{
  message: `Hello world! What's your name?`,
  reprompt: 'Could you tell me your name?',
  listen: true,
}

You can also add platform-specific output to an output template. Learn more about Alexa output below.

{
  // ...
  platforms: {
    alexa: {
      // ...
    }
  }
}

Generic Output Elements

Generic output elements are in the root of the output template and work across platforms. Learn more in the Jovo Output docs.

Below, you can find a list of generic output elements that work with Alexa:

message

The generic message element is what Alexa is saying to the user:

{
  message: 'Hello world!',
}

Under the hood, Jovo translates the message into an outputSpeech object (see the official Alexa docs):

{
  "outputSpeech": {
    "type": "SSML",
    "ssml": "<speak>Hello world!</speak>"
  }
}

reprompt

The generic reprompt element is used to ask again if the user does not respond to a prompt after a few seconds:

{
  message: `Hello world! What's your name?`,
  reprompt: 'Could you tell me your name?',
}

Under the hood, Jovo translates the reprompt into an outputSpeech object (see the official Alexa docs) inside reprompt:

{
  "reprompt": {
    "outputSpeech": {
      "type": "SSML",
      "ssml": "<speak>Could you tell me your name?</speak>"
    }
  }
}

listen

The listen element determines if Alexa should keep the microphone open and wait for a user's response.

By default (if you don't specify it otherwise in the template), listen is set to true. If you want to close a session after a response, you need to set it to false:

{
  message: `Goodbye!`,
  listen: false,
}

Under the hood, Jovo translates listen: false to "shouldEndSession": true in the JSON response.

The listen element can also be used to add dynamic entities for Alexa. Learn more in the $entities documentation.

quickReplies

Alexa does not natively support quick replies. However, Jovo automatically turns the generic quickReplies element into buttons for APL:

{
  // ...
  quickReplies: [
    {
      text: 'Button A',
      intent: 'ButtonAIntent'
    }
  ]
}

For this to work, genericOutputToApl needs to be enabled in the Alexa output configuration.

For these buttons, you need to pass a target intent. When the button is clicked, the Jovo Router automatically maps this to the specified intent.

It's also possible to add entities:

{
  // ...
  quickReplies: [
    {
      text: 'Button A',
      intent: 'ButtonIntent',
      entities: {
        button: {
          value: 'a',
        }
      },
    }
  ]
}

card

Jovo automatically turns the generic card element into a detail screen for APL:

{
  // ...
  card: {
    title: 'Hello world!',
    content: 'Welcome to this new app built with Jovo.'
  },
}

For this to work, genericOutputToApl needs to be enabled in the Alexa output configuration.

Note: If you want to send a home card to the Alexa mobile app instead, we recommend using the nativeResponse property.

carousel

Alexa does not natively support carousels. However, Jovo automatically turns the generic carousel element into a card slider for APL:

{
  // ...
  carousel: {
    items: [
      {
        title: 'Element 1',
        content: 'To my right, you will see element 2.'
      },
      {
        title: 'Element 2',
        content: 'Hi there!'
      }
    ]
  },
}

For this to work, genericOutputToApl needs to be enabled in the Alexa output configuration.

You can make it clickable by adding a selection object. Once an element is selected by the user, the Jovo Router will automatically map the request to the provided intent (and potentially entities):

{
  // ...
  carousel: {
    items: [
      {
        title: 'Element A',
        content: 'To my right, you will see element B.',
        selection: {
          intent: 'ElementIntent',
          entities: {
            element: {
              value: 'A',
            },
          },
        },
      },
      {
        title: 'Element B',
        content: 'Hi there!',
        selection: {
          intent: 'ElementIntent',
          entities: {
            element: {
              value: 'B',
            },
          },
        },
      }
    ]
  },
}

In the example above, a tap on an element triggers the ElementIntent and contains an entity of the name element.

Alexa Output Elements

It is possible to add platform-specific output elements to an output template. Learn more in the Jovo output documentation.

For Alexa, you can add output elements inside an alexa object:

{
  // ...
  platforms: {
    alexa: {
      // ...
    }
  }
}

Native Response

The nativeResponse property allows you to add native elements exactly how they would be added to the Alexa JSON response.

{
  // ...
  platforms: {
    alexa: {
      nativeResponse: {
        // ...
      }
    }
  }
}

For example, an APL RenderDocument directive (see official Alexa docs) could be added like this:

{
  // ...
  platforms: {
    alexa: {
      nativeResponse: {
        response: {
          directives: [
            {
              type: 'Alexa.Presentation.APL.RenderDocument',
              token: 'helloworldToken',
              document: { /* ... */ },
              datasources: { /* ... */ },
            }
          ]
        }
      }
    }
  }
}

Learn more about the response format in the official Alexa documentation.

Alexa Output Configuration

This is the default output configuration for Alexa:

const app = new App({
  // ...

  plugins: [
    new AlexaPlatform({
      output: {
        genericOutputToApl: true,
      },
    }),
  ],
});

It includes the following properties:

  • genericOutputToApl: Determines if generic output like quickReplies, card, and carousel should automatically be converted into an APL directive.