Vercel now supports generally available WebSockets in Functions, but a realtime application still needs a reconnect and state-recovery design. The capability removes a deployment obstacle; it does not turn a function into an indefinitely running server or guarantee delivery of missed messages.
The October 20 announcement moves the feature beyond public beta. This is distinct from connecting a browser to a provider’s realtime AI model: developers can serve their own bidirectional endpoints for application features.
What is available, and what must be enabled?
Vercel’s WebSocket documentation lists availability across plans and requires Fluid compute. Check the existing project’s configuration rather than assuming a recently published feature changed every older project automatically.
A connection stays with one instance while open, but a new connection may land elsewhere. The documented model therefore calls for an external store for shared rooms, presence and coordination.
My interpretation: this is useful for a narrow realtime feature attached to an existing application. It is not a reason to move every background job or durable workflow into a socket handler. Choose the mechanism around the work’s lifecycle, not the novelty of the transport.
Duration limits make recovery part of the feature
The current Functions limits list a 300-second default for Fluid Node.js, Bun and Python functions. Hobby’s maximum is 300 seconds. Pro and Enterprise have an 800-second generally available maximum; an extended 1,800-second option remains beta with runtime and configuration restrictions.
A connection can close at the function’s duration boundary. Treat that as a normal condition to design for, not an exceptional event discovered after launch.
For a collaborative screen, I would specify the recovery behavior before writing the first handler:
- Show whether the connection is active, reconnecting or unavailable.
- Re-establish authorization and subscriptions after reconnecting.
- Fetch an authoritative snapshot or resume from an application-defined event position.
- Reconcile local edits with the confirmed server state.
- Avoid submitting the same business action twice during retries.
Those are application recommendations, not automatic Vercel delivery guarantees. A socket becoming open again proves connectivity, not that a missed update or payment was recovered correctly.
Keep durable state outside the process
Imagine two people viewing a shared support queue. A reconnect that reaches a different instance should not create a second, contradictory queue simply because each process holds its own local array.
I would define a durable source of truth and treat the connection as a way to announce or retrieve changes. Decide which updates may be dropped, which require acknowledgement and how a client detects that it is behind. A dashboard counter and a booking confirmation should not share the same casual retry policy.
For a first pilot, the acceptance test should include a deliberate disconnect while an update is in flight. Verify the business outcome afterward rather than accepting a successful handshake as completion.
Check framework support and the full bill
The documentation includes framework-specific paths. For Next.js, the documented workaround uses upgradeWebSocket() from @vercel/functions version 3.10.0 or later. Socket.IO clients need the WebSocket transport selected rather than relying on their usual polling default.
The announcement says Active CPU pricing bills processing work. That does not mean every idle connection has zero cost. The limits page also describes provisioned-memory time, and WebSocket data remains subject to the relevant transfer charges.
For a cost test, I would measure concurrent connected users, messages per second, payload size and session length together. Include reconnect bursts and a quiet period with connections still open. A short demo with two users cannot establish the production bill.
Security belongs in the application contract
My production checklist would include authenticated upgrades, authorization for each room or subscription, origin validation, input validation, message-size budgets and abuse handling. A user losing permission should not retain access merely because an older connection remains open.
Test deployments while clients are connected, network loss, expired sessions, duplicate events and an unavailable state store. Decide how the interface communicates stale data. These checks are proposed engineering work, not claims that FindMilan has benchmarked your application.
For implementation support, see my website development services and Sociaxo workflow project. Compare this connection-oriented feature with the different lifecycle discussed in my Vercel Daemons guide.
Frequently asked questions
Are WebSockets generally available on Vercel?
Yes. The October 20 announcement confirms GA. Fluid compute is required, and the selected plan and runtime still matter.
Can a Vercel WebSocket stay open forever?
No. Build for connection closure, recovery and synchronization rather than indefinite execution.
Is an in-memory room enough for durable shared state?
No. Reconnected clients can reach another instance; use a shared external source of truth.
Are idle WebSocket connections completely free?
No blanket free-idle claim is justified. CPU processing, memory time and transfer are separate parts of the usage model.
Frequently asked questions
Are WebSockets generally available on Vercel?
Yes. Vercel announced general availability in Functions on October 20. Documentation lists all plans, with Fluid compute required. Plan and runtime limits still apply.
Can a Vercel WebSocket stay open forever?
No. Function duration limits still apply. The application needs a recovery design for a closed connection rather than treating the socket as a permanent server.
Is an in-memory room enough for durable shared state?
No. A reconnect can reach another instance. Use an external system for shared state and design explicit recovery and synchronization behavior.
Are idle WebSocket connections completely free?
Do not assume that. Active CPU pricing concerns CPU processing; function memory time and relevant data-transfer usage remain part of the cost model.
