Skip to content

Commit 3e97ca9

Browse files
authored
chore: bumps sdk version for 5.0 (#51)
* bumps sdk version for 5.0 * fix version * updates readme and playground * readme
1 parent 99a490e commit 3e97ca9

5 files changed

Lines changed: 15 additions & 11 deletions

File tree

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,14 @@ import formbricks from "@formbricks/js";
2525

2626
if (typeof window !== "undefined") {
2727
formbricks.setup({
28-
environmentId: "your-environment-id",
28+
workspaceId: "your-workspace-id",
2929
appUrl: "https://app.formbricks.com",
3030
});
3131
}
3232
```
3333

34-
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).
34+
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).
35+
36+
> `environmentId` is still accepted for backward compatibility but is deprecated and will be removed in a future version. Prefer `workspaceId`.
3537
3638
For more detailed guides for different frameworks, check out our [Framework Guides](https://formbricks.com/docs/getting-started/framework-guides).

apps/playground/.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
VITE_FORMBRICKS_API_HOST=http://localhost:3000
2-
VITE_FORMBRICKS_ENVIRONMENT_ID=YOUR-ENVIRONMENT-ID
2+
VITE_FORMBRICKS_WORKSPACE_ID=YOUR-WORKSPACE-ID

apps/playground/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ pnpm install
1313
1. Create a `.env` file with your Formbricks credentials:
1414

1515
```env
16-
VITE_FORMBRICKS_ENVIRONMENT_ID=your-environment-id
16+
VITE_FORMBRICKS_WORKSPACE_ID=your-workspace-id
1717
VITE_FORMBRICKS_API_HOST=https://app.formbricks.com
1818
```
1919

20-
You can find your environment ID in the Formbricks app under Settings → Setup.
20+
Replace your-workspace-id with your actual workspace ID. You can find your workspace ID in the **Connections instructions** in the Formbricks **Configuration** pages.
21+
22+
> `environmentId` / `VITE_FORMBRICKS_ENVIRONMENT_ID` is still accepted for backward compatibility but is deprecated and will be removed in a future version. Prefer `workspaceId`.
2123
2224
1. Start the development server:
2325

apps/playground/src/app.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ export default function App(): React.JSX.Element {
2424
}
2525

2626
const missingEnvVars = [
27-
!import.meta.env.VITE_FORMBRICKS_ENVIRONMENT_ID
28-
? "VITE_FORMBRICKS_ENVIRONMENT_ID"
27+
!import.meta.env.VITE_FORMBRICKS_WORKSPACE_ID
28+
? "VITE_FORMBRICKS_WORKSPACE_ID"
2929
: null,
3030
!import.meta.env.VITE_FORMBRICKS_API_HOST
3131
? "VITE_FORMBRICKS_API_HOST"
@@ -34,7 +34,7 @@ export default function App(): React.JSX.Element {
3434

3535
if (missingEnvVars.length === 0) {
3636
formbricks.setup({
37-
environmentId: import.meta.env.VITE_FORMBRICKS_ENVIRONMENT_ID,
37+
workspaceId: import.meta.env.VITE_FORMBRICKS_WORKSPACE_ID,
3838
appUrl: import.meta.env.VITE_FORMBRICKS_API_HOST,
3939
});
4040
} else {
@@ -79,11 +79,11 @@ export default function App(): React.JSX.Element {
7979
<img src={fbsetup} alt="fb setup" className="mt-4 rounded-xs" />
8080
<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">
8181
<p className="mb-1 sm:mr-2 sm:mb-0">
82-
You&apos;re connected with env:
82+
You&apos;re connected with workspace:
8383
</p>
8484
<div className="flex items-center">
8585
<strong className="w-32 truncate sm:w-auto">
86-
{import.meta.env.VITE_FORMBRICKS_ENVIRONMENT_ID ??
86+
{import.meta.env.VITE_FORMBRICKS_WORKSPACE_ID ??
8787
"Not configured"}
8888
</strong>
8989
<span className="relative ml-2 flex h-3 w-3">

packages/js/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@formbricks/js",
33
"license": "MIT",
4-
"version": "4.4.0",
4+
"version": "5.0.0",
55
"description": "Formbricks-js allows you to connect your index to Formbricks, display surveys and trigger events.",
66
"homepage": "https://formbricks.com",
77
"repository": {

0 commit comments

Comments
 (0)