> 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/realtime-communication/multiple-receivers.md).

# Send to multiple receivers

Fan out a single message to **multiple known receiver IDs** in one `send()` call. DNotifier delivers to each recipient independently — there are no shared channels or subscriptions.

***

## When to use `receiverIds`

| Scenario                              | Approach                               |
| ------------------------------------- | -------------------------------------- |
| Group chat (your app manages members) | Send to each member's user ID          |
| Notify several dashboard sessions     | List admin session IDs                 |
| Broadcast to a team                   | Your backend maintains the member list |

{% hint style="warning" %}
DNotifier does **not** provide room or topic primitives. You maintain participant lists in your app and pass explicit `receiverIds`.
{% endhint %}

***

## The `send()` contract

| Field         | Description                                                            |
| ------------- | ---------------------------------------------------------------------- |
| `senderId`    | Must match the connecting user's `userId`                              |
| `receiverIds` | Array of target user IDs (mutually exclusive with single `receiverId`) |
| `data`        | Same JSON payload sent to every recipient                              |
| `saveHistory` | Optional; default `true` per recipient rules                           |

```json
{
  "type": "text",
  "text": "Hello everyone"
}
```

Each recipient receives the same `data` object in their `onMessage` handler.

***

## Delivery semantics

* Recipients who are **online** receive the message immediately via `onMessage`
* Recipients who are **offline** do not get live delivery
* With `saveHistory: true`, each recipient can load history when they reconnect (chat use case)

***

## Language guides

| Language                | Guide                                                                                                        |
| ----------------------- | ------------------------------------------------------------------------------------------------------------ |
| JavaScript / TypeScript | [javascript-typescript.md](/product-docs/realtime-communication/multiple-receivers/javascript-typescript.md) |
| Dart / Flutter          | [dart-flutter.md](/product-docs/realtime-communication/multiple-receivers/dart-flutter.md)                   |

***

## Related topics

* [Send & receive text](/product-docs/realtime-communication/send-and-receive.md)
* [Structured payloads](/product-docs/realtime-communication/structured-payloads.md)
* [Binary messaging](/product-docs/realtime-communication/binary-messaging.md) — `sendBinary` also accepts `receiverIds`
