0.0.4 • Published 4 years ago

botkit-socket-client v0.0.4

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

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