@skippr/live-agent-sdk 0.110.0 → 0.112.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 +14 -1
- package/dist/esm/lib-exports.js +440 -387
- package/dist/skippr-sdk.css +1 -1
- package/dist/skippr-sdk.js +141 -141
- package/dist/types/components/ConsentBubble.d.ts +2 -2
- package/dist/types/components/ConsentNotice.d.ts +2 -3
- package/dist/types/components/LiveAgent.d.ts +1 -0
- package/dist/types/components/VoiceBarFrame.d.ts +1 -1
- package/dist/types/context/LiveAgentContext.d.ts +2 -1
- package/dist/types/hooks/useAvailableModules.d.ts +2 -1
- package/dist/types/hooks/useVoiceBarDrag.d.ts +1 -1
- package/dist/types/lib/constants.d.ts +19 -0
- package/dist/types/lib/locale.d.ts +2 -0
- package/dist/types/lib/splashPresentation.d.ts +1 -0
- package/dist/types/lib/voiceBar.d.ts +6 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -13,6 +13,7 @@ Embed product specialists that see, speak, and act in real time. Configure **mod
|
|
|
13
13
|
- **Bring your own button** — start, pause, and end sessions from your own UI with the `useLiveAgent` hook (see [Bring your own button](#bring-your-own-button))
|
|
14
14
|
- **Chat + transcript** — text messaging with voice transcripts merged into one thread
|
|
15
15
|
- **Session agenda** — structured phases with progress tracking
|
|
16
|
+
- **Seven languages, no wiring** — the splash card ships translated and follows your page's `<html lang>` on its own (see [Language](#language))
|
|
16
17
|
- **Flexible auth** — email OTP (direct auth) or backend-signed JWT (secret mode)
|
|
17
18
|
- **Drop-in integration** — one React component or script tag, no WebRTC code needed
|
|
18
19
|
- **Host-safe styles** — prefixed CSS that won't conflict with your app
|
|
@@ -236,6 +237,17 @@ When your workspace turns the splash on under Appearance, the SDK shows a pre-se
|
|
|
236
237
|
|
|
237
238
|
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.
|
|
238
239
|
|
|
240
|
+
#### Language
|
|
241
|
+
|
|
242
|
+
The card is translated into English, French, German, Italian, Spanish, and Portuguese (Portugal and Brazil). A page that says `<html lang="de">` renders a German card with no code change — the SDK reads `<html lang>`, then the browser preference. Pass `locale` only when `<html lang>` does not reflect the language on screen:
|
|
243
|
+
|
|
244
|
+
```tsx
|
|
245
|
+
<LiveAgent appKey="pk_live_your_key" locale="pt-BR" />
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
- **Any BCP-47 tag works.** `'de-AT'` and `'pt'` both resolve; a language Skippr does not ship falls back to English rather than failing.
|
|
249
|
+
- **You can rewrite any string, per language.** Pick a card language in the splash editor under Appearance. Fields you leave alone keep Skippr's translation, so clearing one restores it rather than blanking it. That includes the default capability rows — edit a row's English and set its copy for each language too, or those languages keep the original row's translation.
|
|
250
|
+
|
|
239
251
|
#### Placing the card yourself
|
|
240
252
|
|
|
241
253
|
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:
|
|
@@ -292,6 +304,7 @@ Self-contained widget component. Renders a floating button that opens a sidebar
|
|
|
292
304
|
| `getUserToken` | `() => Promise<string>` | — | Async callback returning a freshly signed JWT for secret mode. The SDK calls it to bootstrap, again proactively before the bearer expires, and once more on a `401` to re-bootstrap. |
|
|
293
305
|
| `userToken` | `string` | — | Static signed JWT for secret mode (testing). Exchanged for a bearer token but can't be refreshed once expired. `getUserToken` takes precedence when both are set. |
|
|
294
306
|
| `userContext` | `Record<string, string \| number \| boolean>` | — | Background facts about the current user so the agent can tailor the conversation (e.g. `{ name: 'Alex', plan: 'pro', signedUpDaysAgo: 3, hasCompletedSetup: false }`). Must be a flat object of strings, numbers, or booleans - nested objects and arrays are not supported. |
|
|
307
|
+
| `locale` | `string` | — | BCP-47 tag naming the language to render the splash card in, e.g. `'de'` or `'pt-BR'`. Only needed when your page's `<html lang>` does not reflect the language on screen — otherwise the card follows `<html lang>`, then the browser preference, with no configuration at all. A language Skippr does not ship falls back to English. |
|
|
295
308
|
| `variant` | `'floating' \| 'sidebar'` | `'floating'` | Widget display mode |
|
|
296
309
|
| `minimizable` | `boolean` | `true` | Whether the widget can be minimized |
|
|
297
310
|
| `defaultOpen` | `boolean` | `false` | Whether the panel starts open |
|
|
@@ -380,7 +393,7 @@ Available on `window.Skippr` when using the script tag bundle.
|
|
|
380
393
|
|
|
381
394
|
| Method | Description |
|
|
382
395
|
|--------|-------------|
|
|
383
|
-
| `Skippr.initialize(config)` | Mount the widget. Accepts `appKey` (required), `agentId` (optional — omit for picker), `getUserToken`, `userToken`, `variant`, `minimizable`, `captureMode`. |
|
|
396
|
+
| `Skippr.initialize(config)` | Mount the widget. Accepts `appKey` (required), `agentId` (optional — omit for picker), `getUserToken`, `userToken`, `userContext`, `locale`, `variant`, `minimizable`, `captureMode`. |
|
|
384
397
|
| `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 |
|
|
385
398
|
| `Skippr.logout()` | Revoke the current session server-side, clear stored auth tokens, and show the login form (direct auth mode) |
|
|
386
399
|
| `Skippr.destroy()` | Remove the widget from the page and clear auth tokens |
|