This package has been deprecated

Author message:

Please use actions-on-google version 2.0, it supports AWS Lambda out of the box now

actions-on-lambda

1.0.3 • Public • Published

Actions on Google fulfillment on AWS Lambda

This library enables you to easily setup a AWS Lambda function that handles requests from Google Actions using the actions-on-google version 1 NodeJS SDK.

If you want to use AWS Lambda for Google Actions using actions-on-google version 2 (which is the current version supported by Dialogflow), actions-on-google supports that out of the box.

Installation

Initial setup:

$ npm add actions-on-lambda

Example

const { DialogflowApp } = require('actions-on-google');
const actionsOnLambda = require('actions-on-lambda');
 
function mainIntent (app) {
    app.ask("Welcome to the Example App");
};
 
function responseHandler (app) {
    switch (app.getIntent()) {
        case "input.welcome":
            mainIntent(app);
            break;
 
        default:
            mainIntent(app);
            break;
    }
}
 
exports.handler = function (event, context) {
    actionsOnLambda(event, context, (request, response) => {
        let dialogflowApp = new DialogflowApp({ request, response });
        dialogflowApp.handleRequest(responseHandler);
    });
};
 

Package Sidebar

Install

npm i actions-on-lambda

Weekly Downloads

1

Version

1.0.3

License

MIT

Unpacked Size

4.12 kB

Total Files

4

Last publish

Collaborators

  • mikegillis677