@moveo-ai/web-client 0.110.0-true.1 → 0.110.0-true.11
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 +113 -5
- package/dist/63.min.js.LICENSE.txt +1 -1
- package/dist/752.min.js.LICENSE.txt +1 -1
- package/dist/882.min.js.LICENSE.txt +1 -1
- package/dist/929.min.js.LICENSE.txt +1 -1
- package/dist/audio-client.min.js +1 -1
- package/dist/audio-client.min.js.LICENSE.txt +1 -1
- package/dist/iframe.min.js +1 -1
- package/dist/iframe.min.js.LICENSE.txt +1 -1
- package/dist/index.html +1 -1
- package/dist/preview/index.html +2 -2
- package/dist/preview.css.min.js.LICENSE.txt +1 -1
- package/dist/public/locales/ar.json +34 -6
- package/dist/public/locales/bg.json +34 -6
- package/dist/public/locales/cs.json +33 -5
- package/dist/public/locales/da.json +34 -6
- package/dist/public/locales/de.json +33 -5
- package/dist/public/locales/el.json +35 -7
- package/dist/public/locales/en.json +33 -5
- package/dist/public/locales/es.json +33 -5
- package/dist/public/locales/fr.json +33 -5
- package/dist/public/locales/id.json +33 -5
- package/dist/public/locales/it.json +34 -6
- package/dist/public/locales/ja.json +33 -5
- package/dist/public/locales/me.json +34 -6
- package/dist/public/locales/nl-be.json +33 -5
- package/dist/public/locales/nl.json +33 -5
- package/dist/public/locales/pl.json +33 -5
- package/dist/public/locales/pt-br.json +33 -5
- package/dist/public/locales/pt.json +33 -5
- package/dist/public/locales/ro.json +33 -5
- package/dist/public/locales/ru.json +33 -5
- package/dist/public/locales/sq.json +33 -5
- package/dist/public/locales/sr.json +34 -6
- package/dist/public/locales/sv.json +33 -5
- package/dist/public/locales/tl.json +34 -6
- package/dist/public/locales/tr.json +33 -5
- package/dist/public/locales/zh.json +33 -5
- package/dist/telnyx-client.min.js +1 -1
- package/dist/telnyx-client.min.js.LICENSE.txt +1 -1
- package/dist/web-client.min.js +1 -1
- package/dist/web-client.min.js.LICENSE.txt +1 -1
- package/dist/webrtc-client.min.js +1 -1
- package/dist/webrtc-client.min.js.LICENSE.txt +1 -1
- package/package.json +10 -3
- package/web-client.d.ts +1 -1
package/README.md
CHANGED
|
@@ -215,13 +215,51 @@ payload listed below.
|
|
|
215
215
|
| `onNoUnreadMessages(cb)` | The unread indicator clears | — |
|
|
216
216
|
| `onUserActivity(cb)` | The visitor interacts with the widget | — |
|
|
217
217
|
| `onMemberLeave(cb)` | An agent leaves the conversation | — |
|
|
218
|
-
| `onAnalyticsEvent(cb)` |
|
|
218
|
+
| `onAnalyticsEvent(cb)` | The widget loads, and every interaction | `{ timestamp, event, session_id?, properties }` |
|
|
219
219
|
|
|
220
220
|
`onAnalyticsEvent` receives every interaction the widget tracks, identified by
|
|
221
221
|
the `event` field: `session_start`, `session_end`, `message_sent` (the user sent
|
|
222
222
|
a message — never carries the text), `launcher_clicked`, `rating_submitted`, and
|
|
223
223
|
the rest of the `AnalyticsEvent` enum in `src/hooks/useAnalytics.ts`.
|
|
224
224
|
|
|
225
|
+
It also receives one event that is not an interaction: **`widget_loaded`**,
|
|
226
|
+
raised as soon as the widget renders on the page. It carries no `session_id`,
|
|
227
|
+
because a session opens only when the visitor opens the chat. Register the
|
|
228
|
+
callback at any time — a callback added after the widget loaded still receives
|
|
229
|
+
`widget_loaded` on registration, so the event cannot be missed in the race
|
|
230
|
+
between `init()` resolving and your `.then()` running.
|
|
231
|
+
|
|
232
|
+
#### How the header controls end a conversation
|
|
233
|
+
|
|
234
|
+
Two header controls can end a conversation, and they report differently.
|
|
235
|
+
|
|
236
|
+
**The close button (X)** asks first. Once the conversation has messages, it
|
|
237
|
+
opens a confirmation offering **End conversation** and **Minimize**. Ending
|
|
238
|
+
runs the end-of-chat survey when the account has one. On an empty chat, or
|
|
239
|
+
while a prompt or webview owns the panel, it just hides the panel. Set
|
|
240
|
+
`close_minimizes_window: true` and the button always minimizes and never ends.
|
|
241
|
+
|
|
242
|
+
**Restart**, in the header title menu, does not ask. It ends the conversation
|
|
243
|
+
and opens the next one in place, with the panel still open, and shows no
|
|
244
|
+
end-of-chat survey.
|
|
245
|
+
|
|
246
|
+
During a voice call the close button ends the call, after its own confirmation.
|
|
247
|
+
|
|
248
|
+
Which event to count:
|
|
249
|
+
|
|
250
|
+
| Event | Fires when | Means the conversation ended |
|
|
251
|
+
| ----------------------------------- | ---------------------------------------------------------- | ---------------------------- |
|
|
252
|
+
| `close_icon_clicked` | The visitor presses X, before they answer the confirmation | No |
|
|
253
|
+
| `popover_end_chat_clicked` | They confirm **End conversation** | Yes |
|
|
254
|
+
| `popover_end_chat_continue_clicked` | They pick **Minimize** instead | No |
|
|
255
|
+
| `restart_conversation_clicked` | They pick **Restart** from the menu | Yes |
|
|
256
|
+
|
|
257
|
+
Add `popover_end_chat_clicked` and `restart_conversation_clicked` for the
|
|
258
|
+
number of conversations visitors ended themselves. `close_icon_clicked` counts
|
|
259
|
+
presses, not conversations: count it as an end and you overstate your totals.
|
|
260
|
+
`onSessionClosed` covers the visitor-confirmed end, and `onConversationClosed`
|
|
261
|
+
covers a close that came from the agent side, so neither alone is a total.
|
|
262
|
+
|
|
225
263
|
### Forward widget events into your analytics
|
|
226
264
|
|
|
227
265
|
The widget never writes into your analytics tools. If you want chat activity in
|
|
@@ -232,9 +270,17 @@ and where. With Quantum Metric, for example:
|
|
|
232
270
|
MoveoAI.init({ integrationId: 'YOUR_INTEGRATION_ID' }).then((controller) => {
|
|
233
271
|
// Event ids must exist in your Quantum Metric configuration first:
|
|
234
272
|
// sendEvent() silently drops ids that are not defined for the page.
|
|
235
|
-
const
|
|
273
|
+
const QM_MOVEO_LOADED = 900; // example ids — define your own
|
|
274
|
+
const QM_MOVEO_SESSION = 901;
|
|
236
275
|
const QM_MOVEO_MESSAGE = 902;
|
|
237
276
|
|
|
277
|
+
controller.onAnalyticsEvent(({ event }) => {
|
|
278
|
+
if (event === 'widget_loaded') {
|
|
279
|
+
// Fires on every page that carries the widget, with no visitor action.
|
|
280
|
+
window.QuantumMetricAPI?.sendEvent(QM_MOVEO_LOADED, 0, '');
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
|
|
238
284
|
controller.onSessionCreated(({ session_id }) => {
|
|
239
285
|
// The Moveo session id becomes searchable on the QM session,
|
|
240
286
|
// joining every replay to its Moveo conversation.
|
|
@@ -278,6 +324,35 @@ MoveoAI.init({
|
|
|
278
324
|
});
|
|
279
325
|
```
|
|
280
326
|
|
|
327
|
+
### Inactivity Timeout
|
|
328
|
+
|
|
329
|
+
The widget opens an inactivity modal once the visitor goes quiet, and asks
|
|
330
|
+
whether to keep the conversation. Set `inactivity_timeout` in minutes to change
|
|
331
|
+
when it appears. Set it in the integration's configuration, or override it on
|
|
332
|
+
`init()`:
|
|
333
|
+
|
|
334
|
+
```javascript
|
|
335
|
+
MoveoAI.init({
|
|
336
|
+
integrationId: 'YOUR_INTEGRATION_ID',
|
|
337
|
+
inactivity_timeout: 20, // minutes; 0 turns the modal off
|
|
338
|
+
});
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
| Value | Effect |
|
|
342
|
+
| --------------------------------- | ------------------------------------------ |
|
|
343
|
+
| `0` | No modal. The widget still tracks activity |
|
|
344
|
+
| `3` to `30` | The modal opens after that many minutes |
|
|
345
|
+
| Below `3`, or above `30` | Clamped into the 3 to 30 minute range |
|
|
346
|
+
| Absent, negative, or not a number | The default, 10 minutes |
|
|
347
|
+
|
|
348
|
+
Below 3 minutes the modal interrupts a visitor who only stopped to read. Above
|
|
349
|
+
30 it holds a dead session open for hours. A negative value falls back to the
|
|
350
|
+
default rather than to `0`, so a malformed configuration cannot switch the
|
|
351
|
+
modal off without anyone noticing.
|
|
352
|
+
|
|
353
|
+
Only activity inside the widget counts. A visitor who scrolls your page but
|
|
354
|
+
does not touch the chat is inactive.
|
|
355
|
+
|
|
281
356
|
### CSS Variables
|
|
282
357
|
|
|
283
358
|
Pass any of these to `setCSSVariables()` to restyle the widget. Every value is
|
|
@@ -340,9 +415,42 @@ Every other variable in the table applies inside the widget iframe.
|
|
|
340
415
|
`--nbg-bg` also exists, for one account's variant styling. It is not part of
|
|
341
416
|
the supported surface.
|
|
342
417
|
|
|
343
|
-
Colours
|
|
344
|
-
|
|
345
|
-
|
|
418
|
+
#### Colours
|
|
419
|
+
|
|
420
|
+
Set colours in the integration's `theme_colors` config, which carries a `light`
|
|
421
|
+
and a `dark` set. Each key writes one CSS variable, so the same colours can be
|
|
422
|
+
overridden at runtime through `setCSSVariables()`, which wins over the config.
|
|
423
|
+
|
|
424
|
+
| `theme_colors` key | CSS variable | Controls |
|
|
425
|
+
| ---------------------- | ----------------------------------- | ----------------------------------------------------------- |
|
|
426
|
+
| `accent_color` | `--color-accent` | The accent, and the default for every colour marked below |
|
|
427
|
+
| `background_color` | `--color-background` | The widget surface, and the area behind the messages |
|
|
428
|
+
| `border_color` | `--color-border` | Panel, composer and card borders |
|
|
429
|
+
| `header_color` | `--moveo-header-background` | Header background |
|
|
430
|
+
| `text_color_header` | `--moveo-header-text-color` | Header text and icons |
|
|
431
|
+
| `text_color_user` | `--color-text-primary-foreground` | Text inside the visitor's own bubbles |
|
|
432
|
+
| `text_color_agent` | `--color-text-secondary-foreground` | Text inside the agent's bubbles |
|
|
433
|
+
| `launcher_background` | `--color-launcher-background` | Launcher bubble; defaults to the accent |
|
|
434
|
+
| `launcher_foreground` | `--color-launcher-foreground` | Launcher icon; defaults to the widget background |
|
|
435
|
+
| `link_color` | `--color-link` | Links in messages; defaults to the accent |
|
|
436
|
+
| `rating_background` | `--color-rating-background` | Selected rating button; defaults to the accent |
|
|
437
|
+
| `send_icon_color` | `--color-send-icon` | Send icon in the composer; defaults to the accent |
|
|
438
|
+
| `swimmlane_background` | `--color-swimmlane-background` | System message pill background |
|
|
439
|
+
| `swimmlane_foreground` | `--color-swimmlane-foreground` | System message pill text; defaults to the agent text colour |
|
|
440
|
+
|
|
441
|
+
A colour that says "defaults to" follows `--color-accent` — or the colour named
|
|
442
|
+
— until you set it. So an accent alone restyles the links, the rating, the send
|
|
443
|
+
icon and the launcher, and `--color-chat-background` follows the background.
|
|
444
|
+
|
|
445
|
+
Four more colours have no `theme_colors` key, so they are set through
|
|
446
|
+
`setCSSVariables()` only:
|
|
447
|
+
|
|
448
|
+
| Variable | Controls |
|
|
449
|
+
| ---------------------------- | ---------------------------------------------------- |
|
|
450
|
+
| `--color-chat-background` | The area behind the messages; follows the background |
|
|
451
|
+
| `--color-options-background` | Quick reply button background |
|
|
452
|
+
| `--color-options-foreground` | Quick reply button label; defaults to the accent |
|
|
453
|
+
| `--color-options-border` | Quick reply button border; defaults to the accent |
|
|
346
454
|
|
|
347
455
|
#### Renamed variables
|
|
348
456
|
|