@skippr/live-agent-sdk 0.32.0 → 0.34.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 CHANGED
@@ -2,13 +2,14 @@
2
2
 
3
3
  [![Website](https://img.shields.io/badge/Website-skippr.ai-blue)](https://skippr.ai) [![NPM Version](https://img.shields.io/npm/v/%40skippr%2Flive-agent-sdk?color=red)](https://www.npmjs.com/package/@skippr/live-agent-sdk)
4
4
 
5
- Embed an autonomous product specialist that sees, speaks, and acts in real time — handling demos, onboarding, training, and support inside your app with a single React component or script tag.
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 `agentId` and `appKey` from the [Skippr Platform](https://specialist.skippr.ai/).
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** and copy the `agentId` from the agent details page
24
- 3. **Create an App Key** in Settings and copy the `appKey` — one App Key works for all your agents
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 agentId="your_agent_id" appKey="pk_live_your_key" />
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 agentId="your_agent_id" appKey="pk_live_your_key">
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 - `'screenshare'` prompts the user to share, `'auto'` uses DOM capture (no permission prompt) |
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
 
@@ -213,12 +216,28 @@ Hook for accessing session state and panel controls. Must be called within `<Liv
213
216
  | `variant` | `'floating' \| 'sidebar'` | Current widget display mode |
214
217
  | `position` | `'left' \| 'right'` | Current widget position |
215
218
  | `error` | `string` | Error message, if any |
219
+ | `hasModuleSelector` | `boolean` | Whether the widget is in picker mode |
220
+ | `availableModules` | `Module[]` | Modules fetched for the picker |
221
+ | `activeModule` | `Module \| null` | The module the current session was started with |
222
+ | `isLoadingModules` | `boolean` | Whether the picker list is being fetched |
223
+ | `modulesError` | `string \| null` | Error from fetching the picker list, if any |
224
+
225
+ ```ts
226
+ interface Module {
227
+ id: string;
228
+ name: string;
229
+ description: string | null;
230
+ type: string;
231
+ priority: number;
232
+ controls: { highlight?: boolean };
233
+ }
234
+ ```
216
235
 
217
236
  #### Methods
218
237
 
219
238
  | Method | Type | Description |
220
239
  |--------|------|-------------|
221
- | `startSession` | `() => Promise<void>` | Start a new agent session |
240
+ | `startSession` | `(opts: { agentId: string; agentControls?: { highlight?: boolean } }) => Promise<void>` | Start a new agent session |
222
241
  | `disconnect` | `() => Promise<void>` | End the current session |
223
242
  | `openPanel` | `() => void` | Open the panel |
224
243
  | `closePanel` | `() => void` | Close the panel |
@@ -226,6 +245,8 @@ Hook for accessing session state and panel controls. Must be called within `<Liv
226
245
  | `expandPanel` | `() => void` | Expand from minimized state |
227
246
  | `minimizePanel` | `() => void` | Minimize the widget |
228
247
  | `setPosition` | `(position: 'left' \| 'right') => void` | Change widget position |
248
+ | `selectModule` | `(id: string) => void` | Start a session with the module of the given id |
249
+ | `refetchModules` | `() => Promise<void>` | Refetch the picker list |
229
250
 
230
251
  ### Additional Hooks
231
252
 
@@ -250,7 +271,7 @@ Available on `window.Skippr` when using the script tag bundle.
250
271
 
251
272
  | Method | Description |
252
273
  |--------|-------------|
253
- | `Skippr.initialize(config)` | Mount the widget. Accepts `agentId`, `appKey`, `userToken`, `position`, `variant`, `minimizable`, `captureMode`, `agentControls`. |
274
+ | `Skippr.initialize(config)` | Mount the widget. Accepts `appKey` (required), `agentId` (optional — omit for picker), `userToken`, `position`, `variant`, `minimizable`, `captureMode`, `agentControls`. |
254
275
  | `Skippr.logout()` | Clear stored auth token and show the login form (direct auth mode) |
255
276
  | `Skippr.destroy()` | Remove the widget from the page and clear auth tokens |
256
277