Skip to main content
Version: Next

Interface: WebSocket

WebSocket configuration.

See Web Sockets for handler shape and client-side usage.

Properties

autoConnect?

optional autoConnect?: boolean

If true (the default), the client connects to the WebSocket server as soon as the app loads. Set to false to connect manually via useSocket.

Default

true

fn

fn: Reference<AnyFunction>

Function that registers Socket.IO event handlers. Wasp calls it once on server start with the Socket.IO server instance and a context containing all app entities. If a connected socket is authenticated, Wasp stores the user on socket.data.user.