@skippr/live-agent-sdk 0.108.0 → 0.110.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 +10 -24
- package/dist/esm/lib-exports.js +4012 -3726
- package/dist/skippr-sdk.css +1 -1
- package/dist/skippr-sdk.js +155 -155
- package/dist/types/components/Sidebar.d.ts +1 -1
- package/dist/types/components/SplashAlwaysOn.d.ts +6 -1
- package/dist/types/components/SplashOptOut.d.ts +5 -0
- package/dist/types/components/SplashOverlay.d.ts +3 -5
- package/dist/types/components/SplashPanel.d.ts +1 -0
- package/dist/types/components/SplashPrimary.d.ts +6 -1
- package/dist/types/components/SplashScreen.d.ts +1 -1
- package/dist/types/context/LiveAgentContext.d.ts +18 -5
- package/dist/types/hooks/useAvailableModules.d.ts +1 -0
- package/dist/types/hooks/useSessionHold.d.ts +1 -1
- package/dist/types/hooks/useSplash.d.ts +2 -2
- package/dist/types/hooks/useSplashMedia.d.ts +14 -0
- package/dist/types/hooks/useSplashOverlayOptOut.d.ts +7 -0
- package/dist/types/lib/constants.d.ts +24 -1
- package/dist/types/lib/panelAnchor.d.ts +14 -0
- package/dist/types/lib/splashStyles.d.ts +3 -0
- package/dist/types/lib/splashSurfaces.d.ts +22 -0
- package/dist/types/lib/voiceBar.d.ts +1 -0
- package/dist/types/lib-exports.d.ts +0 -1
- package/package.json +1 -1
- package/dist/types/hooks/useHighlightControl.d.ts +0 -6
package/README.md
CHANGED
|
@@ -232,30 +232,13 @@ function App() {
|
|
|
232
232
|
|
|
233
233
|
### Splash screen
|
|
234
234
|
|
|
235
|
-
When your workspace
|
|
235
|
+
When your workspace turns the splash on under Appearance, the SDK shows a pre-session card before the session starts: what the agent can do, the microphone and screen-access rows it needs, and a Start / Continue button. It is independent of the launcher style, so you can run both or turn the launcher off and let the card be the entry point.
|
|
236
236
|
|
|
237
|
-
|
|
238
|
-
import { LiveAgent, SplashOverlay } from '@skippr/live-agent-sdk';
|
|
239
|
-
|
|
240
|
-
function App() {
|
|
241
|
-
return (
|
|
242
|
-
<LiveAgent appKey="pk_live_your_key">
|
|
243
|
-
<SplashOverlay />
|
|
244
|
-
</LiveAgent>
|
|
245
|
-
);
|
|
246
|
-
}
|
|
247
|
-
```
|
|
248
|
-
|
|
249
|
-
It centres the card over a backdrop and handles its own dismissal, so there is nothing to wire up, and it renders nothing when your workspace has the splash turned off, so it is safe to leave in place either way.
|
|
250
|
-
|
|
251
|
-
| Prop | Type | Description |
|
|
252
|
-
|------|------|-------------|
|
|
253
|
-
| `width` | `number` | Card width in px, overriding the width configured for your workspace. Clamped to the supported range. |
|
|
254
|
-
| `maxHeight` | `number` | Card height as a percentage of the viewport height, overriding the configured value. Also clamped. |
|
|
237
|
+
There is nothing for you to place. Every embed gets the card — script tag and React alike — and your workspace also chooses where it appears: centred over the page on its own backdrop, or inside the chat panel. The SDK renders it either way and handles its own dismissal.
|
|
255
238
|
|
|
256
239
|
#### Placing the card yourself
|
|
257
240
|
|
|
258
|
-
Use `<SplashScreen>`
|
|
241
|
+
Use `<SplashScreen>` when you also want the card inline in your own layout — a sidebar, a grid cell, a panel, rather than centred over the page. In exchange for the placement control, you own the surrounding state:
|
|
259
242
|
|
|
260
243
|
```tsx
|
|
261
244
|
import { useState } from 'react';
|
|
@@ -283,14 +266,16 @@ function App() {
|
|
|
283
266
|
|
|
284
267
|
- **You own unmounting.** `<SplashScreen>` renders nothing once it no longer applies — the user dismissed it, a session is running, or your workspace has the splash turned off — but it stays mounted until you remove it.
|
|
285
268
|
- **Conditionally render your own wrapper too.** A styled slot (padding, border, grid cell) survives as an empty box when the card stops rendering, as in the example above.
|
|
269
|
+
- **It follows the workspace placement.** `<SplashScreen>` renders while your workspace shows the splash over the page. When the workspace moves the splash into the chat panel, the panel renders the card and `<SplashScreen>` renders nothing.
|
|
270
|
+
- **It only shows while the widget is closed.** The splash and the open widget panel never share the screen, so `<SplashScreen>` renders nothing once the user opens the panel and returns when they close it again.
|
|
286
271
|
|
|
287
272
|
#### Behaviour of both
|
|
288
273
|
|
|
289
|
-
- **
|
|
274
|
+
- **Dismissal is shared.** Closing or skipping either card dismisses the splash for the page load, so the SDK's own card and any `<SplashScreen>` you place come and go together.
|
|
290
275
|
- **Session start needs no callback.** `useLiveAgent()` already reports `isStarting` / `isConnected`, so read the session from there rather than mirroring it into your own state.
|
|
291
|
-
- **Bring it back after a skip.** Dismissal lasts for the page load, so the card returns on the next navigation. On a single-page app, call `reopenSplash()` from `useLiveAgent()` — wire it to a "Start guided tour" link or a help-menu item. Skipping never reveals a launcher
|
|
276
|
+
- **Bring it back after a skip.** Dismissal lasts for the page load, so the card returns on the next navigation. On a single-page app, call `reopenSplash()` from `useLiveAgent()` — wire it to a "Start guided tour" link or a help-menu item. Skipping never reveals a launcher that your workspace has turned off; the host owns when the card comes back.
|
|
292
277
|
- **Check the config before you build around it.** `useLiveAgent()` exposes `isSplashConfigured` so you can pick between the splash and your own launcher; it reflects the workspace setting only, not whether the card is on screen right now.
|
|
293
|
-
- **The card adapts to the agent.** When your workspace's default agent is an always-on expert,
|
|
278
|
+
- **The card adapts to the agent.** When your workspace's default agent is an always-on expert, the card renders a tips layout instead of the guided-tour one: contextual suggestions for the current page, each starting a session on click, plus a catch-all CTA. No prop switches this — it follows the agent configuration.
|
|
294
279
|
|
|
295
280
|
## API Reference
|
|
296
281
|
|
|
@@ -340,7 +325,7 @@ Hook for accessing session state and panel controls. Must be called within `<Liv
|
|
|
340
325
|
| `activeModule` | `Module \| null` | The module the current session was started with |
|
|
341
326
|
| `isLoadingModules` | `boolean` | Whether the picker list is being fetched |
|
|
342
327
|
| `modulesError` | `string \| null` | Error from fetching the picker list, if any |
|
|
343
|
-
| `isSplashConfigured` | `boolean` | Whether your workspace
|
|
328
|
+
| `isSplashConfigured` | `boolean` | Whether your workspace has the splash screen turned on. Configuration only — it does not tell you whether the splash is currently on screen |
|
|
344
329
|
|
|
345
330
|
```ts
|
|
346
331
|
interface Module {
|
|
@@ -396,6 +381,7 @@ Available on `window.Skippr` when using the script tag bundle.
|
|
|
396
381
|
| Method | Description |
|
|
397
382
|
|--------|-------------|
|
|
398
383
|
| `Skippr.initialize(config)` | Mount the widget. Accepts `appKey` (required), `agentId` (optional — omit for picker), `getUserToken`, `userToken`, `variant`, `minimizable`, `captureMode`. |
|
|
384
|
+
| `Skippr.open()` | Surface the widget from your own button. Brings back a skipped splash screen, opens the chat panel when the splash lives in it, and otherwise reveals the voice bar. The only entry point when your workspace has the launcher turned off |
|
|
399
385
|
| `Skippr.logout()` | Revoke the current session server-side, clear stored auth tokens, and show the login form (direct auth mode) |
|
|
400
386
|
| `Skippr.destroy()` | Remove the widget from the page and clear auth tokens |
|
|
401
387
|
|