Skip to content

Handle and Create Alexa Notifications in your Jovo skill with just two lines of code

Notifications You must be signed in to change notification settings

vaynermedia/jovo-plugin-alexa-notifications

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Alexa Notifications for the Jovo Framework

Jovo Plugin to handle Alexa Messages.

Usage

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>"
	}
}

Advanced Options

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));

License

MIT

About

Handle and Create Alexa Notifications in your Jovo skill with just two lines of code

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published