Overview
useFetchManyChatMessages returns a function that fetches a single page of conversation messages and resolves to the raw response. It stores nothing — no Redux, no socket subscription — so you own the resulting state.
This is the low-level fetcher shared by useLiveChatMessages (the live store-backed view) and useFetchManyChatMessagesWrapper (a batteries-included paginated list). Use it directly when you need full control; most apps will prefer the wrapper.
Because results never enter the live store, this is the right tool for filtered or read-only queries (e.g. only messages that have replies) that should not be polluted by live socket traffic. It is a point-in-time query — call it again to refresh.
Usage Example
Parameters
Keyset cursor (ISO timestamp): messages created before this. Mutually exclusive with
after.Keyset cursor (ISO timestamp): messages created after this. Mutually exclusive with
before.When
true, each message carries its reputation-grant summary at message.grants — { total, count, viewerTotal } over positive grants. Populated by the reputation bundle; on a project without it the summary comes back zero-filled rather than missing.Optional filters.
filters.hasReplies (boolean): when true, returns only messages that have thread replies (threadReplyCount > 0); when false, only messages with none. Filters by thread replies, not quotings.Threads are one level deep, so
hasReplies: true together with parentId always returns an empty list — the response’s notice field explains why.Returns
APromise resolving to:
Messages for the requested page. When
spaceReputation is requested, each embedded sender carries an added spaceReputation number. See ChatMessage and Reputation.
