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

    3

    Version

    0.0.2

    License

    MIT

    Unpacked Size

    15.1 kB

    Total Files

    7

    Last publish

    Collaborators

    • chyuibacca