Function connectWebSocket
- connectWebSocket(userId: string | string[], onUpdate: ((data: Data) => void)): Promise<WebSocket>
-
Parameters
-
userId: string | string[]
-
onUpdate: ((data: Data) => void)
-
- (data: Data): void
-
Returns void
Returns Promise<WebSocket>
Connects to the Lanyard WebSocket API
Returns
The WebSocket connection
Throws
Error if the browser doesn't support WebSocket connections
Throws
Error if the WebSocket connection is closed