mitra-interactions-sdk 1.0.61 → 1.0.62

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/index.mjs CHANGED
@@ -1356,11 +1356,13 @@ function resolveProjectId3(override) {
1356
1356
  }
1357
1357
  function getWsUrl() {
1358
1358
  var _a;
1359
+ const configured = getConfig().agentWsUrl;
1360
+ if (typeof configured === "string" && configured) return configured;
1359
1361
  if (typeof window !== "undefined") {
1360
1362
  const injected = (_a = window.__mitraEnv) == null ? void 0 : _a.agentWsUrl;
1361
1363
  if (typeof injected === "string" && injected) return injected;
1362
1364
  }
1363
- throw new Error("Agent Chat: window.__mitraEnv.agentWsUrl indispon\xEDvel. A SDK precisa rodar em uma app publicada pelo Mitra (build-proxy injeta __mitraEnv).");
1365
+ throw new Error("Agent Chat: agentWsUrl indispon\xEDvel. Passe em configureSdkMitra({ agentWsUrl }) ou rode em uma app publicada pelo Mitra (build-proxy injeta window.__mitraEnv.agentWsUrl).");
1364
1366
  }
1365
1367
  function connect() {
1366
1368
  if (ws && ws.readyState === WebSocket.OPEN) {
@@ -2036,6 +2038,7 @@ function readInjectedEnv() {
2036
2038
  if (typeof env.apiBaseURL === "string" && env.apiBaseURL) out.baseURL = env.apiBaseURL;
2037
2039
  if (typeof env.integrationURL === "string" && env.integrationURL) out.integrationURL = env.integrationURL;
2038
2040
  if (typeof env.authUrl === "string" && env.authUrl) out.authUrl = env.authUrl;
2041
+ if (typeof env.agentWsUrl === "string" && env.agentWsUrl) out.agentWsUrl = env.agentWsUrl;
2039
2042
  return out;
2040
2043
  }
2041
2044
  function configureSdkMitra(config = {}) {