Skip to content

A small botkit (web) socket client library, written in typescript, for browser

Notifications You must be signed in to change notification settings

mabuonomo/botkit-socket-client

Repository files navigation

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

About

A small botkit (web) socket client library, written in typescript, for browser

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published