Connection state.
Authorized user. Will be initialized on successful PChatSDK.connect.
Used for connecting to chat room server. On success will initialize PChatSDK.user and set PChatSDK.state to States.CONNECTED. Triggers Events.CONNECT on success.
Room id
Username
JWT access token from CAS
Optional options: { Optional connection settings
Optional role?: stringOptional role to claim for this user
Used for creating a poll. Triggers Events.POLL on success.
The question of the poll
The options of the poll
Optional scheduledDate: DateThe date when the poll should be published
Used for soft deleting a message. Triggers Events.MESSAGE_DELETE on success.
Message identifier to delete
Disconnects from chat server and sets PChatSDK.state to States.DISCONNECTED. Triggers Events.DISCONNECT.
Used for finishing a poll. Triggers Events.POLL on success.
Used for getting reaction stats. Triggers Events.REACTIONS_STATS on success.
Used for loading older chat room's history. Consecutive calls will be handled in a queue. Triggers Events.HISTORY_LOAD on success.
Optional timestamp: stringTimestamp to load messages before, by default oldest message's timestamp is used
Removes all listeners.
Removes all listeners for event.
Removes all listeners for events.
Removes specific listener for event.
Removes specific listener for multiple events.
Used for sending a message to the chat room. Triggers Events.MESSAGE on success.
Message content
Used for sending a reaction to the chat room. Triggers Events.REACTION on success.
Used for voting on a poll
List of all messages sorted from oldest to most recent.