amazon-echo-onlaunch
v1.0.0
Published
A simple, no-dependency bootstrapping tool for quickly creating Amazon Alexa Skills in Node.js
Downloads
2
Maintainers
Readme
amazon-echo-onlaunch
A simple, no-dependency bootstrapping tool for quickly creating Amazon Alexa Skills in Node.js
Installation
$ npm i --save amazon-echo-onlaunch
Usage
In the index.js file of your Alexa Skill:
const Alexa = require('amazon-echo-onlaunch');
const myCustomOnLaunchFunc = require('./myCustomOnLaunchCode');
exports.handler = (event, context) => new Alexa(event, context, myCustomOnLaunchFunc);
In your custom code file:
function myCustomOnLaunchFunc(callback) {
callback('The custom string you want Alexa to say');
}
module.exports = myCustomOnLaunchFunc;
Limitations
The function you pass into the Alexa constructor must take a callback as an argument and invoke that callback with a string.
This package currently only supports simple "call-and-response" interactions with Alexa. For more advanced interactions that require persisting state or managing authentication, see Amazon's official documentation.