ChatKitOptions
type ChatKitOptions = { api: CustomApiConfig | HostedApiConfig; composer?: ComposerOption; disclaimer?: DisclaimerOption; entities?: EntitiesOption; header?: HeaderOption; history?: HistoryOption; initialThread?: null | string; locale?: SupportedLocale; onClientTool?: (toolCall: { name: string; params: Record<string, unknown>; }) => Promise<Record<string, unknown>> | Record<string, unknown>; startScreen?: StartScreenOption; theme?: ColorScheme | ThemeOption; threadItemActions?: ThreadItemActionsOption; widgets?: WidgetsOption;};
Properties
Section titled “Properties”api: | CustomApiConfig | HostedApiConfig;
Configuration for how ChatKit communicates with your backend.
composer?
Section titled “composer?”optional composer: ComposerOption;
Configuration for the composer.
disclaimer?
Section titled “disclaimer?”optional disclaimer: DisclaimerOption;
Configuration for disclaimer text.
entities?
Section titled “entities?”optional entities: EntitiesOption;
Configuration for entities tags.
header?
Section titled “header?”optional header: HeaderOption;
Configuration for the header.
history?
Section titled “history?”optional history: HistoryOption;
Configuration for the history panel.
initialThread?
Section titled “initialThread?”optional initialThread: null | string;
The ID of the thread to show when ChatKit is mounted or opened for the first time.
Passing null
will show the new thread view.
Default
Section titled “Default”null;
locale?
Section titled “locale?”optional locale: SupportedLocale;
Locale override for ChatKit UI. If not provided, the browser’s locale will be used. If the locale is not supported, will fall back to English.
Default
Section titled “Default”navigator.language;
onClientTool()?
Section titled “onClientTool()?”optional onClientTool: (toolCall: { name: string; params: Record<string, unknown>;}) => | Promise<Record<string, unknown>>| Record<string, unknown>;
A map of handlers for the client tools configured on your server. The keys are the names of the client tools, and the values are functions that will be called when the client tool is invoked. The object (or promise) returned from the function will be sent back to the server as the result of the client tool invocation.
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
|
{ |
|
|
|
|
Returns
Section titled “Returns”| Promise
<Record
<string
, unknown
>>
| Record
<string
, unknown
>
startScreen?
Section titled “startScreen?”optional startScreen: StartScreenOption;
Configuration for the start screen.
theme?
Section titled “theme?”optional theme: | ColorScheme | ThemeOption;
Visual appearance configuration options for ChatKit.
Default
Section titled “Default”'light';
threadItemActions?
Section titled “threadItemActions?”optional threadItemActions: ThreadItemActionsOption;
Configuration for the thread item actions.
widgets?
Section titled “widgets?”optional widgets: WidgetsOption;
Configuration for widgets.