Skip to content

Koa middleware to handle Google Assistant action requests

License

Notifications You must be signed in to change notification settings

chyuibacca/koa-aog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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!');
});

About

Koa middleware to handle Google Assistant action requests

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published