@brenox/sdk
v0.1.3
Published
TypeScript SDK for the Brenox realtime communication platform
Readme
@brenox/sdk
Official TypeScript SDK for Brenox — realtime messaging, presence, notifications, attachments, and WebRTC signaling.
- Documentation: www.breno-x.com/docs
- Requires: Node 18+ · browsers · bundlers
Install
# npm
npm install @brenox/sdk
# pnpm
pnpm add @brenox/sdk
# yarn
yarn add @brenox/sdkQuick start
Create an app and API key in the developer console, then:
import { BrenoxClient, localStorageTokenStore } from "@brenox/sdk";
const client = new BrenoxClient({
baseUrl: process.env.BRENOX_API_URL ?? "https://api.breno-x.com",
tokenStore: localStorageTokenStore(),
});
await client.auth.login({ email: "[email protected]", password: "secret" });
const [workspace] = await client.workspaces.list();
const channel = await client.channels.create(workspace.id, { name: "general" });
await client.messages.send(workspace.id, channel.ID, { content: "Hello!" });Realtime channel
const conn = client.channel(workspace.id, channel.ID, {
origin: typeof window !== "undefined" ? window.location.origin : "http://localhost:3000",
});
conn.on("message.new", (event) => console.log(event.payload.content));
await conn.connect();
conn.sendMessage("Hello realtime!");Exports
| Import | Client | Use case |
|--------|--------|----------|
| @brenox/sdk | BrenoxClient | User-facing apps (browser, mobile, Node) |
| @brenox/sdk/server | BrenoxServer | Trusted backends with API keys (bx_test_* / bx_live_*) |
BrenoxClient covers auth, workspaces, channels, messages (REST + WebSocket), typing, presence, notifications, attachments, and call signaling.
BrenoxServer covers user provisioning, sessions (embed JWT handoff), channels, and server-sent messages. See the server integration guide.
React
For hooks (BrenoxProvider, useMessages, useNotifications, useCallSignaling):
# npm
npm install @brenox/react @brenox/sdk react
# pnpm
pnpm add @brenox/react @brenox/sdk react
# yarn
yarn add @brenox/react @brenox/sdk reactDocs: @brenox/react on npm · React SDK guide
Links
Development
npm ci
npm run build:all
npm test
npm run test:integration # requires Brenox API on localhost:8080