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

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

Step
API

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 appId and secret

  • SDK installed β€” Installation

  • Two user IDs for testing (e.g. user-alice, user-bob)


Test plan

  1. Start bob listener (language page)

  2. Start alice client in a second process

  3. Alice sends a message β†’ bob's console shows it live

  4. Restart alice β†’ fetchChatHistory loads prior messages

  5. Disconnect network β†’ verify offline banner / error handling


Language guides

Language
Guide

JavaScript / TypeScript

Dart / Flutter


Next steps

Last updated