Skip to content

Latest commit

 

History

History
52 lines (42 loc) · 824 Bytes

README.md

File metadata and controls

52 lines (42 loc) · 824 Bytes

Botkit socket client

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

Usage

Install

npm i --save botkit-socket-client

Import the library

 <script src="../dist/prod/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