@convokit/widget 0.0.11 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -80
- package/dist/{PopupWidget-DhKUzzJD.js → PopupWidget-sIgNr_Yy.js} +1185 -1259
- package/dist/config.d.ts +10 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/index.d.ts +0 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +2 -611
- package/dist/next.esm.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,28 +1,20 @@
|
|
|
1
1
|
# @convokit/widget
|
|
2
2
|
|
|
3
|
-
> **ConvoKit is currently in early access.** The waitlist is live — [join at convokit.dev](https://convokit.dev) to get early access.
|
|
4
|
-
|
|
5
3
|
Add an AI-powered chat widget to any React or Next.js app in minutes. ConvoKit handles the AI, knowledge base, and conversations — you just drop in a component.
|
|
6
4
|
|
|
7
5
|
**Website:** [convokit.dev](https://convokit.dev)
|
|
8
6
|
|
|
9
7
|
---
|
|
10
8
|
|
|
11
|
-
##
|
|
9
|
+
## Get started in 5 steps
|
|
12
10
|
|
|
13
|
-
|
|
14
|
-
|-----------|--------|-------------|
|
|
15
|
-
| **PopupWidget** | Bubble in corner | `apiKey` (your ConvoKit public key) |
|
|
16
|
-
| **FullScreenWidget** | Full page | `apiKey`, optional `onBack` |
|
|
17
|
-
| **PopupBackendWidget** | Bubble in corner | `apiUrl`, `apiKey` |
|
|
18
|
-
| **FullScreenBackendWidget** | Full page | `apiUrl`, `apiKey`, optional `onBack` |
|
|
11
|
+
**1. Sign up** → [convokit.dev](https://convokit.dev)
|
|
19
12
|
|
|
20
|
-
|
|
13
|
+
**2. Generate your API key** → from the ConvoKit dashboard
|
|
21
14
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
## Installation
|
|
15
|
+
**3. Upload your documents** → add your knowledge base (docs, FAQs, support content)
|
|
25
16
|
|
|
17
|
+
**4. Install the library**
|
|
26
18
|
```bash
|
|
27
19
|
npm install @convokit/widget
|
|
28
20
|
# or
|
|
@@ -31,6 +23,14 @@ yarn add @convokit/widget
|
|
|
31
23
|
pnpm add @convokit/widget
|
|
32
24
|
```
|
|
33
25
|
|
|
26
|
+
**5. Add the widget** → paste your key and you're live
|
|
27
|
+
|
|
28
|
+
```tsx
|
|
29
|
+
<PopupWidget apiKey="pk_live_..." />
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
That's it. ConvoKit trains on your documents and starts answering questions immediately.
|
|
33
|
+
|
|
34
34
|
---
|
|
35
35
|
|
|
36
36
|
## Quick start
|
|
@@ -91,70 +91,22 @@ export default function Layout({ children }) {
|
|
|
91
91
|
}
|
|
92
92
|
```
|
|
93
93
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
## All four components
|
|
97
|
-
|
|
98
|
-
```tsx
|
|
99
|
-
// Popup bubble – ConvoKit key
|
|
100
|
-
<PopupWidget apiKey="pk_live_..." />
|
|
101
|
-
|
|
102
|
-
// Full-page chat – ConvoKit key
|
|
103
|
-
<FullScreenWidget apiKey="pk_live_..." onBack={() => router.back()} />
|
|
104
|
-
|
|
105
|
-
// Popup bubble – your own backend
|
|
106
|
-
<PopupBackendWidget apiUrl="/api/chat" apiKey="your-key" />
|
|
107
|
-
|
|
108
|
-
// Full-page chat – your own backend
|
|
109
|
-
<FullScreenBackendWidget apiUrl="/api/chat" apiKey="your-key" onBack={() => router.back()} />
|
|
110
|
-
```
|
|
94
|
+
No separate CSS import needed — styles are bundled.
|
|
111
95
|
|
|
112
96
|
---
|
|
113
97
|
|
|
114
98
|
## Props
|
|
115
99
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
|
119
|
-
|
|
120
|
-
| `
|
|
121
|
-
| `
|
|
122
|
-
| `
|
|
123
|
-
| `
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
| Prop | Type | Description |
|
|
128
|
-
|------|------|-------------|
|
|
129
|
-
| `position` | `'bottom-right' \| 'bottom-left'` | Bubble position |
|
|
130
|
-
| `persistMessages` | `boolean` | Keep messages across page loads |
|
|
131
|
-
|
|
132
|
-
**Backend components also accept:**
|
|
133
|
-
|
|
134
|
-
| Prop | Type | Description |
|
|
135
|
-
|------|------|-------------|
|
|
136
|
-
| `authToken` | `string` | Bearer token forwarded to your backend |
|
|
137
|
-
|
|
138
|
-
**Full-screen components also accept:**
|
|
139
|
-
|
|
140
|
-
| Prop | Type | Description |
|
|
141
|
-
|------|------|-------------|
|
|
142
|
-
| `onBack` | `() => void` | Called when user taps the back button |
|
|
143
|
-
| `backLabel` | `string` | Label for the back button |
|
|
144
|
-
|
|
145
|
-
---
|
|
146
|
-
|
|
147
|
-
## Advanced: low-level components
|
|
148
|
-
|
|
149
|
-
If you need full control over state or API calls, use the low-level components directly:
|
|
150
|
-
|
|
151
|
-
| Component | Config type |
|
|
152
|
-
|-----------|-------------|
|
|
153
|
-
| `PopupKey` / `FullScreenKey` | `KeyConfig` |
|
|
154
|
-
| `PopupBackend` / `FullScreenBackend` | `BackendConfig` |
|
|
155
|
-
| `PopupControlled` / `FullScreenControlled` | `ControlledConfig` (you pass `messages`, `onMessagesUpdate`, `onSend`) |
|
|
156
|
-
|
|
157
|
-
**Types you can import:** `KeyConfig`, `BackendConfig`, `ControlledConfig`, `PopupWidgetProps`, `FullScreenWidgetProps`, `PopupBackendWidgetProps`, `FullScreenBackendWidgetProps`, `ChatMessage`, `ChatHistoryItem`, `ChatResponse`, `ThemeOptions`.
|
|
100
|
+
| Prop | Type | Default | Description |
|
|
101
|
+
|------|------|---------|-------------|
|
|
102
|
+
| `apiKey` | `string` | **required** | Your ConvoKit public key (`pk_live_...` or `pk_test_...`) |
|
|
103
|
+
| `title` | `string` | `'Support'` | Widget header title |
|
|
104
|
+
| `welcomeMessage` | `string` | `'Hi! How can we help?'` | First message shown to the user |
|
|
105
|
+
| `widgetId` | `string` | `'convokit-widget'` | Unique identifier for this widget instance |
|
|
106
|
+
| `primaryColor` | `string` | — | Accent color (e.g. `'#7c3aed'`) |
|
|
107
|
+
| `position` | `'bottom-right' \| 'bottom-left' \| 'bottom-middle' \| 'top-right' \| 'top-left' \| 'top-middle'` | `'bottom-right'` | Bubble position on screen |
|
|
108
|
+
| `persistMessages` | `boolean` | `false` | Restore chat history on page reload |
|
|
109
|
+
| `logoUrl` | `string` | — | Custom icon shown in the chat bubble (SVG, PNG, JPG) |
|
|
158
110
|
|
|
159
111
|
---
|
|
160
112
|
|
|
@@ -179,14 +131,6 @@ module.exports = nextConfig;
|
|
|
179
131
|
|
|
180
132
|
---
|
|
181
133
|
|
|
182
|
-
## Early access
|
|
183
|
-
|
|
184
|
-
ConvoKit is in early access. Get your API key and set up your knowledge base at **[convokit.dev](https://convokit.dev)**.
|
|
185
|
-
|
|
186
|
-
The waitlist is live — join now to get early access.
|
|
187
|
-
|
|
188
|
-
---
|
|
189
|
-
|
|
190
134
|
## License
|
|
191
135
|
|
|
192
136
|
MIT
|