mirror of
https://github.com/formbricks/formbricks.git
synced 2026-04-21 19:39:28 -05:00
Merge branch 'main' of github.com:formbricks/formbricks
This commit is contained in:
@@ -63,7 +63,7 @@ Replace your-environment-id with your actual environment ID. You can find your e
|
||||
1. Install the Formbricks package using npm:
|
||||
|
||||
```bash
|
||||
npm install @formbricks/js
|
||||
npm install -s @formbricks/js
|
||||
```
|
||||
|
||||
2. Import Formbricks and initialize the widget in your main component (e.g., App.tsx or App.js):
|
||||
|
||||
+31
-20
@@ -1,25 +1,36 @@
|
||||
# widget
|
||||
# Formbricks Browser JS Library
|
||||
|
||||
## CLI Commands
|
||||
[](https://www.npmjs.com/package/@formbricks/js)
|
||||
[](https://opensource.org/licenses/MIT)
|
||||
|
||||
Please see [Formbricks Docs](https://formbricks.com/docs).
|
||||
Specifically, [Quickstart/Implementation details](https://formbricks.com/docs/getting-started/quickstart).
|
||||
|
||||
## What is Formbricks
|
||||
|
||||
Formbricks is your go-to solution for in-product micro-surveys that will supercharge your product experience! 🚀 For more information please check out [formbricks.com](https://formbricks.com).
|
||||
|
||||
## How to use this library
|
||||
|
||||
1. Install the Formbricks package inside your project using npm:
|
||||
|
||||
```bash
|
||||
# install dependencies
|
||||
npm install
|
||||
|
||||
# serve demo with hot reload at localhost:8080
|
||||
npm run dev
|
||||
|
||||
# build npm ready bundles to be consumed by other Preact web apps
|
||||
npm run build:widget
|
||||
|
||||
# build npm ready bundles to be used as a component library
|
||||
npm run build:lib
|
||||
|
||||
# lint the project with eslint to find code style issues
|
||||
npm run lint
|
||||
|
||||
# run tests with jest and enzyme
|
||||
npm run test
|
||||
npm install -s @formbricks/js
|
||||
```
|
||||
|
||||
For detailed explanation on how things work, checkout the [CLI Readme](https://github.com/preactjs/preact-cli/blob/master/README.md).
|
||||
2. Import Formbricks and initialize the widget in your main component (e.g., App.tsx or App.js):
|
||||
|
||||
```javascript
|
||||
import formbricks from "@formbricks/js";
|
||||
|
||||
if (typeof window !== "undefined") {
|
||||
formbricks.init({
|
||||
environmentId: "your-environment-id",
|
||||
apiHost: "https://app.formbricks.com",
|
||||
});
|
||||
}
|
||||
```
|
||||
|
||||
Replace your-environment-id with your actual environment ID. You can find your environment ID in the **Setup Checklist** in the Formbricks settings.
|
||||
|
||||
For more detailed guides for different frameworks, check out our [Next.js](https://formbricks.com/docs/getting-started/nextjs) and [Vue.js](https://formbricks.com/docs/getting-started/vuejs) guides.
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
{
|
||||
"name": "@formbricks/js",
|
||||
"version": "0.1.6",
|
||||
"description": "",
|
||||
"version": "0.1.8",
|
||||
"description": "Formbricks-js allows you to connect your app to Formbricks, display surveys and trigger events.",
|
||||
"keywords": [
|
||||
"Formbricks",
|
||||
"surveys",
|
||||
"experience management"
|
||||
],
|
||||
"source": "src/index.ts",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.module.js",
|
||||
|
||||
Reference in New Issue
Block a user