Docs / built-apps / markMessageRead

markMessageRead

utilitysince 0.2.2

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

ParamTypeNotesDescription
credentialsFlowstackCredentialsrequired, since 0.2.2The recipient's credentials.
messageIdstringrequired, since 0.2.2The message_id of the received message to mark read.
configFlowstackClientConfigrequired, since 0.2.2Client config. Must include appScope.

Returns

FieldTypeDescription
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.