> 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/chat/save-history.md).

# Save history flag

The **`saveHistory`** option on `send()` controls whether a message is **persisted** for later retrieval via `fetchChatHistory`. It defaults to **`true`**.

***

## Behavior

| `saveHistory`    | Effect                                         |
| ---------------- | ---------------------------------------------- |
| `true` (default) | Message stored; appears in `fetchChatHistory`  |
| `false`          | Live delivery only; not stored in chat history |

```js
await notifier.send({
  senderId: "user-alice",
  receiverId: "user-bob",
  data: { type: "text", text: "This will be saved" },
  saveHistory: true,
});

await notifier.send({
  senderId: "user-alice",
  receiverId: "user-bob",
  data: { type: "typing" },
  saveHistory: false,
});
```

Dart:

```dart
await notifier.send(
  senderId: 'user-alice',
  receiverId: 'user-bob',
  data: {'type': 'text', 'text': 'This will be saved'},
  saveHistory: true,
);
```

***

## When to set `saveHistory: false`

| Payload                                 | Reason               |
| --------------------------------------- | -------------------- |
| Typing indicators                       | Ephemeral UX signals |
| Presence / online status                | No need to persist   |
| Read receipts (if implemented via send) | Transient state      |
| High-frequency telemetry in a chat UI   | Avoid history bloat  |

{% hint style="success" %}
Ephemeral messages still deliver live to online recipients via `onMessage`. Only persistence is skipped.
{% endhint %}

***

## Chat vs realtime-only sends

| Use case              | `saveHistory`      |
| --------------------- | ------------------ |
| 1:1 chat text         | `true` (default)   |
| Support conversation  | `true`             |
| Live cursor / typing  | `false`            |
| Dashboard metric push | `false` (not chat) |

For non-chat realtime patterns, see [Realtime communication overview](/product-docs/realtime-communication/overview.md).

***

## Plan storage

Persisted messages count toward plan storage limits (`maxRowsPerUser` and related quotas from `getPlanLimits()`). See [Plan limits & quotas](/product-docs/realtime-communication/plan-limits.md).

***

## Related topics

* [Chat history](/product-docs/chat/chat-history.md)
* [Delete chat messages](/product-docs/chat/delete-messages.md)
* [Building 1:1 chat](/product-docs/chat/building-one-to-one-chat.md)
