@trypanacea/sdk
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -32,7 +32,2 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
var _b, _c; | ||
// const serverURL = `https://panacea-api.koyeb.app/graphql` | ||
const serverURL = `http://localhost:9222/graphql`; | ||
if (!appKey) { | ||
throw new Error("appKey is required to initialize Panacea."); | ||
} | ||
// Ensure code runs only in the browser | ||
@@ -43,2 +38,12 @@ if (typeof window === "undefined") { | ||
} | ||
// Prevent multiple initializations | ||
if (window.__panaceaInitialized) { | ||
console.warn("Panacea SDK has already been initialized."); | ||
return; | ||
} | ||
window.__panaceaInitialized = true; | ||
const serverURL = `http://localhost:9222/graphql`; | ||
if (!appKey) { | ||
throw new Error("appKey is required to initialize Panacea."); | ||
} | ||
const { userId, firstName, lastName, email, avatar, customLauncherSelector = "body", hideDefaultLauncher = false, actionColor = "#3498db", backgroundColor = "white", region = "us" } = settings, additionalSettings = __rest(settings, ["userId", "firstName", "lastName", "email", "avatar", "customLauncherSelector", "hideDefaultLauncher", "actionColor", "backgroundColor", "region"]); | ||
@@ -79,3 +84,3 @@ try { | ||
styleLink.rel = "stylesheet"; | ||
styleLink.href = "/dist/styles.css"; // Update with the correct path to your built CSS | ||
styleLink.href = "./styles.css"; // Update with the correct path to your built CSS | ||
shadow.appendChild(styleLink); | ||
@@ -99,3 +104,3 @@ // Create floating button | ||
if (chatOpen) { | ||
iframe.style.height = "600px"; // Adjust width as needed | ||
iframe.style.height = "600px"; // Adjust height as needed | ||
iframe.style.borderWidth = "1px"; | ||
@@ -102,0 +107,0 @@ button.innerText = "Close Chat"; |
{ | ||
"name": "@trypanacea/sdk", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
161
21752