mitra-interactions-sdk 1.0.58-beta.1 → 1.0.58-beta.2
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.js +6 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -387,11 +387,14 @@ function getProjectId(override) {
|
|
|
387
387
|
return pid;
|
|
388
388
|
}
|
|
389
389
|
function getWsUrl() {
|
|
390
|
+
var _a;
|
|
390
391
|
const config = getConfig();
|
|
391
|
-
if (
|
|
392
|
-
|
|
392
|
+
if (config.agentWsUrl) return config.agentWsUrl;
|
|
393
|
+
if (typeof window !== "undefined") {
|
|
394
|
+
const injected = (_a = window.__mitraEnv) == null ? void 0 : _a.agentWsUrl;
|
|
395
|
+
if (typeof injected === "string" && injected) return injected;
|
|
393
396
|
}
|
|
394
|
-
|
|
397
|
+
throw new Error("Agent Chat: agentWsUrl n\xE3o configurado. Passe em configureSdkMitra({ agentWsUrl }), fa\xE7a login para receber via sdk-auth, ou rode em uma app publicada pelo Mitra (window.__mitraEnv).");
|
|
395
398
|
}
|
|
396
399
|
function connect() {
|
|
397
400
|
if (ws && ws.readyState === WebSocket.OPEN) {
|