@go-tubes/tubes-js
v0.1.0
Published
Client library for tubes
Downloads
252
Readme
tubes-js is a JavaScript client library to connect to a tubes server. It provides a simple API to connect to WebSocket channels and send/receive messages.
Get Started
Install the package using your preferred package manager:
pnpm add @go-tubes/tubes-jsExample
import { TubesClient } from '@go-tubes/tubes-js';
// Initialize the client
const client = new TubesClient({ url: 'ws://localhost:8080', debugging: true });
// Connect to a channel
client.subscribe("test", console.log);
client.send("test", { payload: { foo: "bar" } })