@mcp-b/embedded-agent 1.2.0 → 1.2.1

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.
@@ -8933,13 +8933,12 @@ function injectStyles() {
8933
8933
  *
8934
8934
  */
8935
8935
  /**
8936
- * Get the default API base URL based on build environment.
8937
- * - Production builds: use the production WebMCP API
8938
- * - Development builds: use current origin (for local dev server)
8936
+ * Get the default API base URL.
8937
+ * Always uses production unless explicitly overridden with useLocalApi.
8939
8938
  */
8940
- const getDefaultApiBase = () => {
8941
- if (process.env.NODE_ENV === "production") return WEBMCP_PRODUCTION_API_BASE;
8942
- return typeof window !== "undefined" ? window.location.origin : WEBMCP_PRODUCTION_API_BASE;
8939
+ const getDefaultApiBase = (useLocalApi) => {
8940
+ if (useLocalApi && typeof window !== "undefined") return window.location.origin;
8941
+ return WEBMCP_PRODUCTION_API_BASE;
8943
8942
  };
8944
8943
  /**
8945
8944
  * EmbeddedAgent - Drop-in AI chat widget
@@ -8956,7 +8955,7 @@ const EmbeddedAgent = (t0) => {
8956
8955
  const { appId, devMode } = t0;
8957
8956
  let apiBase;
8958
8957
  if ($[0] !== appId || $[1] !== devMode) {
8959
- apiBase = getDefaultApiBase();
8958
+ apiBase = getDefaultApiBase(devMode?.useLocalApi);
8960
8959
  if (typeof window !== "undefined") console.debug("[WebMCP] Initialized", {
8961
8960
  appId,
8962
8961
  mode: devMode ? "development" : "production",