A small botkit (https://botkit.ai/) socket client library written in typescript
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!');
// ...
});
Initialize the project
make install
Build in dev mode
make build-prod
Build in prod mode
make watch-dev