@eshal-bot/chat-widget 0.1.68 → 0.1.70
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/dist/chat-widget.js +8 -12
- package/package.json +1 -1
package/dist/chat-widget.js
CHANGED
|
@@ -8777,23 +8777,19 @@
|
|
|
8777
8777
|
};
|
|
8778
8778
|
|
|
8779
8779
|
/**
|
|
8780
|
-
* Constructs the voice WebSocket base URL
|
|
8781
|
-
* base URL the widget is embedded with, as `wss://{host}/voice/ws`.
|
|
8780
|
+
* Constructs the voice WebSocket base URL.
|
|
8782
8781
|
*
|
|
8783
|
-
*
|
|
8784
|
-
*
|
|
8785
|
-
*
|
|
8786
|
-
*
|
|
8787
|
-
*
|
|
8788
|
-
* never be pointed at the (no-longer-public) knowledge-api LoadBalancer by
|
|
8789
|
-
* a stale embed option or backend config value.
|
|
8782
|
+
* If wsBaseUrl is provided (from agentConfig.wsBaseUrl in the deploy-agent
|
|
8783
|
+
* response), use it directly — it points at the eshal frontend /voice/ws
|
|
8784
|
+
* endpoint which proxies in-cluster to knowledge-api.
|
|
8785
|
+
*
|
|
8786
|
+
* For in-app use (apiBaseUrl IS the eshal frontend), derives from apiBaseUrl.
|
|
8790
8787
|
*
|
|
8791
8788
|
* @param {string} apiBaseUrl - Frontend base URL, e.g. https://demo.eshal.ai
|
|
8792
|
-
* @
|
|
8789
|
+
* @param {string} [wsBaseUrl] - Override from agentConfig, e.g. wss://dev.eshal.ai/voice/ws
|
|
8790
|
+
* @returns {string} Voice WS base URL
|
|
8793
8791
|
*/
|
|
8794
8792
|
const getWebSocketUrl = (apiBaseUrl, wsBaseUrl) => {
|
|
8795
|
-
// If the backend returned a wsBaseUrl in agentConfig (or customer passed one
|
|
8796
|
-
// explicitly), use it directly — it already points at the correct host.
|
|
8797
8793
|
if (wsBaseUrl) return wsBaseUrl.replace(/\/$/, '');
|
|
8798
8794
|
if (!apiBaseUrl) {
|
|
8799
8795
|
return 'wss://dev.eshal.ai/voice/ws';
|