markMessageRead
Client function: mark a received DM as read (recipient only).
import { markMessageRead } from 'flowstack-sdk'Non-React client function. Marks the message messageId as read. Only the recipient may mark a message read; the backend rejects others. Sets read_at on the message and decrements the thread's unread_count. config must carry an appScope.
Signature
markMessageRead(credentials, messageId, config?): Promise<ApiResponse<{ message_id: string; read: boolean }>>Parameters
| Param | Type | Notes | Description |
|---|---|---|---|
credentials | FlowstackCredentials | required, since 0.2.2 | The recipient's credentials. |
messageId | string | required, since 0.2.2 | The message_id of the received message to mark read. |
config | FlowstackClientConfig | required, since 0.2.2 | Client config. Must include appScope. |
Returns
| Field | Type | Description |
|---|---|---|
| — | Promise<ApiResponse<{ message_id: string; read: boolean }>> | { ok, data: { message_id, read }, error }. |
Examples
Mark read
await markMessageRead(credentials, msg.message_id, { appScope });NoteRecipient-only. The sender cannot mark their own outgoing message read.
See also
useMessages · listMessages · DmMessage
Source: README.md#private-messaging-dms · Also available in llms-full.txt and registry.json.