mirror of
https://github.com/formbricks/formbricks.git
synced 2026-05-07 22:31:35 -05:00
release formbricks-js 2.0 beta 1
This commit is contained in:
+19
-3
@@ -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,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": {
|
||||
|
||||
Reference in New Issue
Block a user