FluxyChat

Packages

@fluxy-chat/agent

Server-side agent SDK for [FluxyChat](https://github.com/AlessandroFare/fluxychat): WebSocket bots, message streaming, `waitFor`, and optional AI provider helpe

Server-side agent SDK for FluxyChat: WebSocket bots, message streaming, waitFor, and optional AI provider helpers.

Use this package in Node.js, Cloudflare Workers, or any server runtime. For browser/React apps, use @fluxy-chat/sdk and @fluxy-chat/react.

Install

pnpm add @fluxy-chat/agent @fluxy-chat/sdk

Quick start

import { createFluxyAgent } from "@fluxy-chat/agent";

const agent = await createFluxyAgent({
  baseUrl: process.env.FLUXY_WORKER_URL!,
  id: "support-bot",
  apiKey: process.env.FLUXY_API_KEY!,
});

const room = await agent.join("support-general");

room.on("message", async (msg) => {
  if (msg.userId === agent.id) return;
  await room.reply(`You said: ${msg.content}`);
});

Features

AreaAPI
Bot lifecyclecreateFluxyAgent, FluxyAgent, FluxyRoom
Token mintingmintWorkerToken
Streaming repliesFluxyMessageStream, waitFor
AI providersAIProviderRegistry, retryAI, middleware helpers
Tool / HITL flowsRe-exports from SDK where shared

Configuration

VariablePurpose
baseUrlYour FluxyChat Worker URL
idStable bot user id
apiKeyProject API key (fc_…) for JWT minting — server-side only

Mint member JWTs with POST /auth/token and the X-Fluxy-Api-Key header, or use mintWorkerToken from this package.

License

MIT

On this page