Example: Minimal chat app
A complete walkthrough for a minimal 1:1 chat: connect, load history, send text, receive live messages, and handle disconnect. Language pages contain full runnable code.
What you will build
Terminal / browser tab A (alice) Terminal / browser tab B (bob)
β β
β fetchChatHistory on start β
β send text on Enter β
ββββββββββββββββββββββββββββββββββββββββββββΊβ
β β
βββββββββββββββββββββββββββββββββββββββββββββ€
β live + history in onMessage βFeatures covered
Authenticate and connect
connect()
Load thread
fetchChatHistory()
Send message
send({ data: { type: "text" } })
Receive live
onMessage
Persist messages
saveHistory: true (default)
Disconnect handling
onDisconnected
Prerequisites
DNotifier app with
appIdandsecretSDK installed β Installation
Two user IDs for testing (e.g.
user-alice,user-bob)
Test plan
Start bob listener (language page)
Start alice client in a second process
Alice sends a message β bob's console shows it live
Restart alice β
fetchChatHistoryloads prior messagesDisconnect network β verify offline banner / error handling
Language guides
JavaScript / TypeScript
Dart / Flutter
Next steps
Chat UI patterns β production UI
Structured payloads β images and files
1:1 chat example β extended example in Examples section
Last updated