@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.
@@ -8777,23 +8777,19 @@
8777
8777
  };
8778
8778
 
8779
8779
  /**
8780
- * Constructs the voice WebSocket base URL — ALWAYS derived from the API
8781
- * base URL the widget is embedded with, as `wss://{host}/voice/ws`.
8780
+ * Constructs the voice WebSocket base URL.
8782
8781
  *
8783
- * `/voice/ws/{org}/{session}` is terminated by the frontend custom server
8784
- * (packages/frontend/server.js), which proxies it in-cluster to
8785
- * knowledge-api on `/ws`. The widget always talks to the same origin it
8786
- * loaded its config from, so the WS endpoint is fully determined by
8787
- * `apiBaseUrl`. There is intentionally NO override parameter: voice can
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
- * @returns {string} Voice WS base, e.g. wss://demo.eshal.ai/voice/ws
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';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eshal-bot/chat-widget",
3
- "version": "0.1.68",
3
+ "version": "0.1.70",
4
4
  "description": "Beautiful, embeddable chat widget with dark mode support",
5
5
  "type": "module",
6
6
  "main": "dist/chat-widget.js",