Skip to main content

Bun runtime for Vercel Functions now accepts Bun.serve as an entrypoint

By Steven Van ·

The Bun runtime for Vercel Functions now supports Bun.serve() as a function entrypoint, including WebSocket handlers.

Vercel's Bun runtime for Vercel Functions now accepts Bun.serve() directly as a function entrypoint, including WebSocket handlers, so a server run locally with Bun deploys as-is without being wrapped in a framework. It's enabled by setting "bunVersion": "1.x" in vercel.json, with a routes-based server defined in server.ts at the project root.

WebSocket connections run on Fluid compute with Active CPU pricing, so charges apply only for time spent processing messages, not idle connection time. A connection stays pinned to one function instance for its lifetime, and a single instance can handle multiple concurrent connections; coordinating messages across instances requires an external data store. Full details are in the announcement.

Vercel
Vercel
The platform for frontend developers — deploy, preview, and scale web apps and AI agents with zero config.
View Vercel →

Read the original announcement →

Read Bun runtime for Vercel Functions now accepts Bun.serve as an entrypoint on Creators Toolbox