> 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/plan-limits.md).

# Plan limits & quotas

DNotifier enforces **plan limits** at authentication time. The SDK exposes key quotas so you can gate features, validate payload size, and show upgrade prompts in your UI.

***

## Reading limits after connect

```js
await notifier.connect();

const limits = notifier.getPlanLimits();
console.log(limits?.messagesHardLimit);
console.log(limits?.maxUsers);
console.log(limits?.aiEnabled);

console.log(notifier.messageSizeLimit); // bytes — chunk size cap
console.log(notifier.aiEnabled);
```

Dart:

```dart
await notifier.connect();

final limits = notifier.getPlanLimits();
print(limits?.messagesHardLimit);
print(limits?.maxUsers);
print(notifier.messageSizeLimit);
```

{% hint style="success" %}
Call `getPlanLimits()` once after connect and cache the result for the session. Limits reflect your app's current plan in the DNotifier dashboard.
{% endhint %}

***

## `getPlanLimits()` fields

| Field                   | Description                                 |
| ----------------------- | ------------------------------------------- |
| `messagesHardLimit`     | Hard cap on message volume (plan-dependent) |
| `maxAIRequestsPerMonth` | Monthly AI request quota                    |
| `maxAIWordsPerMonth`    | Monthly AI word/token budget                |
| `knowledgeBaseMaxWords` | Knowledge base storage limit                |
| `aiEnabled`             | Whether AI features are available           |
| `maxUsers`              | Maximum distinct users for the app          |
| `maxRowsPerUser`        | Per-user storage rows (history-related)     |

Exact enforcement is server-side. The SDK surfaces limits for client-side UX decisions.

***

## Realtime-specific limits

| Limit                  | Client property     | Impact                                                                          |
| ---------------------- | ------------------- | ------------------------------------------------------------------------------- |
| Message size per chunk | `messageSizeLimit`  | Triggers automatic [chunking](/product-docs/realtime-communication/chunking.md) |
| Message volume         | `messagesHardLimit` | Outbound sends count toward quota                                               |
| Concurrent connections | Plan-dependent      | Too many connects may be rejected at auth                                       |

***

## Gating features in UI

```js
await notifier.connect();

if (!notifier.aiEnabled) {
  hideAiAssistantTab();
}

const maxBytes = notifier.messageSizeLimit;
if (selectedFile.size > maxBytes * 10) {
  showWarning("File may take longer to upload due to chunking.");
}
```

***

## When limits are exceeded

| Scenario                       | Typical behavior                                   |
| ------------------------------ | -------------------------------------------------- |
| Auth with invalid/expired plan | `connect()` throws                                 |
| Send over hard message cap     | Server may reject; handle errors in your send path |
| AI disabled on plan            | `sendAI()` throws `AI is not enabled`              |

See [Error handling & reconnection](/product-docs/realtime-communication/error-handling.md) for recovery patterns.

***

## Upgrading

Manage plans and billing at [app.dnotifier.com](https://app.dnotifier.com). Current tier details are published on [dnotifier.com](https://www.dnotifier.com).

→ [Pricing & plans](/product-docs/platform-overview/pricing.md)

***

## Related topics

* [Large messages & chunking](/product-docs/realtime-communication/chunking.md)
* [Connection lifecycle](/product-docs/realtime-communication/connection-lifecycle.md)
* [Save history flag](/product-docs/chat/save-history.md)
