JavaScript SDK ⁠-⁠ trackWs method

This method allows you to track individual websocket channels and the direction of message (incoming/outgoing).

trackWs: (channelName: string) => (msgType: string, data: string, dir: 'up' | 'down') => void
  • channelName: string: Name of the WS channel.

Returns a hook to apply to ws messages that takes msg type (or name), data and message direction (up/down === sent/received) as parameters.