Nullifying Precipitation Machine

npm

Need private packages and team management tools?Check out npm Orgs. »

koa-aog

0.0.2 • Public • Published

koa-aog

Koa middleware to handle Google Assistant action requests.

Supports execution of Actions On Google DialogFlow and ActionsSdk fulfillment.

Installation

Install the koa-aog package from NPM:

npm install --save koa-aog

Usage

To use the middleware, add it to a Koa server as follows:

const Koa = require('koa');
const KoaBody = require('koa-body');
const KoaActionsOnGoogle = require('koa-aog');
let action = require('./action'); //The Google action implementation
 
const app = new Koa();
 
app.use(KoaBody());
 
app.use(KoaActionsOnGoogle({ action: action }));
 
app.listen(3000);

The action must be an instance of an Actions On Google fulfillment. For example, a simple action.js may look like:

const { dialogflow } = require('actions-on-google');
 
const app = dialogflow({ debug: true });
 
app.intent('Call API', async (conv, input) => {
    conv.ask('You need to add action code!');
});

install

npm i koa-aog

Downloadsweekly downloads

8

version

0.0.2

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability