Constructs a new ChatRoom instance.
Local room identifier, defaults to randomly generated UUID string.
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.
Logger used by the room. Defaults to ConsoleLogger.
Number of times the room will automatically retry WebSocket connection in case of connection failures.
Returns the connection state of the room.
Sets up a function that will be called whenever the specified event is delivered.
A function that removes the event listener
One of supported event types
Name of the event
Function called whenever the specified event is delivered
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.
Sends a delete message request to the room.
Promise that resolves to a DeleteMessageEvent or rejects with a ChatError
Error Thrown if the request cannot be serialized.
Error Thrown if the room is not connected.
Error Thrown if a request with the same requestId is already submitted.
Identifies a message to be deleted along with an optional reason for deletion.
Initiates a graceful disconnection of the Web Socket. Results in calling the
disconnect
event with disconnectReason
parameter set to
'clientDisconnect'
.
Sends a disconnect user request to the room.
Promise that resolves to a disconnect user event or rejects with a chat error
Error Throws if the request cannot be serialized.
Error Throws if the room is not connected.
Error Thrown if a request with the same requestId is already submitted.
Identifies the user to be disconnected along with an optional reason for disconnection.
Removes the event listener for the specified event.
Sends a message request to the room to the room.
Promise that resolves to a ChatMessage or rejects with a ChatError
Error Thrown if the request cannot be serialized.
Error Thrown if the room is not connected.
Error Thrown if a request with the same requestId is already submitted.
Contains a message and related metadata to be sent
Generated using TypeDoc
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.