Skip to main content

Socket types and context

The socket subpath exports SocketContext, SocketContextType, and SocketLogPayload.

TypePurpose
SocketContextTypeThe current Socket.IO instance, when connected, and isConnected.
SocketLogPayloadServer log event with message and level (info, warn, or error).

SocketProvider accepts optional connect, disconnect, error, ping, and log callbacks. Its internal props type is not separately exported from the package.

Use useSocket for normal consumption. SocketContext is exported for advanced integrations, but direct context access couples a component to the provider shape.