The public values and TypeScript types @runbear-io/react exports — the client, the chat instance, session types, event payloads, messages and response components.
@runbear-io/react ships its TypeScript declarations. This page lists the package's supported
public exports, grouped by what you use it for. Exports used only by the SDK's own internals, such as
ChatRequestOptions, are left out and may change without notice. "Since" is the first release that exports the name. The current release is 0.4.0; names marked 0.5.0 are not exported until 0.5.0 is released.
import Runbear, { SessionDeclinedError, type SessionCredentials,} from "@runbear-io/react"
The widget instance createChat() returns, for keeping one in a variable or a ref. Create it with createChat(); it has no public constructor. Its methods are on Chat API
chatStarted and rendered carry no payload. Before 0.5.0, the chatCreated, containerReady and
messagesLoaded payloads had the same shapes but no exported names.
One message in the widget: { id?, role, content, thinking?, toolCalls?, suggestions?, attachments?, components? }, where role is "user", "assistant" or "system"
Message
0.0.1
An alias of ChatMessage
ToolCallStatus
0.0.1
A tool call's progress: { toolUseId, toolName, toolDisplayName, status, message }, where status is "preparing", "running", "completed" or "failed"
Suggestions
0.0.1
Suggested follow-up questions: { title, options }
Attachment
0.0.1
An uploaded file attached to a message: { url, name, contentType }
A component on a message: { componentId, name, props, fallbackText }. name is an open string and props an open object; narrow props by name before reading it. See Response components
ChatComponentOption
0.3.0
One option of a confirm or select: { label, value, style? }, where style is "default", "primary" or "danger"
ConfirmProps
0.3.0
props of a confirm: { options: ChatComponentOption[] }
SelectProps
0.3.0
props of a select: { options: ChatComponentOption[] }
CardProps
0.5.0
props of a card: { title, subtitle?, fields? }, where fields is an array of { label, value }
These describe what the widget reads from the REST API. They are exported for code that inspects the
same data; the REST reference has the full shapes.
Type
Since
What it is
Thread
0.0.1
{ id, createdAt, title }
ListThreadsResponse
0.0.1
{ threads: Thread[] }
MessagesResponse
0.0.1
A thread's messages: { messages }, each { id, role, content, components? } (components from 0.3.0). See Chat
One line of a streaming run: the thread.message.delta, thread.message.thinking_delta, thread.message.completed, thread.message.component, thread.tool_call.progress, error and done events. See Streaming. 0.5.0 (not yet released) removes thread.message.created, which the API never sent