botkit-socket-client

0.0.4 • Public • Published

WIP: Botkit socket client

A small botkit (https://botkit.ai/) socket client library written in typescript

Usage

Import the library

 <script src="../dist/dev/botkit.js"></script> 

Create a client and send a message

const config = {
    ws_url: "ws://localhost:3000",
    reconnect_timeout: 3000,
    max_reconnect: 5,
    enable_history: false
}
 
let client = new Botkit.BotKitClient(config);
client.send("Demo sender")

add an event listener:

client.getSocket().addEventListener(ListenerEvent.OPEN, (event) => {
    console.log('event received!');
    // ...
});

Are you a dev? You are welcome!

Initialize the project

make install

Build in dev mode

make build-prod

Build in prod mode

make watch-dev

Readme

Keywords

none

Package Sidebar

Install

npm i botkit-socket-client

Weekly Downloads

0

Version

0.0.4

License

MIT

Unpacked Size

20.7 kB

Total Files

16

Last publish

Collaborators

  • mabuonomo