Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
Open-source example wiring AnyCable-Go WebSockets into a Next.js app on Vercel for serverless real-time messaging and JWT-authenticated clients.

An eve template for Slack agents with webhook handling, Vercel Connect credential management, a starter agent, and an example tool.

Next.js example that wires GrowthBook feature flags and experiments into the Flags SDK with the @flags-sdk/growthbook adapter.

Next.js example that streams structured object generation to the client using the Vercel AI SDK useObject hook.

Vercel-maintained HTML5 starter template preloaded with Vercel Analytics and Edge Middleware routing.
AnyCable Next.js/Vercel Example is a demonstration repository that connects an AnyCable-Go WebSocket server to a Next.js application hosted on Vercel, so serverless route handlers can broadcast real-time messages to connected browser clients.
AnyCable Next.js/Vercel Example is an open-source GitHub repository (anycable/vercel-anycable-demo) showing how to run real-time features inside a serverless Next.js app. The Next.js side supplies a route handler at /api/anycable that acts as the AnyCable RPC endpoint, and the browser client connects over a WebSocket URL supplied by the CABLE_URL variable. The output is a deployable real-time demo that can be cloned to Vercel with one click and paired with a separate AnyCable-Go process. It is published by the AnyCable project and points to the official serverless JavaScript guide in the AnyCable docs.
/api/anycable.anycable/anycable-go:1.4, deployed on any platform and recommended on Fly.io.vercel-anycable-demo and prompts for CABLE_URL, ANYCABLE_HTTP_BROADCAST_URL, ANYCABLE_HTTP_BROADCAST_SECRET, and ANYCABLE_JWT_ID_KEY during setup.ANYCABLE_JWT_ID_KEY variable holds the key.ANYCABLE_HTTP_BROADCAST_SECRET value.fly.toml.example file documents recommended settings, and the provided fly launch command uses --internal-port 8080, --ha=false, and ANYCABLE_BROKER=memory.cat .env.production | fly secrets import on Fly, or pulled with vercel env pull locally.pnpm install, pnpm anycable-go, and pnpm dev start the stack on local port 3000.CABLE_URL, ANYCABLE_HTTP_BROADCAST_URL, ANYCABLE_HTTP_BROADCAST_SECRET, and ANYCABLE_JWT_ID_KEY on the Vercel app.ANYCABLE_RPC_HOST to the Vercel app's /api/anycable endpoint, plus the same broadcast secret and JWT key, on the AnyCable-Go server.The example repository is open source and free to clone, and AnyCable-Go runs as a self-hosted Docker image; the only costs come from whatever hosting you choose for the Next.js app (Vercel) and the real-time server (for example Fly.io).
It demonstrates the full path between a Next.js app on Vercel and an AnyCable-Go WebSocket server: the app exposes an RPC endpoint at /api/anycable, broadcasts outgoing messages over HTTP, and authenticates connecting clients with AnyCable JWT identification.
Yes. The Next.js app on Vercel cannot host the WebSocket connection itself, so an AnyCable-Go server must run somewhere else. The docs recommend Fly.io and ship a fly.toml.example with a working fly launch command, but AnyCable-Go can be deployed on any platform.
Yes, the repository is a public open-source example with no license fee, and AnyCable-Go is pulled as a Docker image. You still pay for the infrastructure you run it on, such as Vercel and Fly.io usage.
PNPM is required. Run pnpm install, start the real-time server with pnpm anycable-go, start the app with pnpm dev, then open local port 3000 in a browser.
CABLE_URL is the WebSocket address clients connect to, ANYCABLE_HTTP_BROADCAST_URL is the broadcast endpoint, ANYCABLE_HTTP_BROADCAST_SECRET is a shared secret for that endpoint, and ANYCABLE_JWT_ID_KEY signs and verifies client identification tokens; the secrets can be any string, such as one generated with openssl rand -hex 32.
