Chat overview
Chat is a use case built on DNotifier's realtime 1:1 messaging layer. You send messages between user IDs, optionally persist history, and build conversation UIs β for support, social, team collaboration, and in-app messaging.
Chat vs realtime communication
Purpose
Deliver payloads to IDs
Human (or bot) conversations
History
Optional per message (saveHistory)
Fetch thread via fetchChatHistory
UX
Events, metrics, notifications
Threads, bubbles, read state (your UI)
Participants
Any sender/receiver IDs
Typically paired user IDs or user β bot
Both use the same senderId / receiverId addressing model over WebSocket.
Core building blocks
connect (ws)
β
βββ fetchChatHistory on thread open
β
βββ send({ data, saveHistory: true }) β live delivery + persistence
β
βββ onMessage β append incoming messages to UI
β
βββ deleteChatHistoryMessage β moderation / user deletesend()
Deliver message to peer; persist when saveHistory is true
fetchChatHistory()
Load past messages for a thread
deleteChatHistoryMessage()
Remove a stored message
onMessage
Receive live messages and history responses
Topics in this section
Connect, send, receive pattern
fetchChatHistory
deleteChatHistoryMessage
Per-message persistence
Threads, bubbles, typing
Full walkthrough
Prerequisites
Your first connection with
transport: "ws"
Use cases
For product-oriented chat scenarios (support, social, team tools), see Chat use cases.
Chat vs AI chat
User β user (or agent)
send, chat history
Human conversations
User β AI assistant
sendAI, AI history
LLM sessions, RAG
You can embed both in one app with separate tabs and history backends.
β AI overview
Last updated