@flowengage/react-chatbot 6.0.35 → 6.0.41
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 +0 -44
- package/dist/flowengage-embed.js +17 -18
- package/dist/flowengage-react-chatbot.cjs +11 -12
- package/dist/flowengage-react-chatbot.mjs +235 -237
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -265,35 +265,6 @@ function RouteTracker() {
|
|
|
265
265
|
|
|
266
266
|
---
|
|
267
267
|
|
|
268
|
-
## Voice Mode
|
|
269
|
-
|
|
270
|
-
The widget includes an ElevenLabs-powered voice agent that visitors can interact with hands-free.
|
|
271
|
-
|
|
272
|
-
### Session lifecycle
|
|
273
|
-
|
|
274
|
-
1. Visitor clicks "Start Voice" (or auto-starts on voice-enabled sites)
|
|
275
|
-
2. Widget fetches a signed URL from the backend (`GET /api/voice/signed-url`)
|
|
276
|
-
3. ElevenLabs WebSocket session starts with page-context greeting override
|
|
277
|
-
4. Agent can call client tools: `flowengage_navigate`, `flowengage_highlight`, `flowengage_list_forms`, `flowengage_fill_form`, `flowengage_click_button`, `end_voice_session`
|
|
278
|
-
5. On SPA navigation the session persists — a URL-change tracker sends contextual updates so the agent knows the current page
|
|
279
|
-
6. On hard navigation (page reload), the transcript is saved to `sessionStorage` and the session auto-resumes on the next page
|
|
280
|
-
|
|
281
|
-
### Voice resume across page reloads
|
|
282
|
-
|
|
283
|
-
When the agent navigates the visitor to a new page (`flowengage_navigate`), the widget:
|
|
284
|
-
- Saves the current transcript and a resume flag to `sessionStorage`
|
|
285
|
-
- Triggers a hard reload or SPA route change
|
|
286
|
-
- On the new page, `useLayoutEffect` detects the pending resume and re-enters `voice_mode`
|
|
287
|
-
- The new session loads with a "continue the tour" preamble so the agent picks up where it left off
|
|
288
|
-
|
|
289
|
-
### Requirements
|
|
290
|
-
|
|
291
|
-
- ElevenLabs agent must have `first_message` override enabled in platform settings
|
|
292
|
-
- Backend must have `ELEVENLABS_API_KEY` configured
|
|
293
|
-
- Visitor must grant microphone permission
|
|
294
|
-
|
|
295
|
-
---
|
|
296
|
-
|
|
297
268
|
## How It Works
|
|
298
269
|
|
|
299
270
|
```
|
|
@@ -303,7 +274,6 @@ Your App
|
|
|
303
274
|
├── Boot: GET /api/widget/bootstrap → validates siteId, returns config
|
|
304
275
|
├── Start: POST /api/ai/chat → loads chat history
|
|
305
276
|
├── Chat: Socket.IO → real-time messages & agent handoff
|
|
306
|
-
├── Voice: GET /api/voice/signed-url → ElevenLabs WebSocket voice session
|
|
307
277
|
└── Track: Socket.IO events → visitor session, page views
|
|
308
278
|
```
|
|
309
279
|
|
|
@@ -319,20 +289,6 @@ Backend URLs are resolved by FlowEngage; you normally do not set them unless usi
|
|
|
319
289
|
|
|
320
290
|
---
|
|
321
291
|
|
|
322
|
-
## Building the embed
|
|
323
|
-
|
|
324
|
-
The CDN embed is an IIFE bundle that includes React, all widget code, and inlined CSS. Build it with:
|
|
325
|
-
|
|
326
|
-
```bash
|
|
327
|
-
FLOWENGAGE_API_URL=https://your-api-url npx vite build --config vite.embed.config.js
|
|
328
|
-
```
|
|
329
|
-
|
|
330
|
-
Output lands in `dist/flowengage-embed.js`. Copy this file to the CDN or the backend `public/` folder for serving.
|
|
331
|
-
|
|
332
|
-
The `FLOWENGAGE_API_URL` env var is baked into the bundle at build time — the widget uses it as the default API base URL when no `data-api-url` attribute is present on the script tag.
|
|
333
|
-
|
|
334
|
-
---
|
|
335
|
-
|
|
336
292
|
## License
|
|
337
293
|
|
|
338
294
|
MIT © FlowEngage
|