FluxyChat

Getting Started

Client setup

Connect FluxyChat to React, vanilla JavaScript, React Native, or Flutter.

FluxyChat clients talk to your Worker URL with a member JWT (or project API key for server-side calls). Pick your platform:

pnpm add @fluxy-chat/sdk @fluxy-chat/react zustand
import { FluxyChatClient } from "@fluxy-chat/sdk";
import { FluxyRealtimeProvider, useChat } from "@fluxy-chat/react";

const client = new FluxyChatClient({
  baseUrl: process.env.NEXT_PUBLIC_FLUXYCHAT_WORKER_URL!,
  userId: "alice",
  token: memberJwt,
});

function App() {
  return (
    <FluxyRealtimeProvider workerUrl={process.env.NEXT_PUBLIC_FLUXYCHAT_WORKER_URL!}>
      <Room roomId="general" />
    </FluxyRealtimeProvider>
  );
}

function Room({ roomId }: { roomId: string }) {
  const { messages, sendMessage, connectionState } = useChat({ roomId, client });
  // render messages…
}

See @fluxy-chat/react and useChat.

Auth

Mint member JWTs from your backend — never embed signing secrets in client bundles. See Auth JWT.

Common errors

ErrorFix
401 UnauthorizedToken expired or wrong signing key — mint a fresh JWT
not a memberAdd the user to the room via REST or dashboard
WebSocket blockedCheck CORS / custom domain; try HTTP long-poll fallback

More: Troubleshooting.

On this page