@formbricks/js
Advanced tools
Comparing version 2.0.0-beta.0 to 2.0.0-beta.1
{ | ||
"name": "@formbricks/js", | ||
"license": "MIT", | ||
"version": "2.0.0-beta.0", | ||
"version": "2.0.0-beta.1", | ||
"description": "Formbricks-js allows you to connect your app to Formbricks, display surveys and trigger events.", | ||
@@ -21,21 +21,14 @@ "homepage": "https://formbricks.com", | ||
"type": "module", | ||
"source": "src/index.ts", | ||
"main": "dist/index.umd.cjs", | ||
"module": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"exports": { | ||
".": { | ||
"import": "./dist/index.js", | ||
"require": "./dist/index.umd.cjs", | ||
"types": "./dist/index.d.ts" | ||
"./app": { | ||
"import": "./dist/app.js", | ||
"require": "./dist/app.cjs", | ||
"types": "./dist/app.d.ts" | ||
}, | ||
"./website": { | ||
"import": "./dist/website.js", | ||
"require": "./dist/website.cjs", | ||
"types": "./dist/website.d.ts" | ||
} | ||
}, | ||
"author": "Formbricks <hola@formbricks.com>", | ||
"devDependencies": { | ||
"terser": "^5.30.3", | ||
"vite": "^5.2.9", | ||
"vite-plugin-dts": "^3.8.3", | ||
"@formbricks/tsconfig": "1.0.0", | ||
"eslint-config-formbricks": "1.0.0" | ||
}, | ||
"scripts": { | ||
@@ -48,3 +41,12 @@ "dev": "vite build --watch --mode dev", | ||
"clean": "rimraf .turbo node_modules dist coverage" | ||
}, | ||
"author": "Formbricks <hola@formbricks.com>", | ||
"devDependencies": { | ||
"@formbricks/js-core": "workspace:*", | ||
"@formbricks/tsconfig": "workspace:*", | ||
"eslint-config-formbricks": "workspace:*", | ||
"terser": "^5.30.4", | ||
"vite": "^5.2.10", | ||
"vite-plugin-dts": "^3.9.0" | ||
} | ||
} | ||
} |
@@ -21,6 +21,8 @@ # Formbricks Browser JS Library | ||
2. Import Formbricks and initialize the widget in your main component (e.g., App.tsx or App.js): | ||
1. Import Formbricks and initialize the widget in your main component (e.g., App.tsx or App.js): | ||
For `Website` surveys: | ||
```javascript | ||
import formbricks from "@formbricks/js"; | ||
import formbricks from "@formbricks/js/website"; | ||
@@ -35,4 +37,18 @@ if (typeof window !== "undefined") { | ||
Replace your-environment-id with your actual environment ID. You can find your environment ID in the **Setup Checklist** in the Formbricks settings. | ||
For `App` surveys: | ||
```javascript | ||
import formbricks from "@formbricks/js/app"; | ||
if (typeof window !== "undefined") { | ||
formbricks.init({ | ||
environmentId: "your-environment-id", | ||
apiHost: "https://app.formbricks.com", | ||
userId: "REPLACE_WITH_DYNAMIC_ID", | ||
}); | ||
} | ||
``` | ||
Replace your-environment-id with your actual environment ID. You can find your environment ID in the **Setup Checklist** in the Formbricks settings. If you are using `App` surveys please make sure to pass a unique user identifier to the Formbricks SDK. | ||
For more detailed guides for different frameworks, check out our [Framework Guides](https://formbricks.com/docs/getting-started/framework-guides). |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
44117
17
213
53
6
3
5