Function connectWebSocket

  • 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

    Parameters

    • userId: string | string[]

      The user ID to connect to

    • onUpdate: ((data: Data) => void)

      Callback function that is called when the user's presence is updated

        • (data: Data): void
        • Parameters

          Returns void

    Returns Promise<WebSocket>

Generated using TypeDoc