What problem does it solve?
Developers building AI chat interfaces need a reliable way to stream user prompts and model responses with durability, replayability, and realātime synchronization across multiple clients and serverāside rendering contexts.
Core Features & Use Cases
- durableStreamConnection: clientāside adapter that ties TanStack AI's useChat to a Durable Stream for biādirectional messaging.
- toDurableChatSessionResponse: serverāside helper that writes model output to the stream while optionally creating the stream onādemand.
- SSR hydration: materializeSnapshotFromDurableStream materializes the current conversation snapshot for serverārendered pages.
- Multiāclient live sync: enable live:true in useChat to keep all participants upātoādate.
- Secure readāproxy: server endpoint forwards Durable Stream reads without exposing the secret.
Use cases include building collaborative chat assistants, AIādriven support bots, and realātime multiāuser storytelling apps.
Quick Start
Create a chat session by importing durableStreamConnection, configuring the send and read URLs, and passing the connection to useChat with live synchronization enabled.