This reference covers every public API surface in the @ably/ai-transport package. The SDK is organized into four entry points so you only import what you need.
API surfaces
| Surface | Description | Reference |
|---|---|---|
| Client transport | Subscribe to turns, build conversation views, cancel and control from the client | Client transport |
| Server transport | Manage turn lifecycle, stream responses, handle cancellation on the server | Server transport |
| React hooks | Declarative hooks for building chat UIs with any codec | React hooks |
| Vercel integration | Pre-built codec and factories for the Vercel AI SDK | Vercel integration |
| Codec | Interface for bridging any AI framework to Ably messages | Codec |
| Error codes | Enumerated error codes with recovery guidance | Error codes |
Entry points
| Entry point | Import path | Contents |
|---|---|---|
| Core | @ably/ai-transport | createClientTransport, createServerTransport, codec interfaces |
| React | @ably/ai-transport/react | Generic React hooks (useClientTransport, useView, etc.) |
| Vercel | @ably/ai-transport/vercel | UIMessageCodec, Vercel-specific transport factories |
| Vercel React | @ably/ai-transport/vercel/react | useChatTransport, useMessageSync |