Skip to content

Commit ddfbb7e

Browse files
committed
cleaned up duplicated docs; added quickstart
1 parent 753a629 commit ddfbb7e

20 files changed

+286
-973
lines changed

packages/docs/astro.config.ts

Lines changed: 7 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -40,62 +40,20 @@ const typeDocConfig: StarlightTypeDocOptions['typeDoc'] = {
4040

4141
const sidebar = [
4242
{ label: 'Overview', link: '/' },
43+
{ label: 'Quickstart', link: '/quickstart' },
44+
{ label: 'Customize', link: '/customize' },
45+
chatkitTypeDocSidebarGroup,
4346
{
44-
label: 'Authenticate users',
45-
collapsed: true,
46-
items: [
47-
{
48-
label: 'Hosted backend (client secrets)',
49-
link: '/guides/authenticate-hosted',
50-
},
51-
{
52-
label: 'Custom backend (custom fetch)',
53-
link: '/guides/authenticate-custom',
54-
},
55-
],
56-
},
57-
{
58-
label: 'Customize',
59-
collapsed: true,
60-
items: [
61-
{ label: 'Overview', link: '/guides/customize' },
62-
{ label: 'Theme', link: '/guides/customize-theme' },
63-
{ label: 'Header & history', link: '/guides/customize-header-history' },
64-
{ label: 'Start screen', link: '/guides/customize-start-screen' },
65-
{ label: 'Composer', link: '/guides/customize-composer' },
66-
{
67-
label: 'Thread item actions',
68-
link: '/guides/customize-thread-item-actions',
69-
},
70-
],
71-
},
72-
{
73-
label: 'Connect to your app',
74-
collapsed: true,
47+
label: 'Managed backend',
7548
items: [
76-
{ label: 'Register callbacks', link: '/guides/register-callbacks' },
77-
{ label: 'Call ChatKit methods', link: '/guides/methods' },
7849
{
79-
label: 'Handle runtime events',
80-
link: '/guides/runtime-events',
50+
label: 'ChatKit API',
51+
link: 'https://platform.openai.com/docs/guides/chatkit',
8152
},
8253
],
8354
},
8455
{
85-
label: 'Go live',
86-
collapsed: true,
87-
items: [
88-
{ label: 'Overview', link: '/guides/go-live' },
89-
{ label: 'Provide domain keys', link: '/guides/provide-domain-keys' },
90-
{ label: 'Monitor logs', link: '/guides/monitor-logs' },
91-
// { label: 'Update CSP settings', link: '/guides/update-csp-settings' },
92-
// { label: 'Scope user data', link: '/guides/scope-user-data' },
93-
{ label: 'Localization', link: '/guides/localization' },
94-
],
95-
},
96-
chatkitTypeDocSidebarGroup,
97-
{
98-
label: 'Custom Backends',
56+
label: 'Self-hosted backend',
9957
items: [
10058
{
10159
label: 'Python SDK',
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
---
2+
title: Customize ChatKit
3+
description: Tailor ChatKit’s theme, layout, composer, and message actions from a single options object.
4+
---
5+
6+
import { TabItem, Tabs } from '@astrojs/starlight/components';
7+
8+
ChatKit is fully configurable through the options object you pass in React (`useChatKit`) or on the web component (`chatkit.setOptions`). Use the [ChatKit Playground](https://chatkit.studio/playground) to experiment with settings and copy a ready-to-use configuration.
9+
10+
<Tabs syncKey="customize-language">
11+
<TabItem label="React">
12+
13+
```tsx
14+
import { useChatKit } from '@openai/chatkit-react';
15+
16+
const { control } = useChatKit({
17+
theme: {
18+
colorScheme: 'dark',
19+
radius: 'round',
20+
color: {
21+
accent: { primary: '#8B5CF6', level: 2 },
22+
},
23+
},
24+
header: {
25+
enabled: true,
26+
rightAction: {
27+
icon: 'light-mode',
28+
onClick: () => console.log('Toggle theme'),
29+
},
30+
},
31+
history: {
32+
enabled: true,
33+
showDelete: true,
34+
showRename: true,
35+
},
36+
startScreen: {
37+
greeting: 'How can we help?',
38+
prompts: [
39+
{
40+
label: 'Troubleshoot an issue',
41+
prompt: 'Help me fix an issue',
42+
icon: 'lifesaver',
43+
},
44+
{
45+
label: 'Request a feature',
46+
prompt: 'I have an idea',
47+
icon: 'lightbulb',
48+
},
49+
],
50+
},
51+
composer: {
52+
placeholder: 'Ask the assistant…',
53+
},
54+
threadItemActions: {
55+
feedback: true,
56+
retry: true,
57+
},
58+
});
59+
```
60+
61+
</TabItem>
62+
<TabItem label="Web component">
63+
64+
```js
65+
chatkit.setOptions({
66+
theme: {
67+
colorScheme: 'dark',
68+
radius: 'round',
69+
color: {
70+
accent: { primary: '#8B5CF6', level: 2 },
71+
},
72+
},
73+
header: {
74+
enabled: true,
75+
rightAction: {
76+
icon: 'light-mode',
77+
onClick: () => console.log('Toggle theme'),
78+
},
79+
},
80+
history: {
81+
enabled: true,
82+
showDelete: true,
83+
showRename: true,
84+
},
85+
startScreen: {
86+
greeting: 'How can we help?',
87+
prompts: [
88+
{
89+
label: 'Troubleshoot an issue',
90+
prompt: 'Help me fix an issue',
91+
icon: 'lifesaver',
92+
},
93+
{
94+
label: 'Request a feature',
95+
prompt: 'I have an idea',
96+
icon: 'lightbulb',
97+
},
98+
],
99+
},
100+
composer: {
101+
placeholder: 'Ask the assistant…',
102+
},
103+
threadItemActions: {
104+
feedback: true,
105+
retry: true,
106+
},
107+
});
108+
```
109+
110+
</TabItem>
111+
</Tabs>
112+
113+
## Key areas to configure
114+
115+
- **Theme** — Tune the appearance with the [`theme` options reference](/api/@openai/chatkit/type-aliases/ThemeOption/).
116+
- **Header & history** — Manage layout and browsing with the [`header` options reference](/api/@openai/chatkit/type-aliases/HeaderOption/) and [`history` options reference](/api/@openai/chatkit/type-aliases/HistoryOption/).
117+
- **Start screen** — Greet users and highlight actions via the [`startScreen` options reference](/api/@openai/chatkit/type-aliases/StartScreenOption/).
118+
- **Composer** — Configure inputs, tools, model picker, and mentions through the [`composer` options reference](/api/@openai/chatkit/type-aliases/ComposerOption/).
119+
- **Thread item actions** — Control feedback and retry behavior with the [`threadItemActions` options reference](/api/@openai/chatkit/type-aliases/ThreadItemActionsOption/).
120+
121+

packages/docs/src/content/docs/guides/authenticate-custom.mdx

Lines changed: 0 additions & 84 deletions
This file was deleted.

packages/docs/src/content/docs/guides/authenticate-hosted.mdx

Lines changed: 0 additions & 92 deletions
This file was deleted.

0 commit comments

Comments
 (0)