@getbee/widget-loader 0.1.0
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/README.md +80 -0
- package/dist/index.d.ts +72 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +88 -0
- package/dist/index.js.map +1 -0
- package/package.json +38 -0
package/README.md
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Getbee Widget Loader
|
|
2
|
+
|
|
3
|
+
Typed NPM package for adding the Getbee iframe widget script with one init function.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @getbee/widget-loader
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import { init } from "@getbee/widget-loader";
|
|
15
|
+
|
|
16
|
+
init({
|
|
17
|
+
tenant: "TENANT_NAME",
|
|
18
|
+
infoBox: {
|
|
19
|
+
isEnabled: true,
|
|
20
|
+
text: "Chat with one of our experts",
|
|
21
|
+
timer: 5000
|
|
22
|
+
},
|
|
23
|
+
cta: {
|
|
24
|
+
type: "image",
|
|
25
|
+
image: {
|
|
26
|
+
imageUrl: "https://testbeestorage.blob.core.windows.net/devwidget/oRPL4JQ3.png"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
showCta: true,
|
|
30
|
+
position: "right",
|
|
31
|
+
spacing: "16px",
|
|
32
|
+
bottomSpacing: "16px",
|
|
33
|
+
sectionIds: "SHOPIFY_SECTION_IDS"
|
|
34
|
+
});
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
`tenant` is required. All other widget configuration fields are optional.
|
|
38
|
+
|
|
39
|
+
## React example
|
|
40
|
+
|
|
41
|
+
```tsx
|
|
42
|
+
import { useEffect } from "react";
|
|
43
|
+
import { initGetbeeWidget } from "@getbee/widget-loader";
|
|
44
|
+
|
|
45
|
+
export function GetbeeWidget() {
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
initGetbeeWidget({
|
|
48
|
+
tenant: "TENANT_NAME",
|
|
49
|
+
position: "right",
|
|
50
|
+
spacing: "16px",
|
|
51
|
+
bottomSpacing: "16px"
|
|
52
|
+
}).catch(console.error);
|
|
53
|
+
}, []);
|
|
54
|
+
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Behavior
|
|
60
|
+
|
|
61
|
+
- Sets `window.getbeeWidgetConf` from the provided config.
|
|
62
|
+
- Appends `https://iframe.getbee.com/dist/getbee.js` to the end of the page.
|
|
63
|
+
- If `init` is called before the page is ready, the script is appended after `DOMContentLoaded`.
|
|
64
|
+
- If `init` is called multiple times, the script is not duplicated.
|
|
65
|
+
- Returns a `Promise<HTMLScriptElement>` that resolves when the script loads.
|
|
66
|
+
|
|
67
|
+
## Optional loader settings
|
|
68
|
+
|
|
69
|
+
```ts
|
|
70
|
+
init(
|
|
71
|
+
{ tenant: "TENANT_NAME" },
|
|
72
|
+
{
|
|
73
|
+
scriptUrl: "https://iframe.getbee.com/dist/getbee.js",
|
|
74
|
+
scriptId: "getbee-widget-loader-script",
|
|
75
|
+
forceReload: false,
|
|
76
|
+
onLoad: (script) => console.log("Getbee loaded", script),
|
|
77
|
+
onError: (event) => console.error("Getbee failed to load", event)
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
```
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
declare const GETBEE_SCRIPT_URLS: {
|
|
2
|
+
readonly dev: "https://iframe.devbee.me/dist/getbee.js";
|
|
3
|
+
readonly test: "https://iframe.testbee.me/dist/getbee.js";
|
|
4
|
+
readonly staging: "https://staging-iframe.getbee.com/dist/getbee.js";
|
|
5
|
+
readonly prod: "https://iframe.getbee.com/dist/getbee.js";
|
|
6
|
+
};
|
|
7
|
+
export type GetbeeWidgetEnvironment = keyof typeof GETBEE_SCRIPT_URLS;
|
|
8
|
+
export type GetbeeWidgetPosition = "left" | "right";
|
|
9
|
+
export type GetbeeCtaType = "image" | "video";
|
|
10
|
+
export interface GetbeeInfoBoxConfig {
|
|
11
|
+
isEnabled?: boolean;
|
|
12
|
+
text?: string;
|
|
13
|
+
timer?: number;
|
|
14
|
+
showIcon?: boolean;
|
|
15
|
+
background?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface GetbeeImageCtaConfig {
|
|
18
|
+
imageUrl?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface GetbeeVideoPageConfig {
|
|
21
|
+
heading?: string;
|
|
22
|
+
descrp?: string;
|
|
23
|
+
btnText?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface GetbeeVideoCtaConfig {
|
|
26
|
+
text?: string;
|
|
27
|
+
videoUrl?: string;
|
|
28
|
+
videoPage?: GetbeeVideoPageConfig;
|
|
29
|
+
}
|
|
30
|
+
export interface GetbeeCtaConfig {
|
|
31
|
+
type?: GetbeeCtaType;
|
|
32
|
+
image?: GetbeeImageCtaConfig;
|
|
33
|
+
video?: GetbeeVideoCtaConfig;
|
|
34
|
+
}
|
|
35
|
+
export interface GetbeeWidgetConfig {
|
|
36
|
+
tenant: string;
|
|
37
|
+
infoBox?: GetbeeInfoBoxConfig;
|
|
38
|
+
cta?: GetbeeCtaConfig;
|
|
39
|
+
showCta?: boolean;
|
|
40
|
+
position?: GetbeeWidgetPosition;
|
|
41
|
+
spacing?: string;
|
|
42
|
+
bottomSpacing?: string;
|
|
43
|
+
sectionIds?: string;
|
|
44
|
+
}
|
|
45
|
+
export interface InitGetbeeWidgetConfig extends GetbeeWidgetConfig {
|
|
46
|
+
env?: GetbeeWidgetEnvironment;
|
|
47
|
+
}
|
|
48
|
+
export interface InitGetbeeWidgetOptions {
|
|
49
|
+
/**
|
|
50
|
+
* Override only for testing or custom deployments.
|
|
51
|
+
*/
|
|
52
|
+
scriptUrl?: string;
|
|
53
|
+
/**
|
|
54
|
+
* DOM id used for the injected script tag.
|
|
55
|
+
*/
|
|
56
|
+
scriptId?: string;
|
|
57
|
+
/**
|
|
58
|
+
* Remove an existing Getbee script tag and append a fresh one.
|
|
59
|
+
*/
|
|
60
|
+
forceReload?: boolean;
|
|
61
|
+
onLoad?: (script: HTMLScriptElement) => void;
|
|
62
|
+
onError?: (event: Event) => void;
|
|
63
|
+
}
|
|
64
|
+
declare global {
|
|
65
|
+
interface Window {
|
|
66
|
+
getbeeWidgetConf?: GetbeeWidgetConfig;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
export declare const initGetbeeWidget: (config: InitGetbeeWidgetConfig, options?: InitGetbeeWidgetOptions) => Promise<HTMLScriptElement>;
|
|
70
|
+
export declare const init: (config: InitGetbeeWidgetConfig, options?: InitGetbeeWidgetOptions) => Promise<HTMLScriptElement>;
|
|
71
|
+
export default initGetbeeWidget;
|
|
72
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,kBAAkB;;;;;CAKd,CAAC;AAEX,MAAM,MAAM,uBAAuB,GAAG,MAAM,OAAO,kBAAkB,CAAC;AACtE,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,OAAO,CAAC;AACpD,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,OAAO,CAAC;AAE9C,MAAM,WAAW,mBAAmB;IAClC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE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BAuBtC,CAAC;AAEF,eAAO,MAAM,IAAI,WA1BP,sBAAsB,YACrB,uBAAuB,+BAyBE,CAAC;AAErC,eAAe,gBAAgB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
const DEFAULT_SCRIPT_ID = "getbee-widget-loader-script";
|
|
2
|
+
const DEFAULT_ENV = "prod";
|
|
3
|
+
const GETBEE_SCRIPT_URLS = {
|
|
4
|
+
dev: "https://iframe.devbee.me/dist/getbee.js",
|
|
5
|
+
test: "https://iframe.testbee.me/dist/getbee.js",
|
|
6
|
+
staging: "https://staging-iframe.getbee.com/dist/getbee.js",
|
|
7
|
+
prod: "https://iframe.getbee.com/dist/getbee.js",
|
|
8
|
+
};
|
|
9
|
+
const isBrowser = () => typeof window !== "undefined" && typeof document !== "undefined";
|
|
10
|
+
const validateConfig = (config) => {
|
|
11
|
+
if (!config || typeof config !== "object") {
|
|
12
|
+
throw new Error("Getbee widget config is required.");
|
|
13
|
+
}
|
|
14
|
+
if (!config.tenant ||
|
|
15
|
+
typeof config.tenant !== "string" ||
|
|
16
|
+
!config.tenant.trim()) {
|
|
17
|
+
throw new Error("Getbee widget tenant is required.");
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
const resolveScriptUrl = (env = DEFAULT_ENV) => {
|
|
21
|
+
if (!Object.prototype.hasOwnProperty.call(GETBEE_SCRIPT_URLS, env)) {
|
|
22
|
+
throw new Error(`Unsupported Getbee widget environment: ${env}`);
|
|
23
|
+
}
|
|
24
|
+
return GETBEE_SCRIPT_URLS[env];
|
|
25
|
+
};
|
|
26
|
+
const runAfterDocumentReady = (callback) => {
|
|
27
|
+
if (document.readyState === "loading") {
|
|
28
|
+
document.addEventListener("DOMContentLoaded", callback, { once: true });
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
callback();
|
|
32
|
+
};
|
|
33
|
+
const getExistingScript = (scriptId, scriptUrl) => {
|
|
34
|
+
const byId = document.getElementById(scriptId);
|
|
35
|
+
if (byId instanceof HTMLScriptElement) {
|
|
36
|
+
return byId;
|
|
37
|
+
}
|
|
38
|
+
const absoluteScriptUrl = new URL(scriptUrl, window.location.href).href;
|
|
39
|
+
const bySrc = Array.from(document.scripts).find((script) => script.src === absoluteScriptUrl || script.getAttribute("src") === scriptUrl);
|
|
40
|
+
return bySrc !== null && bySrc !== void 0 ? bySrc : null;
|
|
41
|
+
};
|
|
42
|
+
const appendScriptToEndOfPage = (scriptUrl, scriptId, options) => new Promise((resolve, reject) => {
|
|
43
|
+
runAfterDocumentReady(() => {
|
|
44
|
+
const existingScript = getExistingScript(scriptId, scriptUrl);
|
|
45
|
+
if (existingScript && !options.forceReload) {
|
|
46
|
+
resolve(existingScript);
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
if (existingScript && options.forceReload) {
|
|
50
|
+
existingScript.remove();
|
|
51
|
+
}
|
|
52
|
+
const script = document.createElement("script");
|
|
53
|
+
script.id = scriptId;
|
|
54
|
+
script.type = "text/javascript";
|
|
55
|
+
script.async = true;
|
|
56
|
+
script.src = scriptUrl;
|
|
57
|
+
script.dataset.getbeeWidgetLoader = "true";
|
|
58
|
+
script.addEventListener("load", () => {
|
|
59
|
+
var _a;
|
|
60
|
+
(_a = options.onLoad) === null || _a === void 0 ? void 0 : _a.call(options, script);
|
|
61
|
+
resolve(script);
|
|
62
|
+
}, { once: true });
|
|
63
|
+
script.addEventListener("error", (event) => {
|
|
64
|
+
var _a;
|
|
65
|
+
(_a = options.onError) === null || _a === void 0 ? void 0 : _a.call(options, event);
|
|
66
|
+
reject(new Error(`Failed to load Getbee widget script: ${scriptUrl}`));
|
|
67
|
+
}, { once: true });
|
|
68
|
+
const parent = document.body || document.documentElement;
|
|
69
|
+
parent.appendChild(script);
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
export const initGetbeeWidget = (config, options = {}) => {
|
|
73
|
+
var _a, _b;
|
|
74
|
+
validateConfig(config);
|
|
75
|
+
if (!isBrowser()) {
|
|
76
|
+
return Promise.reject(new Error("Getbee widget can only be initialized in a browser."));
|
|
77
|
+
}
|
|
78
|
+
const { env, ...widgetConfig } = config;
|
|
79
|
+
const scriptUrl = (_a = options.scriptUrl) !== null && _a !== void 0 ? _a : resolveScriptUrl(env);
|
|
80
|
+
window.getbeeWidgetConf = {
|
|
81
|
+
...widgetConfig,
|
|
82
|
+
tenant: widgetConfig.tenant.trim(),
|
|
83
|
+
};
|
|
84
|
+
return appendScriptToEndOfPage(scriptUrl, (_b = options.scriptId) !== null && _b !== void 0 ? _b : DEFAULT_SCRIPT_ID, options);
|
|
85
|
+
};
|
|
86
|
+
export const init = initGetbeeWidget;
|
|
87
|
+
export default initGetbeeWidget;
|
|
88
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,iBAAiB,GAAG,6BAA6B,CAAC;AACxD,MAAM,WAAW,GAAG,MAAM,CAAC;AAC3B,MAAM,kBAAkB,GAAG;IACzB,GAAG,EAAE,yCAAyC;IAC9C,IAAI,EAAE,0CAA0C;IAChD,OAAO,EAAE,kDAAkD;IAC3D,IAAI,EAAE,0CAA0C;CACxC,CAAC;AA0EX,MAAM,SAAS,GAAG,GAAG,EAAE,CACrB,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,QAAQ,KAAK,WAAW,CAAC;AAEnE,MAAM,cAAc,GAAG,CAAC,MAA0B,EAAE,EAAE;IACpD,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC1C,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;IACvD,CAAC;IAED,IACE,CAAC,MAAM,CAAC,MAAM;QACd,OAAO,MAAM,CAAC,MAAM,KAAK,QAAQ;QACjC,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EACrB,CAAC;QACD,MAA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AE,IAAI,EAAE,CACf,CAAC;QAEF,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,eAAe,CAAC;QACzD,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEL,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAC9B,MAA8B,EAC9B,UAAmC,EAAE,EACrC,EAAE;;IACF,cAAc,CAAC,MAAM,CAAC,CAAC;IAEvB,IAAI,CAAC,SAAS,EAAE,EAAE,CAAC;QACjB,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CAAC,qDAAqD,CAAC,CACjE,CAAC;IACJ,CAAC;IAED,MAAM,EAAE,GAAG,EAAE,GAAG,YAAY,EAAE,GAAG,MAAM,CAAC;IACxC,MAAM,SAAS,GAAG,MAAA,OAAO,CAAC,SAAS,mCAAI,gBAAgB,CAAC,GAAG,CAAC,CAAC;IAE7D,MAAM,CAAC,gBAAgB,GAAG;QACxB,GAAG,YAAY;QACf,MAAM,EAAE,YAAY,CAAC,MAAM,CAAC,IAAI,EAAE;KACnC,CAAC;IAEF,OAAO,uBAAuB,CAC5B,SAAS,EACT,MAAA,OAAO,CAAC,QAAQ,mCAAI,iBAAiB,EACrC,OAAO,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,IAAI,GAAG,gBAAgB,CAAC;AAErC,eAAe,gBAAgB,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@getbee/widget-loader",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Typed loader for installing the Getbee widget script with one init function.",
|
|
5
|
+
"license": "ISC",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"module": "./dist/index.js",
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"import": "./dist/index.js"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist",
|
|
18
|
+
"README.md"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "tsc -p tsconfig.json",
|
|
22
|
+
"clean": "rm -rf dist",
|
|
23
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
24
|
+
"prepack": "npm run build"
|
|
25
|
+
},
|
|
26
|
+
"keywords": [
|
|
27
|
+
"getbee",
|
|
28
|
+
"widget",
|
|
29
|
+
"iframe",
|
|
30
|
+
"loader"
|
|
31
|
+
],
|
|
32
|
+
"engines": {
|
|
33
|
+
"node": ">=18"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"typescript": "^5.4.5"
|
|
37
|
+
}
|
|
38
|
+
}
|