socketMode: true connects to the emulator and receives events, button clicks, modal submissions, and slash commands over the socket. See Slack Socket Mode for the protocol details. The Discord Gateway is the second: discord.js, @discordjs/ws, and other Discord libraries connect to the URL GET /api/v10/gateway/bot returns, identify with intents, and receive guild, message, and interaction events, resuming after a disconnect.
Install
Nothing to install. The Slack and Discord providers ship the WebSocket kit inside them, sonpx @deploybaseline/cli start serves Socket Mode and the Gateway as it is. Each provider runs in its own process and owns its port, so a WebSocket connects straight to the provider, with nothing in between.
Where it runs
A handshake that reaches a handler which cannot upgrade the connection, such as a plain fetch call into the app, gets HTTP 501 with this body:
The kit
Built-in providers serve WebSocket endpoints with core’sapp.upgrade(path, handler) and the helpers in @deploybaseline/ws:
webSocketRoute(app, path, { authorize, onConnection })checks the handshake (return metadata, or an HTTP status such as 401 to refuse it), accepts it, tracks the connection, pings it, and closes it when the service stops.ConnectionRegistrylists open connections with message counts, broadcasts to a filtered set, reports changes, and closes everything withcloseAll().startHeartbeat(socket, { intervalMs, maxMissed })pings on an interval and drops a client that stops answering.ResumeBufferkeeps the last events of a session, numbered from 1, so a client that reconnects with the last number it saw can get what it missed.
@deploybaseline/testing has a client for tests that needs no extra dependency. It uses Node’s built-in WebSocket:
WS /path, next to HTTP routes, and the runtime coverage gate records a hit for each accepted handshake.
Other transports
Baseline speaks HTTP, GraphQL, and WebSockets. gRPC is not supported, and no gRPC work is planned until a provider meets this bar: its official Node SDK has no REST fallback, and the vendor ships no official local emulator. Today no candidate does. Firestore’s SDK acceptspreferRest: true, and Google ships local emulators for Firestore and Pub/Sub.