Overview
Returns an async function that sends a message to a conversation. An optimistic entry is inserted into Redux immediately — with a temporary ID — and replaced by the server-confirmed message on success. If the request fails, the optimistic message is flagged withsendFailed: true.
Requires
ChatProvider in the component tree.Usage Example
Props
Parameters
The hook returns a function. That function accepts:Images on the message, processed into sizes per
options (mode is required); each comes back with image and its variants. Each file is a File or Blob, or a React Native file { uri, name, type? }. A request takes at most 20 files in all. When provided, the request is sent as multipart/form-data. Requires the files-images bundle.Files on the message, stored as uploaded (
image is null, an image sent here included). When provided, the request is sent as multipart/form-data. Requires the files-images bundle.Returns
The server-confirmed ChatMessage, without
reactionCounts, userReactions and grants (a new message has none), and with localId echoed back. When spaceReputation is requested, its embedded sender carries an added spaceReputation number. See Reputation.Notes
- A message needs at least one of
content,gif,imagesorfiles; otherwise the server refuses it with400 chat/empty-message. - For integration guidance, see Chat: Messages.

