@data-netmonk/mona-chat-widget 2.6.4 → 2.6.6

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
@@ -8,7 +8,7 @@ Chat widget package developed by Netmonk data & solution team to be imported in
8
8
 
9
9
  ---
10
10
 
11
- **Latest Version Changes (`v2.6.4`):**
11
+ **Latest Version Changes (`v2.6.6`):**
12
12
 
13
13
  ✅ **Patch Updates:**
14
14
  1. **Voice mode now fully controls TTS playback** - Disabling voice mode clears queued audio and stops active playback cleanly
@@ -139,6 +139,25 @@ Chat widget package developed by Netmonk data & solution team to be imported in
139
139
  The widget expects the TTS response body to contain raw audio binary such as `audio/wav`, and reads lip-sync metadata from `x-tts-visemes-b64`, `x-tts-phonemes-b64`, and `x-tts-phoneme-timeline-b64` response headers.
140
140
  If your TTS endpoint is called cross-origin, the server must expose those headers with `Access-Control-Expose-Headers`.
141
141
  If your TTS service uses a different header such as `x-api-key`, set `VITE_TTS_API_KEY_HEADER=x-api-key` and leave the prefix empty.
142
+ If you are consuming the published package inside another project, prefer passing these values via the `voiceConfig` or `widgetConfig` props because the host app `.env` is not injected into an already-built library bundle.
143
+ You can also set runtime defaults on the host page before mounting the widget via `window.__MONA_WIDGET_RUNTIME_CONFIG__`.
144
+ Example:
145
+ ```jsx
146
+ <ChatWidget
147
+ sourceId="source456"
148
+ webhookUrl="https://api.example.com/webhook"
149
+ voiceConfig={{
150
+ sttEndpoint: "https://voice.netmonk-ai.tech/stt",
151
+ sttApiKey: "your-key",
152
+ sttApiKeyHeader: "x-api-key",
153
+ sttApiKeyPrefix: "",
154
+ ttsEndpoint: "https://voice.example.com/tts",
155
+ ttsApiKey: "your-key",
156
+ ttsApiKeyHeader: "Authorization",
157
+ ttsApiKeyPrefix: "Bearer",
158
+ }}
159
+ />
160
+ ```
142
161
  5. Optional TTS debug logging
143
162
 
144
163
  To inspect TTS queue and playback lifecycle in browser console, set `VITE_DEBUG_TTS=true` in your `.env` file.