Users

The Users model type is used to store all chat users.

NameData typeDescription
byId{ [userId: string]: User }A map of all fetched users by ID
fetchingbooleanTrue if currently fetching users
currentIUserThe current logged in chat user

User

The User model type defines a single instance of a user

NameData typeDescription
idstringThe unique user id
usernamestringUser’s username
display_namestring|undefinedUser’s display name
descriptionstring|undefinedUser’s bio and/or details
created_atDateThe date the user was created
updated_atDateThe date the user was last updated
imagestring|undefinedURL or base64 encoded string of the user’s avatar
last_seenDateThe last time a user was active
statusOnlineStatusThe current status of the user

Chats

The Chats model type is used to store all the chats: DMs and Channels

NameData typeDescription
byId{ [chatId: string]: Chat }A map of all fetched chats by ID
fetchingbooleanTrue if currently fetching chats

Chat

The Chat model type is used to define a specific chat, whether DM or channel

NameData typeDescription
idstringThe unique chat id
created_atDateThe date the chat was created
updated_atDateThe date the chat was last updated
membersMember[]A list of members that belong to the chat
kindChatTypeThe type of chat
namestring|undefinedThe name of chat
descriptionstring|undefinedThe description of chat
imagestring|undefinedURL or base64 encoded string of the chat
_privateboolean

True if a private chat. If false, any user can join the channel.

last_messageMessage|undefinedThe last sent message of the chat
joiningboolean|undefinedTrue if current user is in the process of joining the chat
unread_countnumberThe number of unread messages by the user of this chat
users_typingUser[]The users that are currently typing
messagesMessageListList of messages
outgoingMessage[]|undefinedMessages that are currently being sent
invitesUser[]|undefined

Users that have been invited to the channel, but not yet joined

Messages

The Messages model type is used to store all the messages

NameData typeDescription
byId{ [chatId: string]: Message }A map of all fetched messages by ID
fetchingbooleanTrue if currently fetching messages

Message

The Message model type is used to define a specific message

NameData typeDescription
idstringThe unique message id
created_atDateThe date the message was created
updated_atDateThe date the message was last updated
textstring|undefinedThe textual portion of the message
userUserThe sender
parent_idstring|undefined

The id of the parent message in the event this message is within a thread

chat_idstringId of the chat
repliesMessage[]|undefinedThe array of replies to this message
reply_countnumberNumber of replies
reactionsstring[]|undefinedMessage reactions and the users they belong to
attachmentsAttachment[]|undefinedThe attachments sent with the message
mentionsMention[]|undefinedThe message mentions
statusstring|undefinedsending or sent
favoritebooleanTrue if current user marked as favorite
systemSystemMessageType|undefinedSystem message type