Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Delete chat messages

Remove a persisted chat message with deleteChatHistoryMessage. Use this for user-initiated deletes, moderation, and compliance workflows.


API contract

Field
Required
Description

senderId

Yes

The acting user (must match connected userId)

messageId

Yes

ID of the message to delete

await notifier.deleteChatHistoryMessage({
  senderId: "user-alice",
  messageId: "message-id-to-delete",
});

The messageId typically comes from metadata.id on received messages or from history fetch results.


UX pattern

  1. User long-presses a message → show delete option

  2. Call deleteChatHistoryMessage with the message's id

  3. Remove the message from local UI state

  4. Optionally notify the peer via a separate send() with { type: "message-deleted", messageId } if your app needs live sync

Deletion removes the message from DNotifier chat history storage. Live UI updates for the peer require your app to send a notification or refetch history.


Language guides

Language
Guide

JavaScript / TypeScript

Dart / Flutter


Last updated