> 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/reference/configuration.md).

# Configuration options

The `DNotifier` constructor accepts credentials, transport selection, lifecycle callbacks, and optional tuning flags. All options are set once at construction time unless noted.

## Required options

| Option      | Type               | Description                                                                            |
| ----------- | ------------------ | -------------------------------------------------------------------------------------- |
| `appId`     | `string`           | Your DNotifier application id from the dashboard                                       |
| `secret`    | `string`           | Application secret paired with `appId`                                                 |
| `transport` | `"ws"` \| `"http"` | `"ws"` for persistent realtime messaging; `"http"` for RPC-style AI/RAG/workflow calls |
| `userId`    | `string`           | End-user or service identity used for auth and message routing                         |

## Optional options

| Option           | Type       | Default                  | Description                                                           |
| ---------------- | ---------- | ------------------------ | --------------------------------------------------------------------- |
| `logs`           | `boolean`  | `false`                  | When `true`, AI sessions are reported to the DNotifier logs dashboard |
| `url`            | `string`   | Production WebSocket URL | Custom WebSocket endpoint (WebSocket transport only)                  |
| `onConnected`    | `function` | no-op                    | Called when the client is authenticated and ready                     |
| `onMessage`      | `function` | no-op                    | Called for each incoming framed message (`{ metadata, payload }`)     |
| `onDisconnected` | `function` | no-op                    | Called when the WebSocket closes or the transport errors              |

## Platform-specific injection

| SDK                  | Option             | When required                                          |
| -------------------- | ------------------ | ------------------------------------------------------ |
| JavaScript (Node.js) | `WebSocketImpl`    | `transport: "ws"` — pass the `ws` package constructor  |
| Dart / Flutter       | `connectWebSocket` | Optional custom WebSocket factory for tests or proxies |

## Properties after `connect()`

These instance properties are populated after a successful `connect()`:

| Property           | Type      | Description                                                        |
| ------------------ | --------- | ------------------------------------------------------------------ |
| `isConnected`      | `boolean` | `true` after auth (HTTP) or handshake (WebSocket) completes        |
| `aiEnabled`        | `boolean` | Whether AI features are enabled on the current plan                |
| `authToken`        | `string`  | Bearer token from the auth response                                |
| `messageSizeLimit` | `number`  | Max single-chunk payload size in bytes (from plan, default 32 KiB) |
| `appId`            | `string`  | Echo of constructor `appId`                                        |
| `userId`           | `string`  | Echo of constructor `userId`                                       |

Call `getPlanLimits()` for structured quota details.

## Language pages

* [**JavaScript / TypeScript**](/product-docs/reference/configuration/javascript-typescript.md) — Full constructor signature, TypeScript notes, `WebSocketImpl`
* [**Dart / Flutter**](/product-docs/reference/configuration/dart-flutter.md) — Named parameters, `connectWebSocket`, `disconnect()`

## See also

* [Connection & auth](/product-docs/reference/connection-auth.md)
* [Transport matrix](/product-docs/reference/transport-matrix.md)
* [Endpoints](/product-docs/reference/endpoints.md)
