Skip to content

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;
};
api:
| CustomApiConfig
| HostedApiConfig;

Configuration for how ChatKit communicates with your backend.


optional composer: ComposerOption;

Configuration for the composer.

ComposerOption


optional disclaimer: DisclaimerOption;

Configuration for disclaimer text.

DisclaimerOption


optional entities: EntitiesOption;

Configuration for entities tags.

EntitiesOption


optional header: HeaderOption;

Configuration for the header.

HeaderOption


optional history: HistoryOption;

Configuration for the history panel.

HistoryOption


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.

null;

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.

navigator.language;

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.

Parameter Type

toolCall

{ name: string; params: Record<string, unknown>; }

toolCall.name

string

toolCall.params

Record<string, unknown>

| Promise<Record<string, unknown>> | Record<string, unknown>


optional startScreen: StartScreenOption;

Configuration for the start screen.

StartScreenOption


optional theme:
| ColorScheme
| ThemeOption;

Visual appearance configuration options for ChatKit.

'light';

optional threadItemActions: ThreadItemActionsOption;

Configuration for the thread item actions.

ThreadItemActionsOption


optional widgets: WidgetsOption;

Configuration for widgets.

WidgetsOption