REFERENCE
SDK Demos
How to use @asgard-js/core and @asgard-js/react, with demos you can try on the page.
Chatbot Props
Every prop supported by the <Chatbot> component from
@asgard-js/react.
Required
Prop Type Description configClientConfigClient config; must include botProviderEndpointcustomChannelIdstringUnique channel id on your side (user id / session id) Display
Prop Type Default Description titlestring— Header title (the bot-name row, distinct from channelTitle)avatarstring— Bot avatar URL botTypingPlaceholderstring— Deprecated (since 0.3.x) — no longer renders anything. The run-in-progress cue is now a connection-bound running indicator shown automatically (no prop needed) locale'en-US' | 'ja-JP' | 'zh-TW''en-US'Language for built-in text: tool-call labels, group summary, Task / Subagent panels. See Locales channelTitlestring | null— Seed for the thread-top title row (usually from channelMetadata()); updates live from the backendtitle.updateevent. See Channel TitleinputPlaceholderstring— Input box placeholder fullScreenbooleanfalseRender in full-screen mode classNamestring— Outer classNamestyleCSSProperties— Outer inline style loadingComponentReactNode— Custom loading UI Feature Toggles
Prop Type Description enableUploadbooleanEnable the image upload button enableDocumentUploadbooleanEnable the document upload button allowedImageMimeTypesstring[]Restrict image MIME types for enableUpload; when set it fully overrides the default list. See File UploadallowedDocumentMimeTypesstring[]Restrict document MIME types for enableDocumentUpload; when set it fully overrides the default list. See File UploadenableExportbooleanEnable conversation export enableLoadConfigFromServicebooleanLoad remote config (e.g. embedConfig) from bot providermaintainConnectionWhenClosedbooleanKeep the SSE connection alive when the window is closed keepConnectionOnUnmountbooleanDefault false. Keep an in-flight SSE run alive when the component unmounts so it can finish on the backend (distinct frommaintainConnectionWhenClosed, which is the window-closed case)autoResetChannelbooleanDefault true. Since 0.3.x, mount first checks channel metadata: a channel that already exists on the backend is always restored (history replayed) regardless of this flag; only for a not-yet-existing channel doesfalseskipRESET_CHANNELto preserveinitMessages. See Auto Reset ChanneluserIdentityHintstringUser identity hint; when set, all requests (SSE, upload) send the X-ASGARD-USER-IDENTITY-HINTheaderSee the Feature Toggles demo.
Init Messages & Events
Prop Type Description initMessagesConversationMessage[]Initial messages loaded on mount onSseMessage(response, { conversation }) => voidCallback fired on every SSE event onSseError(error: unknown) => voidSSE error callback onBeforeSendMessage(params) => paramsModify params before sending. See before-send-message onMessageSent() => voidFired after a message has been sent onChannelReady() => voidFired once the channel is ready to accept messages (the ref is updated, so you can send an opening message from the ref inside the callback); re-fires after resetChannelonReset() => voidFired when the channel is reset onClose() => voidFired when the chatbot is closed Custom Rendering
Prop Type Description themePartial<AsgardThemeContextValue>Theme overrides — see Theme demo renderHeader() => ReactNodeReplace the default header — see Custom Header renderFooter() => ReactNodeReplace the default footer (input area) entirely — see Custom Footer renderMenu() => ReactNodeInsert a menu between body and footer — see Render Menu renderTitle(props) => ReactNodeReplace the thread-top title row ( propsis{ title, renderDefault }; returnnullto hide). Pairs withuntitledLabel(fallback for unnamed, default新對話) andchannelTitleHidden. See Channel TitlerenderMessageContent(props) => ReactNodeReplace message content rendering — see Custom Renderer renderToolCallGroup(props) => ReactNodeCustomize or hide the tool-call group — see Tool Call errorMessageRenderer(message) => ReactNodeCustom error message renderer customActionsReactNode[]Custom buttons rendered on the right of the header footerEndActionsReactNode[]Custom nodes rendered at the trailing end of the footer input row (after send/mic) — see Footer End Actions messageActions(message) => MessageActionConfig[]Action buttons under each bot message onMessageAction(actionId, message) => voidCallback when a message action is clicked onTemplateBtnClick(payload, eventName, raw) => voidCallback for button-template emit actions onErrorClick(message) => voidCallback when an error message is clicked defaultLinkTarget'_blank' | '_self' | '_parent' | '_top'Default targetfor links in messageshideRunChromebooleanDo not render the built-in docked Task / Subagent panels — place them yourself, see Docking Panels Sandbox
Prop Type Description fileExplorer'builtin' | 'off'The built-in File Explorer aside; defaults to 'builtin'. Set'off'to place<FileExplorerPanel>yourself. See File ExplorerautoRevealOnOpenFileCardbooleanWhether an arriving open-filecard auto-reveals the aside (defaulttrue); suppressed while a file has unsaved editsfileExplorerBasePathstringOverride the tree root (absolute path) instead of the sandbox's workingDirectoryonSandboxOpenBrowser(sandboxName) => voidTake over a sandbox://<name>/open-browsercard; when set the SDK defers to you. See Handoff CardsonSandboxOpenFile(sandboxName, absolutePath) => voidTake over a sandbox://<name>/open-filecard. Additive, not a replacement — the built-in aside is still revealed unless you also setfileExplorer="off"sandboxBrowserOpenTarget'_blank' | '_self' | '_parent' | '_top'Where the default open-browser handler opens the tab; defaults to '_blank'Auth
Prop Type Description authStateAuthStateCurrent auth state — see values below and Auth demo onApiKeySubmit(apiKey: string) => Promise<void>Fired when the user submits an API key onAuthError(error: { isAuthError, isBotProviderError, errorDetail }) => voidAuth error callback AuthStatepossible values:'loading'|'needApiKey'|'authenticated'|'error'|'invalidApiKey'|'subscriptionExpired'|'botNotFound'ClientConfigFieldsThe
configprop is of typeClientConfig:Field Type Description botProviderEndpointstringRequired. Bot provider base URL endpointstring@deprecated — use botProviderEndpointapiKeystringStatic API key customHeadersRecord<string, string>Custom HTTP headers (e.g. Authorization: Bearer ...)transformSsePayload(payload) => payloadMutate the SSE payload before sending debugModebooleanEnable debug logs onRunInit/onMessage/onToolCall/onProcess/onRunDone/onRunErrorEventHandlerPer-SSE-event handlers Setting
botProviderEndpointto the literal string"skip"enables preview mode: no connection is established, onlyinitMessagesare rendered. Many demos on this site use preview mode.See Also
- useChannel hook — build your own UI without
<Chatbot> ConversationMessagetype — the message union shape
- useChannel hook — build your own UI without
Further Reading
For the complete SDK API reference, see the Asgard developer docs: