Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mabuonomo/botkit-socket-client
A small botkit (web) socket client library, written in typescript, for browser
https://github.com/mabuonomo/botkit-socket-client
botkit websocket
Last synced: 2 days ago
JSON representation
A small botkit (web) socket client library, written in typescript, for browser
- Host: GitHub
- URL: https://github.com/mabuonomo/botkit-socket-client
- Owner: mabuonomo
- Created: 2020-01-18T22:10:38.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-05-07T19:16:27.000Z (over 1 year ago)
- Last Synced: 2024-10-13T15:13:30.835Z (about 1 month ago)
- Topics: botkit, websocket
- Language: TypeScript
- Homepage:
- Size: 1.39 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Botkit socket client
A small botkit (https://botkit.ai/) socket client library written in typescript
## Usage
Install
```sh
npm i --save botkit-socket-client
```Import the library
```html
```Create a client and send a message
```js
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:
```ts
client.getSocket().addEventListener(ListenerEvent.OPEN, (event) => {
console.log('event received!');
// ...
});
```## Are you a dev? You are welcome!
Initialize the project
```sh
make install
```Build in dev mode
```sh
make build-prod
```Build in prod mode
```sh
make watch-dev
```