> 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/transport-matrix.md).

# Transport method matrix

Which SDK methods work on each transport, and which transport is recommended.

## Legend

| Symbol | Meaning                                         |
| ------ | ----------------------------------------------- |
| ✅      | Supported and recommended                       |
| ⚠️     | Supported but not recommended for this use case |
| ❌      | Not supported or impractical                    |

## Matrix

| Method                       | WebSocket (`ws`)         | HTTP (`http`)   | Recommended                                    |
| ---------------------------- | ------------------------ | --------------- | ---------------------------------------------- |
| `connect()`                  | ✅                        | ✅               | Both — auth is always HTTP                     |
| `getPlanLimits()`            | ✅                        | ✅               | Both                                           |
| `disconnect()`               | ✅                        | —               | WS                                             |
| `send()`                     | ✅                        | ⚠️              | **WS** for live chat                           |
| `sendBinary()`               | ✅                        | ❌               | **WS** only                                    |
| `sendAI()`                   | ⚠️ async via `onMessage` | ✅ sync response | **HTTP**                                       |
| `fetchAIHistory()`           | ⚠️                       | ✅               | **HTTP**                                       |
| `deleteAIHistoryMessage()`   | ⚠️                       | ✅               | **HTTP**                                       |
| `fetchChatHistory()`         | ⚠️ via `onMessage`       | ✅               | **HTTP** for sync; **WS** if already connected |
| `deleteChatHistoryMessage()` | ⚠️                       | ✅               | **HTTP**                                       |
| `search()`                   | ⚠️                       | ✅               | **HTTP**                                       |
| `addDocument()`              | ⚠️                       | ✅               | **HTTP**                                       |
| `updateDocument()`           | ⚠️                       | ✅               | **HTTP**                                       |
| `deleteDocument()`           | ⚠️                       | ✅               | **HTTP**                                       |
| `listDocuments()`            | ⚠️                       | ✅               | **HTTP**                                       |
| `getDocument()`              | ⚠️                       | ✅               | **HTTP**                                       |
| `runWorkflow()`              | ⚠️                       | ✅               | **HTTP**                                       |
| `sendWithOpenAI()`           | ⚠️ deprecated            | ⚠️ deprecated   | Use `sendAI` on **HTTP**                       |

⚠️ on WebSocket means the method sends a framed packet and may return only a message id; the full response arrives on `onMessage` (or not at all for fire-and-forget operations).

## Incoming messages

| Transport | `onMessage` behavior                                                          |
| --------- | ----------------------------------------------------------------------------- |
| `ws`      | Real-time delivery of messages, AI replies (code 300), chat history responses |
| `http`    | Not used for push — each method returns its response directly                 |

## Typical dual-transport architecture

| Component          | Transport | Methods                                                |
| ------------------ | --------- | ------------------------------------------------------ |
| Chat client        | `ws`      | `send()`, `onMessage`, optional `fetchChatHistory`     |
| Backend AI service | `http`    | `sendAI()`, `search()`, `runWorkflow()`, document CRUD |

Both instances use the same `appId` and `secret` with different `userId` values as needed.

## Authentication

Both transports authenticate identically during `connect()`:

1. Authenticate over HTTPS with `appId`, `secret`, and `userId`
2. Receive an auth token and plan limits
3. WebSocket clients complete handshake; HTTP clients proceed immediately

## Choosing a transport

See [Choose your transport](/product-docs/getting-started/choose-transport.md).

## See also

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