Loading…
Guide
Ship the App Router on Vercel; run WebSocket rooms on Cloudflare Workers + Durable Objects. Ably and Pusher are not the only path.
Tutorials for “live app on Vercel” often assume Ably or Pusher because serverless functions are not a socket fleet. That is correct. The fix is not forcing WebSockets into Vercel alone; it is a dedicated realtime layer.
// app/api/fluxy/token/route.ts: mint JWT server-side
// app/room/[id]/room-chat.tsx: "use client" + useChat
import { FluxyChatClient } from "@fluxy-chat/sdk";
import { useChat } from "@fluxy-chat/react";
const client = new FluxyChatClient({
baseUrl: process.env.NEXT_PUBLIC_FLUXYCHAT_CLOUD_URL!,
userId,
token: memberJwtFromRouteHandler,
});FluxyChat packages the same stack: RoomDurableObject, D1 history, multi-tenant JWT, reconnect-aware SDK, and operator console. MIT self-host or hosted beta.
Topics: realtime chat next.js vercel · websocket backend vercel · ably alternative next.js · reconnecting connections chat
Canonical path: /guides/nextjs-vercel-realtime-chat