Loading Messages
useLiveChatMessages fetches paginated messages for a conversation. Messages are stored in Redux and kept in sync by the ChatProvider socket.
useChatMessages was renamed to useLiveChatMessages. The old name still works as a deprecated alias.loadOlder fetches messages older than the oldest currently loaded.
To include attached files in the response, pass includeFiles: true:
useLiveChatMessages.
Filtered / read-only queries
useLiveChatMessages is the live conversation stream and intentionally takes no filters. To fetch a filtered or read-only list of messages — for example, only messages that have replies — use useFetchManyChatMessagesWrapper, which keeps results in local state and never receives live socket traffic:
useFetchManyChatMessages.
Sending Messages
useSendMessage returns an async function that sends a message and performs an optimistic insert — the message appears immediately in the UI with a temporary ID, then the temporary entry is replaced by the server-confirmed message.
Message Content Options
useSendMessage accepts a rich set of parameters:
Sending with Files
Whenfiles is provided, the hook automatically switches to a multipart form upload:
useSendMessage.
Editing Messages
useEditMessage returns a function that takes conversationId, messageId, and updated content fields. The Redux store is updated immediately on success.
useEditMessage.
Deleting Messages
useDeleteMessage performs a soft delete. The message is removed from the local Redux store immediately; on the server, it is soft-deleted (content cleared, userDeletedAt set).
useDeleteMessage.
Reactions
useToggleReaction adds or removes an emoji reaction on a message. The response includes updated reactionCounts and userReactions:
useToggleReaction.
Next Steps
Real-time
Typing indicators, unread counts, and read receipts
Threads
Threaded replies on messages

