@skippr/live-agent-sdk 0.106.0 → 0.108.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
@@ -232,7 +232,30 @@ function App() {
232
232
 
233
233
  ### Splash screen
234
234
 
235
- When your workspace selects the `Template` launcher style under Appearance, the SDK shows a pre-session card instead of the launcher bubble: what the agent can do, the microphone and screen-access rows it needs, and a Start / Continue button. Script-tag embeds get it as a centred overlay automatically. In React you place it yourself, anywhere inside `<LiveAgent>`:
235
+ When your workspace selects the `Template` launcher style under Appearance, the SDK shows a pre-session card instead of the launcher bubble: what the agent can do, the microphone and screen-access rows it needs, and a Start / Continue button. Script-tag embeds get it automatically. In React, drop `<SplashOverlay>` anywhere inside `<LiveAgent>`:
236
+
237
+ ```tsx
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. |
255
+
256
+ #### Placing the card yourself
257
+
258
+ Use `<SplashScreen>` instead when you 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:
236
259
 
237
260
  ```tsx
238
261
  import { useState } from 'react';
@@ -260,11 +283,14 @@ function App() {
260
283
 
261
284
  - **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.
262
285
  - **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.
286
+
287
+ #### Behaviour of both
288
+
289
+ - **Render exactly one.** Each instance keeps its own microphone and screen state; the SDK warns in the console when a second one mounts, or when the splash is enabled and neither component is placed.
263
290
  - **Session start needs no callback.** `useLiveAgent()` already reports `isStarting` / `isConnected`, so read the session from there rather than mirroring it into your own state.
264
- - **Render exactly one.** Each instance keeps its own microphone and screen state; the SDK warns in the console when a second one mounts, or when the splash is enabled and none is placed.
265
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 bubble; the host owns when the card comes back.
266
- - **Want the centred treatment instead?** Render `<SplashOverlay>` (also exported) for the same backdrop-and-centred card the script-tag embed gets; use the bare `<SplashScreen>` when you want it inline in your own layout. It takes optional `width` (px) and `maxHeight` (% of viewport height) to override the card size your workspace configured; both are clamped to the supported range.
267
292
  - **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, both components render 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.
268
294
 
269
295
  ## API Reference
270
296