Files
formbricks/packages/js
Matti Nannt 9ee052a229 feat: Make app surveys scalable (#3024)
Co-authored-by: pandeymangg <anshuman.pandey9999@gmail.com>
Co-authored-by: Piyush Gupta <piyushguptaa2z123@gmail.com>
2024-09-17 08:15:19 +00:00
..
2024-07-10 12:28:27 +00:00
2024-08-27 10:01:21 +02:00
2024-07-09 13:53:16 +00:00

Formbricks Browser JS Library

npm package MIT License

Please see Formbricks Docs. Specifically, Quickstart/Implementation details.

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.

How to use this library

  1. Install the Formbricks package inside your project using npm:
npm install @formbricks/js
  1. Import Formbricks and initialize the widget in your main component (e.g., App.tsx or App.js):

For Website surveys:

import formbricks from "@formbricks/js/website";

if (typeof window !== "undefined") {
  formbricks.init({
    environmentId: "your-environment-id",
    apiHost: "https://app.formbricks.com",
  });
}

For App surveys:

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.