@converseai/plugins-sdk

This library makes it easy to create your own plugins and modules for the Converse AI platform.

Stats

stars 🌟issues ⚠️updated 🛠created 🐣size 🏋️‍♀️
10Oct 17, 2018Jun 20, 2017Minified + gzip package size for @converseai/plugins-sdk in KB

Readme

Converse Plugins SDK

This library makes it easy to create your own plugins and modules for the Converse AI platform

Setup Instructions

Converse Plugins SDK

  1. Import the appropriate class(es):
let ConversePluginsSDK    = require('@converseai/plugins-sdk');
  1. Create an http instance:
const app = new ConversePluginsSDK.http({request: request, response: response});

Example Using Express

Javascript

Below is a simple delay module that will delay the conversation.

delayTime is created via the module definition on the ConverseAI platform. If it's undefined then it will delay for 1 second.

const express = require('express')();
const Status  = require('@converseai/plugins-sdk').Status;

express.use(bodyParser.json());

var delayModule = function(app, body) {
  setTimeout(function() {
    app.send(Status.SUCCESS);
  }, body.payload.moduleParam.delayTime || 1000);
}

express.post('/', function (request, response) {
  var app = new ConversePluginsSDK.http({ request, response });

  app.setModules({
    delayModule: delayModule
  });

  app.handleRequest();
});

License

See LICENSE

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.