ChatDrawer is the complete chat panel from @devicai/ui: history, attachments, voice input, a timeline of the tools the assistant used, and per-message feedback.
If you are not writing React, you want the hosted widget instead — configured from the assistant, pasted into your page as a snippet.
Appearance and behaviour
onMessageSent, onMessageReceived, onToolCall, onChatCreated, onError, onOpen, onClose. Passing isOpen puts the drawer in controlled mode, so your own button can open it.
Identifying the user
The drawer takes the tenant and subtenant, either from the provider or per component:Showing what the assistant remembered
For an assistant with memory, the drawer shows a collapsible Recalled memories strip beside the message that brought them in — including while the first answer is still being produced.useDevicChat().recalledMemories. The brain button needs the credential to be allowed on /api/v1/memory/*; without it, leave it off. See Memory.
Letting users connect their own apps
When the assistant offers apps to its tenants, a stack of their logos appears in the header, opening the modal where the user connects their own accounts.The control costs no extra request when there is nothing behind it: the assistant itself reports whether it offers apps, on the call the drawer already makes for its header. Connected apps come first in the stack and unconnected ones are dimmed, so the row doubles as the status.
Following the answer: streaming or polling
While an answer is being produced, the widget has two ways to follow it. Streaming (@devicai/ui 0.59.0 and later) keeps one connection open and receives every change as it happens, the reply included, word by word. No request is made while the connection is up. It is opt-in for now:
streaming={false}. Against an API that does not serve the stream, the widget notices and polls instead, so the flag is safe to turn on before every deployment has caught up.
Polling is the default: the widget asks the API what has been produced so far, once a second.
pollingInterval is only the cadence used while the connection is down. Without it, the default answers as fast as the API produces tokens; raise it when the cost of the requests matters more than the latency of the answer.
The reply arrives word by word for OpenAI, Anthropic and Gemini models. Other providers, and assistants with guardrails enabled, deliver the text in one piece: the answer is checked whole before anyone sees it. Status changes and tool calls stream in either case.
Building your own interface
Everything the drawer does is available fromuseDevicChat, so a bespoke interface is not a downgrade:
useAssistantInfo, useModelInterface, useAICommandBar, useAIGenerationButton, usePolling.