@zelo/sdk
v0.0.1
Published
Node/Bun SDK for talking to a running Zelo server.
Readme
@zelo/sdk
Node/Bun SDK for talking to a running Zelo server.
- Realtime streaming over WebSocket (
/ws) - REST helpers under
/api/v1/*
Install
bun add @zelo/sdkAuth
Provide a token via one of:
new ZeloClient({ token: "..." })ZELO_TOKEN=...~/.zelo/data/auth.json(configurable via~/.zelo/config.json)
Quickstart
import { ZeloClient } from "@zelo/sdk";
const client = new ZeloClient({ serverUrl: "ws://127.0.0.1:7384" });
const session = await client.sessions.create({ title: "Hello" });
const stream = client.messages.send(session.id, { content: "Say hi" });
for await (const ev of stream) {
if (ev.type === "text_delta") process.stdout.write(ev.delta);
}