> For the complete documentation index, see [llms.txt](https://dnotifier.gitbook.io/product-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dnotifier.gitbook.io/product-docs/examples/one-to-one-chat.md).

# 1:1 chat (intermediate)

Build a simple two-user chat: realtime delivery over WebSocket plus optional chat history retrieval.

## What this example does

1. Connect two users (`user-alice`, `user-bob`) on WebSocket
2. Send messages with `saveHistory: true` (default)
3. Fetch conversation history with `fetchChatHistory()`
4. Display messages in `onMessage` as they arrive

## Prerequisites

* WebSocket transport
* Familiarity with [hello realtime](/product-docs/examples/hello-realtime.md)

## Architecture

```
user-alice  ──send()──>  DNotifier  ──onMessage──>  user-bob
                ^                                        |
                └──────────── send() ────────────────────┘
```

## Language guides

* [**JavaScript / TypeScript**](/product-docs/examples/one-to-one-chat/javascript-typescript.md)
* [**Dart / Flutter**](/product-docs/examples/one-to-one-chat/dart-flutter.md)

## Related docs

* [Building 1:1 chat](https://github.com/smartguy6666/dnotifier-sdk/blob/main/docs/examples/chat/building-one-to-one-chat/README.md)
* [Chat history](https://github.com/smartguy6666/dnotifier-sdk/blob/main/docs/examples/chat/chat-history/README.md)
