Jovo Plugin to handle Alexa Messages.
First, be sure your Alexa skill's permissions includes notifications.
Then, add the plugin:
const { App } = require('jovo-framework');
const AlexaNotifications = require('jovo-plugin-alexa-notifications');
const app = new App();
app.register(new AlexaNotifications());
When formatting your outbound message, this Jovo Plugin expects two key-value pairs on your message's data
object: a displayInfo
object and a spokenInfo
object. Consider the below example data
object:
{
"displayInfo": {
"locale": "en-US",
"toast": {
"primaryText": "Pizza Party Order Update"
},
"title": "Pizzas Are On Their Way",
"bodyItems": [{
"primaryText": "Your pizzas are baked, boxed and inbound to your door! Estimated delivery is 10 minutes."
}]
},
"spokenInfo": {
"locale": "en-US",
"ssml": "<ssml><p>This is your Pizza Party coordinator, letting you know that your pizzas are baked, boxed and inbound to your door. Estimated delivery is 10 minutes.</p></ssml>"
}
}
The default expiration time is 60 seconds, but you can manually set this using the options
object:
const options = { expiresAfterSeconds: 120 }
app.register(new AlexaNotifications(options));
MIT