fix widget window not found error

This commit is contained in:
Matthias Nannt
2023-03-31 16:49:18 +02:00
parent 40fb28f5e1
commit 26a4e2f710
3 changed files with 2 additions and 6 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "@formbricks/js",
"version": "0.1.0",
"version": "0.1.2",
"description": "",
"source": "src/index.ts",
"main": "./dist/index.cjs",

View File

@@ -54,7 +54,6 @@ const refresh = (): void => {
};
const registerRouteChange = (): void => {
console.log("fire!!!");
queue.add(async () => {
checkInitialized();
checkPageUrl();
@@ -63,8 +62,4 @@ const registerRouteChange = (): void => {
const formbricks = { init, setUserId, setEmail, setAttribute, track, logout, refresh, registerRouteChange };
if (typeof window !== "undefined") {
(window as any).formbricks = formbricks;
}
export default formbricks;

View File

@@ -13,6 +13,7 @@
var b = document.getElementsByTagName("script")[0];
b.parentNode.insertBefore(a, b);
setTimeout(function () {
window.formbricks = window.js;
window.formbricks.init({
environmentId: "clfqjny0v0003yzgscnog1j9i",
apiHost: "http://localhost:3000",