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
User long-presses a message → show delete option
Call
deleteChatHistoryMessagewith the message'sidRemove the message from local UI state
Optionally notify the peer via a separate
send()with{ type: "message-deleted", messageId }if your app needs live sync
Language guides
Language
Guide
JavaScript / TypeScript
Dart / Flutter
Related topics
Last updated