release formbricks-js 2.0 beta 1

This commit is contained in:
Matthias Nannt
2024-04-30 17:49:01 +02:00
parent 1cba959d9b
commit 0e102ead33
2 changed files with 20 additions and 4 deletions
+19 -3
View File
@@ -18,10 +18,12 @@ Formbricks is your go-to solution for in-product micro-surveys that will superch
npm install -s @formbricks/js
```
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";
if (typeof window !== "undefined") {
formbricks.init({
@@ -31,6 +33,20 @@ 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).
+1 -1
View File
@@ -1,7 +1,7 @@
{
"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.",
"homepage": "https://formbricks.com",
"repository": {