Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@formbricks/js

Package Overview
Dependencies
Maintainers
1
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@formbricks/js - npm Package Compare versions

Comparing version 2.0.0-beta.0 to 2.0.0-beta.1

dist/app.cjs

38

package.json
{
"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).
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc