Core SDK
Core SDK
FluxyChatClient, React hooks, and room session helpers.
One room WebSocket. Install:
npm install @fluxy-chat/sdk @fluxy-chat/react @fluxy-chat/ui zustandReact 18+, zustand 5+. Yjs editors also need yjs and @fluxy-chat/sdk/yjs.
@fluxy-chat/sdk
Client, REST, createFluxyRoomSession, verticals.
@fluxy-chat/react
FluxyRealtimeProvider, hooks.
@fluxy-chat/ui
Cursors, Thread, AiChat, AvatarStack.
Read Concepts before mixing primitives.
Provider (required for hooks)
import { FluxyRealtimeProvider, useChat } from "@fluxy-chat/react";
<FluxyRealtimeProvider
workerUrl={workerUrl}
authTokenProvider={memberJwt}
userId={userId}
>
<Room />
</FluxyRealtimeProvider>FluxyYjsProvider takes token, not authTokenProvider. Do not pass token= to FluxyRealtimeProvider.
Topics
| Guide | Primitive |
|---|---|
| useChat | Chat timeline, agents, most room APIs |
| Presence & typing | Now (cursors, selections) |
| Broadcast | Pulse (sendClientEvent) |
| Storage | Yjs document, Tiptap, whiteboard |
| Comments | Contextual pins |
| Chat reply threads | parentId lens |
| Feeds | Activity logs |
| Copilots | Side-panel AI |
| AI collaboration | Workflows → feeds |
| Agents | invokeAgent |
| Inbox | Mentions, unread, thread/comment |
| Notifications | Push + email digest |
| Connection state | WS / SSE / poll |
| Voice | Clips + stage signaling |
Minimal client (no React)
import { FluxyChatClient } from "@fluxy-chat/sdk";
const client = new FluxyChatClient({
baseUrl: "https://your-worker.workers.dev",
userId: "alice",
token: memberJwt,
});
await client.sendMessage("general", "Hello!");