Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@ import formbricks from "@formbricks/js";

if (typeof window !== "undefined") {
formbricks.setup({
environmentId: "your-environment-id",
workspaceId: "your-workspace-id",
appUrl: "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. If you want to use the user identification feature, please check out [our docs for details](https://formbricks.com/docs/app-surveys/user-identification).
Replace your-workspace-id with your actual workspace ID. You can find your workspace ID in the **Setup Checklist** in the Formbricks settings. If you want to use the user identification feature, please check out [our docs for details](https://formbricks.com/docs/app-surveys/user-identification).

> `environmentId` is still accepted for backward compatibility but is deprecated and will be removed in a future version. Prefer `workspaceId`.

For more detailed guides for different frameworks, check out our [Framework Guides](https://formbricks.com/docs/getting-started/framework-guides).
2 changes: 1 addition & 1 deletion apps/playground/.env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
VITE_FORMBRICKS_API_HOST=http://localhost:3000
VITE_FORMBRICKS_ENVIRONMENT_ID=YOUR-ENVIRONMENT-ID
VITE_FORMBRICKS_WORKSPACE_ID=YOUR-WORKSPACE-ID
6 changes: 4 additions & 2 deletions apps/playground/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ pnpm install
1. Create a `.env` file with your Formbricks credentials:

```env
VITE_FORMBRICKS_ENVIRONMENT_ID=your-environment-id
VITE_FORMBRICKS_WORKSPACE_ID=your-workspace-id
VITE_FORMBRICKS_API_HOST=https://app.formbricks.com
```

You can find your environment ID in the Formbricks app under Settings → Setup.
Replace your-workspace-id with your actual workspace ID. You can find your workspace ID in the **Connections instructions** in the Formbricks **Configuration** pages.

> `environmentId` / `VITE_FORMBRICKS_ENVIRONMENT_ID` is still accepted for backward compatibility but is deprecated and will be removed in a future version. Prefer `workspaceId`.

1. Start the development server:

Expand Down
10 changes: 5 additions & 5 deletions apps/playground/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ export default function App(): React.JSX.Element {
}

const missingEnvVars = [
!import.meta.env.VITE_FORMBRICKS_ENVIRONMENT_ID
? "VITE_FORMBRICKS_ENVIRONMENT_ID"
!import.meta.env.VITE_FORMBRICKS_WORKSPACE_ID
? "VITE_FORMBRICKS_WORKSPACE_ID"
: null,
!import.meta.env.VITE_FORMBRICKS_API_HOST
? "VITE_FORMBRICKS_API_HOST"
Expand All @@ -34,7 +34,7 @@ export default function App(): React.JSX.Element {

if (missingEnvVars.length === 0) {
formbricks.setup({
environmentId: import.meta.env.VITE_FORMBRICKS_ENVIRONMENT_ID,
workspaceId: import.meta.env.VITE_FORMBRICKS_WORKSPACE_ID,
appUrl: import.meta.env.VITE_FORMBRICKS_API_HOST,
});
} else {
Expand Down Expand Up @@ -79,11 +79,11 @@ export default function App(): React.JSX.Element {
<img src={fbsetup} alt="fb setup" className="mt-4 rounded-xs" />
<div className="mt-4 flex-col items-start text-sm text-slate-700 sm:flex sm:items-center sm:text-base dark:text-slate-300">
<p className="mb-1 sm:mr-2 sm:mb-0">
You&apos;re connected with env:
You&apos;re connected with workspace:
</p>
<div className="flex items-center">
<strong className="w-32 truncate sm:w-auto">
{import.meta.env.VITE_FORMBRICKS_ENVIRONMENT_ID ??
{import.meta.env.VITE_FORMBRICKS_WORKSPACE_ID ??
"Not configured"}
</strong>
<span className="relative ml-2 flex h-3 w-3">
Expand Down
2 changes: 1 addition & 1 deletion packages/js/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@formbricks/js",
"license": "MIT",
"version": "4.4.0",
"version": "5.0.0",
"description": "Formbricks-js allows you to connect your index to Formbricks, display surveys and trigger events.",
"homepage": "https://formbricks.com",
"repository": {
Expand Down
Loading