@skippr/live-agent-sdk 0.33.0 → 0.35.0
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 +53 -25
- package/dist/esm/lib-exports.js +1047 -293
- package/dist/skippr-sdk.css +1 -1
- package/dist/skippr-sdk.js +144 -144
- package/dist/types/components/LiveAgent.d.ts +1 -1
- package/dist/types/components/MeetingControls.d.ts +5 -1
- package/dist/types/components/ModuleSelector.d.ts +1 -0
- package/dist/types/components/StartSessionPrompt.d.ts +10 -2
- package/dist/types/context/LiveAgentContext.d.ts +35 -1
- package/dist/types/hooks/useAvailableModules.d.ts +13 -0
- package/dist/types/hooks/useLiveAgent.d.ts +1 -0
- package/dist/types/hooks/useSession.d.ts +26 -4
- package/dist/types/lib/react-compat.d.ts +26 -0
- package/dist/types/lib-exports.d.ts +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://skippr.ai) [](https://www.npmjs.com/package/@skippr/live-agent-sdk)
|
|
4
4
|
|
|
5
|
-
Embed
|
|
5
|
+
Embed product specialists that see, speak, and act in real time. Configure **modules** — for onboarding, demos, training, support, and anything else — and let your users pick which one to talk to from a single embed.
|
|
6
6
|
|
|
7
7
|
## Key Features
|
|
8
8
|
|
|
9
|
+
- **Multi-module picker** — the widget fetches your active modules and lets the user pick which one to start (onboarding, demo, support, etc.), so a single embed covers every use case
|
|
9
10
|
- **Real-time voice** — two-way audio with live transcription
|
|
10
11
|
- **Capture modes** — `screenshare` (user shares screen) or `auto` (DOM capture)
|
|
11
|
-
- **Agent controls** — opt-in capabilities like element highlighting (auto mode only)
|
|
12
|
+
- **Agent controls** — opt-in capabilities like element highlighting, configured per module (auto mode only)
|
|
12
13
|
- **Chat + transcript** — text messaging with voice transcripts merged into one thread
|
|
13
14
|
- **Session agenda** — structured phases with progress tracking
|
|
14
15
|
- **Flexible auth** — email OTP (direct auth) or backend-signed JWT (secret mode)
|
|
@@ -17,11 +18,13 @@ Embed an autonomous product specialist that sees, speaks, and acts in real time
|
|
|
17
18
|
|
|
18
19
|
## Prerequisites
|
|
19
20
|
|
|
20
|
-
You need an `
|
|
21
|
+
You need an `appKey` from the [Skippr Platform](https://specialist.skippr.ai/).
|
|
21
22
|
|
|
22
23
|
1. **Sign up** at [specialist.skippr.ai](https://specialist.skippr.ai/)
|
|
23
|
-
2. **Create an agent
|
|
24
|
-
3. **Create an App Key** in Settings and copy the `appKey` — one App Key works for all your
|
|
24
|
+
2. **Create your modules** in the dashboard — for example an `onboarding` agent to walk new users through setup and a `support` module for help. Every active module shows up in the widget's picker automatically.
|
|
25
|
+
3. **Create an App Key** in Settings and copy the `appKey` — one App Key works for all your modules
|
|
26
|
+
|
|
27
|
+
Optionally, you can pin the widget to a single module by passing its id as `agentId` (see [Pinning](#pinning-to-a-specific-module) below). Without it, the user picks from all active modules at runtime.
|
|
25
28
|
|
|
26
29
|
## Installation
|
|
27
30
|
|
|
@@ -39,7 +42,6 @@ No install needed. Add this to any webpage:
|
|
|
39
42
|
<script src="https://unpkg.com/@skippr/live-agent-sdk/dist/skippr-sdk.js"></script>
|
|
40
43
|
<script>
|
|
41
44
|
Skippr.initialize({
|
|
42
|
-
agentId: 'your_agent_id',
|
|
43
45
|
appKey: 'pk_live_your_key',
|
|
44
46
|
});
|
|
45
47
|
</script>
|
|
@@ -47,6 +49,8 @@ No install needed. Add this to any webpage:
|
|
|
47
49
|
|
|
48
50
|
## Quick Start
|
|
49
51
|
|
|
52
|
+
The widget opens with a picker of your active modules — the user chooses which one to start a session with.
|
|
53
|
+
|
|
50
54
|
### React
|
|
51
55
|
|
|
52
56
|
```tsx
|
|
@@ -54,12 +58,7 @@ import { LiveAgent } from '@skippr/live-agent-sdk';
|
|
|
54
58
|
import '@skippr/live-agent-sdk/styles';
|
|
55
59
|
|
|
56
60
|
function App() {
|
|
57
|
-
return
|
|
58
|
-
<LiveAgent
|
|
59
|
-
agentId="your_agent_id"
|
|
60
|
-
appKey="pk_live_your_key"
|
|
61
|
-
/>
|
|
62
|
-
);
|
|
61
|
+
return <LiveAgent appKey="pk_live_your_key" />;
|
|
63
62
|
}
|
|
64
63
|
```
|
|
65
64
|
|
|
@@ -69,12 +68,19 @@ function App() {
|
|
|
69
68
|
<script src="https://unpkg.com/@skippr/live-agent-sdk/dist/skippr-sdk.js"></script>
|
|
70
69
|
<script>
|
|
71
70
|
Skippr.initialize({
|
|
72
|
-
agentId: 'your_agent_id',
|
|
73
71
|
appKey: 'pk_live_your_key',
|
|
74
72
|
});
|
|
75
73
|
</script>
|
|
76
74
|
```
|
|
77
75
|
|
|
76
|
+
### Pinning to a specific module
|
|
77
|
+
|
|
78
|
+
If you want to skip the picker and always open straight into one module, pass its id as `agentId`:
|
|
79
|
+
|
|
80
|
+
```tsx
|
|
81
|
+
<LiveAgent appKey="pk_live_your_key" agentId="your_module_id" />
|
|
82
|
+
```
|
|
83
|
+
|
|
78
84
|
## Authentication
|
|
79
85
|
|
|
80
86
|
The SDK supports two identity modes, configured per App Key in the Skippr dashboard.
|
|
@@ -86,14 +92,13 @@ Users log in via email OTP inside the widget. No backend integration needed. The
|
|
|
86
92
|
**React:**
|
|
87
93
|
|
|
88
94
|
```tsx
|
|
89
|
-
<LiveAgent
|
|
95
|
+
<LiveAgent appKey="pk_live_your_key" />
|
|
90
96
|
```
|
|
91
97
|
|
|
92
98
|
**Script tag:**
|
|
93
99
|
|
|
94
100
|
```js
|
|
95
101
|
Skippr.initialize({
|
|
96
|
-
agentId: 'your_agent_id',
|
|
97
102
|
appKey: 'pk_live_your_key',
|
|
98
103
|
});
|
|
99
104
|
```
|
|
@@ -135,7 +140,6 @@ const userToken = jwt.sign(
|
|
|
135
140
|
|
|
136
141
|
```tsx
|
|
137
142
|
<LiveAgent
|
|
138
|
-
agentId="your_agent_id"
|
|
139
143
|
appKey="pk_live_your_key"
|
|
140
144
|
userToken={userToken}
|
|
141
145
|
/>
|
|
@@ -145,7 +149,6 @@ const userToken = jwt.sign(
|
|
|
145
149
|
|
|
146
150
|
```js
|
|
147
151
|
Skippr.initialize({
|
|
148
|
-
agentId: 'your_agent_id',
|
|
149
152
|
appKey: 'pk_live_your_key',
|
|
150
153
|
userToken: 'eyJhbGciOiJIUzI1NiIs...',
|
|
151
154
|
});
|
|
@@ -167,7 +170,7 @@ function ConnectionStatus() {
|
|
|
167
170
|
|
|
168
171
|
function App() {
|
|
169
172
|
return (
|
|
170
|
-
<LiveAgent
|
|
173
|
+
<LiveAgent appKey="pk_live_your_key">
|
|
171
174
|
<ConnectionStatus />
|
|
172
175
|
</LiveAgent>
|
|
173
176
|
);
|
|
@@ -184,18 +187,18 @@ Self-contained widget component. Renders a floating button that opens a sidebar
|
|
|
184
187
|
|
|
185
188
|
| Prop | Type | Default | Description |
|
|
186
189
|
|------|------|---------|-------------|
|
|
187
|
-
| `agentId` | `string` | *required* | Agent ID from the Skippr dashboard |
|
|
188
190
|
| `appKey` | `string` | *required* | Publishable App Key from the Skippr dashboard |
|
|
191
|
+
| `agentId` | `string` | — | Pin the widget to a specific module (pass that module's id). Omit to let the user pick from all your active modules at runtime. |
|
|
189
192
|
| `userToken` | `string` | — | Signed JWT for secret mode identity verification |
|
|
190
193
|
| `position` | `'left' \| 'right'` | `'right'` | Side of the screen for the widget |
|
|
191
194
|
| `variant` | `'floating' \| 'sidebar'` | `'floating'` | Widget display mode |
|
|
192
195
|
| `minimizable` | `boolean` | `true` | Whether the widget can be minimized |
|
|
193
196
|
| `defaultOpen` | `boolean` | `false` | Whether the panel starts open |
|
|
194
197
|
| `welcomeMessage` | `string` | — | Message shown on the minimized bubble |
|
|
195
|
-
| `startSessionLabel` | `string` | `'Talk to Skippr'` | Label for the start-session button |
|
|
198
|
+
| `startSessionLabel` | `string` | `'Talk to Skippr'` | Label for the start-session button (only shown when `agentId` is pinned) |
|
|
196
199
|
| `autoFocusChat` | `boolean` | `true` | Whether the chat input auto-focuses when opened |
|
|
197
|
-
| `captureMode` | `'screenshare' \| 'auto'` | `'screenshare'` | How the agent sees the page
|
|
198
|
-
| `agentControls` | `{ highlight?: boolean }` | — | Opt-in agent capabilities (e.g. element highlighting). **Requires `captureMode: 'auto'
|
|
200
|
+
| `captureMode` | `'screenshare' \| 'auto'` | `'screenshare'` | How the agent sees the page — `'screenshare'` prompts the user to share, `'auto'` uses DOM capture (no permission prompt) |
|
|
201
|
+
| `agentControls` | `{ highlight?: boolean }` | — | Opt-in agent capabilities (e.g. element highlighting). **Requires `captureMode: 'auto'`** and only applies when `agentId` is pinned. In picker mode, controls are configured per module in the dashboard. |
|
|
199
202
|
|
|
200
203
|
### `useLiveAgent()`
|
|
201
204
|
|
|
@@ -206,19 +209,42 @@ Hook for accessing session state and panel controls. Must be called within `<Liv
|
|
|
206
209
|
| Field | Type | Description |
|
|
207
210
|
|-------|------|-------------|
|
|
208
211
|
| `isConnected` | `boolean` | Whether the agent is connected |
|
|
209
|
-
| `isStarting` | `boolean` | Whether a session is being created |
|
|
212
|
+
| `isStarting` | `boolean` | Whether a session is being created or resumed |
|
|
213
|
+
| `isDisconnecting` | `boolean` | Whether the session is being torn down |
|
|
214
|
+
| `isPausing` | `boolean` | Whether a pause request is in flight (before `isPaused` commits) |
|
|
215
|
+
| `isPaused` | `boolean` | Whether the current session is paused |
|
|
216
|
+
| `resumableSession` | `{ id: string } \| null` | The pinned agent's most recent paused session, or `null` |
|
|
217
|
+
| `resumableSessions` | `{ id: string; agentId: string }[]` | All of the user's paused sessions (one per agent), for module pickers |
|
|
210
218
|
| `isPanelOpen` | `boolean` | Whether the panel is currently open |
|
|
211
219
|
| `isMinimized` | `boolean` | Whether the widget is minimized |
|
|
212
220
|
| `isAuthenticated` | `boolean` | Whether the user is authenticated |
|
|
213
221
|
| `variant` | `'floating' \| 'sidebar'` | Current widget display mode |
|
|
214
222
|
| `position` | `'left' \| 'right'` | Current widget position |
|
|
215
223
|
| `error` | `string` | Error message, if any |
|
|
224
|
+
| `hasModuleSelector` | `boolean` | Whether the widget is in picker mode |
|
|
225
|
+
| `availableModules` | `Module[]` | Modules fetched for the picker |
|
|
226
|
+
| `activeModule` | `Module \| null` | The module the current session was started with |
|
|
227
|
+
| `isLoadingModules` | `boolean` | Whether the picker list is being fetched |
|
|
228
|
+
| `modulesError` | `string \| null` | Error from fetching the picker list, if any |
|
|
229
|
+
|
|
230
|
+
```ts
|
|
231
|
+
interface Module {
|
|
232
|
+
id: string;
|
|
233
|
+
name: string;
|
|
234
|
+
description: string | null;
|
|
235
|
+
type: string;
|
|
236
|
+
priority: number;
|
|
237
|
+
controls: { highlight?: boolean };
|
|
238
|
+
}
|
|
239
|
+
```
|
|
216
240
|
|
|
217
241
|
#### Methods
|
|
218
242
|
|
|
219
243
|
| Method | Type | Description |
|
|
220
244
|
|--------|------|-------------|
|
|
221
|
-
| `startSession` | `() => Promise<void>` | Start a new agent session |
|
|
245
|
+
| `startSession` | `(opts: { agentId: string; agentControls?: { highlight?: boolean } }) => Promise<void>` | Start a new agent session |
|
|
246
|
+
| `pauseSession` | `() => Promise<void>` | Pause the active session and disconnect from LiveKit; resumable later |
|
|
247
|
+
| `resumeSession` | `() => Promise<void>` | Resume the pinned agent's paused session, reconnecting to continue |
|
|
222
248
|
| `disconnect` | `() => Promise<void>` | End the current session |
|
|
223
249
|
| `openPanel` | `() => void` | Open the panel |
|
|
224
250
|
| `closePanel` | `() => void` | Close the panel |
|
|
@@ -226,6 +252,8 @@ Hook for accessing session state and panel controls. Must be called within `<Liv
|
|
|
226
252
|
| `expandPanel` | `() => void` | Expand from minimized state |
|
|
227
253
|
| `minimizePanel` | `() => void` | Minimize the widget |
|
|
228
254
|
| `setPosition` | `(position: 'left' \| 'right') => void` | Change widget position |
|
|
255
|
+
| `selectModule` | `(id: string) => void` | Start a session with the module of the given id |
|
|
256
|
+
| `refetchModules` | `() => Promise<void>` | Refetch the picker list |
|
|
229
257
|
|
|
230
258
|
### Additional Hooks
|
|
231
259
|
|
|
@@ -250,7 +278,7 @@ Available on `window.Skippr` when using the script tag bundle.
|
|
|
250
278
|
|
|
251
279
|
| Method | Description |
|
|
252
280
|
|--------|-------------|
|
|
253
|
-
| `Skippr.initialize(config)` | Mount the widget. Accepts `
|
|
281
|
+
| `Skippr.initialize(config)` | Mount the widget. Accepts `appKey` (required), `agentId` (optional — omit for picker), `userToken`, `position`, `variant`, `minimizable`, `captureMode`, `agentControls`. |
|
|
254
282
|
| `Skippr.logout()` | Clear stored auth token and show the login form (direct auth mode) |
|
|
255
283
|
| `Skippr.destroy()` | Remove the widget from the page and clear auth tokens |
|
|
256
284
|
|