Represents IVS chat room connection.

This is a high-level object representing connection to the IVS Chat room. It is responsible for managing chat connection, sending chat requests and receiving chat events.

Hierarchy

  • ChatRoom

Constructors

Properties

id: string

Local room identifier, defaults to randomly generated UUID string.

Remarks

The parameter is useful in case you want to differentiate between various room instances, e.g. for logging purposes, when you have more than one room connection at the same time.

logLevel: ChatLogLevel = 'debug'

Minimal log severity level for messages to be logged to logger.

Defaults to debug.

logger: ChatLogger = ...

Logger used by the room. Defaults to ConsoleLogger.

maxReconnectAttempts: number

Number of times the room will automatically retry WebSocket connection in case of connection failures.

Accessors

Methods

  • Initiates the process of connecting to the socket, using token provider passed to constructor. In case of failure, it will try to reconnect the number of times specified in maxReconnectAttempts, defaulting to 3 attempts.

    Returns void

  • Initiates a graceful disconnection of the Web Socket. Results in calling the disconnect event with disconnectReason parameter set to 'clientDisconnect'.

    Returns void

Generated using TypeDoc