+ Look at the logs to understand how the widget works.{" "}
+ Open your browser console to see the logs.
+
+ {/*
+
+
*/}
+
+
+
+
+
+
+ Reset person / pull data from Formbricks app
+
+
+ On formbricks.reset() the local state will be deleted and formbricks gets{" "}
+ reinitialized.
+
+
+
+ If you made a change in Formbricks app and it does not seem to work, hit 'Reset' and
+ try again.
+
+
+
+
+
+
+
+
+
+ This button sends an Action to the Formbricks API called 'New Session'. You will
+ find it in the Actions Tab.
+
+
+
+
+
+
+
+
+
+
+ This button sends an Action to the Formbricks API called 'Exit Intent'. You can also
+ move your mouse to the top of the browser to trigger the exit intent.
+
+
+
+
+
+
+
+
+
+
+ This button sends an Action to the Formbricks API called '50% Scroll'. You can also
+ scroll down to trigger the 50% scroll.
+
+
+
+
+
+
+ );
+}
diff --git a/apps/demo/tsconfig.json b/apps/demo/tsconfig.json
index 8b8e58111e..6c36451d9b 100644
--- a/apps/demo/tsconfig.json
+++ b/apps/demo/tsconfig.json
@@ -1,23 +1,5 @@
{
- "compilerOptions": {
- "target": "es5",
- "lib": ["dom", "dom.iterable", "esnext"],
- "allowJs": true,
- "skipLibCheck": true,
- "strict": true,
- "forceConsistentCasingInFileNames": true,
- "noEmit": true,
- "esModuleInterop": true,
- "module": "esnext",
- "moduleResolution": "node",
- "resolveJsonModule": true,
- "isolatedModules": true,
- "jsx": "preserve",
- "incremental": true,
- "paths": {
- "@/*": ["./*"]
- }
- },
+ "extends": "@formbricks/tsconfig/nextjs.json",
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
}
diff --git a/apps/formbricks-com/app/[surveyId]/route.ts b/apps/formbricks-com/app/[surveyId]/route.ts
new file mode 100644
index 0000000000..bdde1107ba
--- /dev/null
+++ b/apps/formbricks-com/app/[surveyId]/route.ts
@@ -0,0 +1,5 @@
+export async function GET(_: Request, { params }: { params: { surveyId: string } }) {
+ const surveyId = params.surveyId;
+ // redirect to Formbricks Cloud
+ return Response.redirect(`https://app.formbricks.com/s/${surveyId}`, 301);
+}
diff --git a/apps/formbricks-com/app/docs/api/management/api-key-setup/add-api-key.webp b/apps/formbricks-com/app/docs/additional-features/api/add-api-key.webp
similarity index 100%
rename from apps/formbricks-com/app/docs/api/management/api-key-setup/add-api-key.webp
rename to apps/formbricks-com/app/docs/additional-features/api/add-api-key.webp
diff --git a/apps/formbricks-com/app/docs/api/management/api-key-setup/api-key-secret.webp b/apps/formbricks-com/app/docs/additional-features/api/api-key-secret.webp
similarity index 100%
rename from apps/formbricks-com/app/docs/api/management/api-key-setup/api-key-secret.webp
rename to apps/formbricks-com/app/docs/additional-features/api/api-key-secret.webp
diff --git a/apps/formbricks-com/app/docs/additional-features/api/page.mdx b/apps/formbricks-com/app/docs/additional-features/api/page.mdx
new file mode 100644
index 0000000000..d09ed103f2
--- /dev/null
+++ b/apps/formbricks-com/app/docs/additional-features/api/page.mdx
@@ -0,0 +1,137 @@
+import { MdxImage } from "@/components/shared/MdxImage";
+import AddApiKey from "./add-api-key.webp";
+import ApiKeySecret from "./api-key-secret.webp";
+
+export const metadata = {
+ title: "Formbricks API Overview: Public Client & Management API Breakdown",
+ description:
+ "Formbricks provides a powerful API to manage your surveys, responses, users, displays, actions, attributes & webhooks programmatically. Get a detailed understanding of Formbricks' dual API offerings: the unauthenticated Public Client API optimized for client-side tasks and the secured Management API for advanced account operations. Choose the perfect fit for your integration needs and ensure robust data handling",
+};
+
+#### API
+
+# API Overview
+
+Formbricks offers two types of APIs: the **Public Client API** and the **Management API**. Each API serves a different purpose, has different authentication requirements, and provides access to different data and settings.
+
+View our [API Documentation](https://documenter.getpostman.com/view/11026000/2sA3Bq5XEh) in more than 30 frameworks and languages. Or directly try out our APIs in Postman by clicking the button below:
+
+
+
+## Public Client API
+
+The [Public Client API](https://documenter.getpostman.com/view/11026000/2sA3Bq5XEh#5c981d9e-5e7d-455d-9795-b9c45bc2f930) is designed for our SDKs and **does not require authentication**. This API is ideal for client-side interactions, as it doesn't expose sensitive information.
+
+We currently have the following Client API methods exposed and below is their documentation attached in Postman:
+
+- [Actions API](https://documenter.getpostman.com/view/11026000/2sA3Bq5XEh#b8f3a10e-1642-4d82-a629-fef0a8c6c86c) - Create actions for a Person
+- [Displays API](https://documenter.getpostman.com/view/11026000/2sA3Bq5XEh#949272bf-daec-4d72-9b52-47af3d74a62c) - Mark Survey as Displayed or Update an existing Display by linking it with a Response for a Person
+- [People API](https://documenter.getpostman.com/view/11026000/2sA3Bq5XEh#ee3d2188-4253-4bca-9238-6b76455805a9) - Create & Update a Person (e.g. attributes, email, userId, etc)
+- [Responses API](https://documenter.getpostman.com/view/11026000/2sA3Bq5XEh#8c773032-536c-483c-a237-c7697347946e) - Create & Update a Response for a Survey
+
+## Management API
+
+The [Management API](https://documenter.getpostman.com/view/11026000/2sA3Bq5XEh#98fce5a1-1365-4125-8de1-acdb28206766) provides access to all data and settings that your account has access to in the Formbricks app. This API **requires a personal API Key** for authentication, which can be generated in the Settings section of the Formbricks app. Checkout the [API Key Setup](#how-to-generate-an-api-key) below to generate & manage API Keys.
+
+We currently have the following Management API methods exposed and below is their documentation attached in Postman:
+
+- [Action Class API](https://documenter.getpostman.com/view/11026000/2sA3Bq5XEh#81947f69-99fc-41c9-a184-f3260e02be48) - Create, List, and Delete Action Classes
+- [Attribute Class API](https://documenter.getpostman.com/view/11026000/2sA3Bq5XEh#31089010-d468-4a7c-943e-8ebe71b9a36e) - Create, List, and Delete Attribute Classes
+- [Me API](https://documenter.getpostman.com/view/11026000/2sA3Bq5XEh#79e08365-641d-4b2d-aea2-9a855e0438ec) - Retrieve Account Information
+- [People API](https://documenter.getpostman.com/view/11026000/2sA3Bq5XEh#cffc27a6-dafb-428f-8ea7-5165bedb911e) - List and Delete People
+- [Response API](https://documenter.getpostman.com/view/11026000/2sA3Bq5XEh#e544ec0d-8b30-4e33-8d35-2441cb40d676) - List, List by Survey, Update, and Delete Responses
+- [Survey API](https://documenter.getpostman.com/view/11026000/2sA3Bq5XEh#953189b2-37b5-4429-a7bd-f4d01ceae242) - List, Create, Update, and Delete Surveys
+- [Webhook API](https://documenter.getpostman.com/view/11026000/2sA3Bq5XEh#62e6ec65-021b-42a4-ac93-d1434b393c6c) - List, Create, and Delete Webhooks
+
+## How to Generate an API key
+
+The API requests are authorized with a personal API key. This API key gives you the same rights as if you were logged in at formbricks.com - **don't share it around!**
+
+1. Go to your settings on [app.formbricks.com](https://app.formbricks.com).
+2. Go to page “API keys”
+
+3. Create a key for the development or production environment.
+4. Copy the key immediately. You won’t be able to see it again.
+
+
+
+ ### Store API key safely!
+ Anyone who has your API key has full control over your account. For security reasons, you cannot view the API key again.
+
+
+### Test your API Key
+
+Hit the below request to verify that you are authenticated with your API Key and the server is responding.
+
+## Get My Profile {{ tag: 'GET', label: '/api/v1/me' }}
+
+
+
+
+ Get the product details and environment type of your account.
+
+ ### Mandatory Headers
+
+
+
+ Your Formbricks API key.
+
+
+
+ ### Delete a personal API key
+
+ 1. Go to settings on [app.formbricks.com](https://app.formbricks.com/).
+ 2. Go to page “API keys”.
+ 3. Find the key you wish to revoke and select “Delete”.
+ 4. Your API key will stop working immediately.
+
+
+
+
+
+
+
+ ```bash {{ title: 'cURL' }}
+ curl --location \
+ 'https://app.formbricks.com/api/v1/me' \
+ --header \
+ 'x-api-key: '
+ ```
+
+
+
+
+
+ ```json {{title:'200 Success'}}
+ {
+ "id": "cll2m30r70004mx0huqkitgqv",
+ "createdAt": "2023-08-08T18:04:59.922Z",
+ "updatedAt": "2023-08-08T18:04:59.922Z",
+ "type": "production",
+ "product": {
+ "id": "cll2m30r60003mx0hnemjfckr",
+ "name": "My Product"
+ },
+ "widgetSetupCompleted": false
+ }
+ ```
+ ```json {{ title: '401 Not Authenticated' }}
+ Not authenticated
+ ```
+
+
+
+
+
+Can’t figure it out? Join our [Discord](https://discord.com/invite/3YFcABF2Ts) and we'd be glad to assist you!
+
+---
diff --git a/apps/formbricks-com/app/docs/additional-features/metadata/filters.webp b/apps/formbricks-com/app/docs/additional-features/metadata/filters.webp
new file mode 100644
index 0000000000..8c9d2b6f6b
Binary files /dev/null and b/apps/formbricks-com/app/docs/additional-features/metadata/filters.webp differ
diff --git a/apps/formbricks-com/app/docs/additional-features/metadata/metadata-card.webp b/apps/formbricks-com/app/docs/additional-features/metadata/metadata-card.webp
new file mode 100644
index 0000000000..16c802f7b2
Binary files /dev/null and b/apps/formbricks-com/app/docs/additional-features/metadata/metadata-card.webp differ
diff --git a/apps/formbricks-com/app/docs/additional-features/metadata/page.mdx b/apps/formbricks-com/app/docs/additional-features/metadata/page.mdx
new file mode 100644
index 0000000000..31dfd3ebba
--- /dev/null
+++ b/apps/formbricks-com/app/docs/additional-features/metadata/page.mdx
@@ -0,0 +1,67 @@
+import { TellaVideo } from "@/components/docs/TellaVideo";
+import { MdxImage } from "@/components/shared/MdxImage";
+
+import Filters from "./filters.webp";
+import MetadataCard from "./metadata-card.webp";
+
+export const metadata = {
+ title: "User Metadata | Formbricks",
+ description:
+ "Understand the metadata of your users when they fill a Formbricks survey (both in-app & link). We currently capture the user's source information, URL, browser, and device details, along with the country & the action that triggered.",
+};
+
+#### Additional Features
+
+# User Metadata
+
+Formbricks captures metadata of your users for you when they fill a survey.
+
+This metadata is useful for understanding the context in which the user filled the survey. For example, if you are running a marketing campaign, you can understand which source is driving the most responses. Or if you are running a survey on a specific page, you can understand the user's behavior on that page.
+
+
+
+## Metadata Captured
+
+- **Source**: The source from where the user filled the survey. This could be an App, Link, or a Webpage.
+- **URL**: The URL of the page where the user filled the survey.
+- **Browser**: The browser used by the user to fill the survey.
+- **OS**: The operating system of the device used by the user to fill the survey.
+- **Device**: The device used by the user to fill the survey.
+- **Country**: The country of the user.
+- **Action**: The action that triggered the survey. This is only available for App surveys.
+
+## View Response Metadata
+
+1. Go to the Responses tab of your survey.
+2. Hover over the profile icon of the user on the response card & you should see a tooltip opening up with the metadata details.
+
+
+
+## Filter Responses by Metadata
+
+1. Go to the Responses tab of your survey.
+2. Click on the Filter button.
+3. Scroll down & Select the metadata field you want to filter by.
+4. Select the condition & the value you want to filter by.
+
+
+
+5. Now you should see the responses filtered based on the metadata you selected. If you want to see a walkthrough, view the video above to see how you can view & filter responses by metadata.
+
+## Export Metadata
+
+You can export the metadata of your responses along with the response data. When you export responses, you will see the metadata fields in the exported CSV file.
+
+---
+
+Can’t figure it out? Join our [Discord](https://discord.com/invite/3YFcABF2Ts)!
diff --git a/apps/formbricks-com/app/docs/api/client/actions/page.mdx b/apps/formbricks-com/app/docs/api/client/actions/page.mdx
deleted file mode 100644
index 1172f67c33..0000000000
--- a/apps/formbricks-com/app/docs/api/client/actions/page.mdx
+++ /dev/null
@@ -1,85 +0,0 @@
-import { Fence } from "@/components/shared/Fence";
-
-export const metadata = {
- title: "Formbricks Actions API Documentation - Manage Your Survey Data Seamlessly",
- description:
- "Unlock the full potential of Formbricks' Client Actions API. Create Actions right from the API.",
-};
-
-#### Client API
-
-# Actions API
-
-The Public Client API is designed for the JavaScript SDK and does not require authentication. It's primarily used for creating persons, sessions, and responses within the Formbricks platform. This API is ideal for client-side interactions, as it doesn't expose sensitive information.
-
-This API can be used to:
-
-- [Add Action for User](#add-action-for-user)
-
----
-
-## Add Action for User {{ tag: 'POST', label: '/api/v1/client//actions' }}
-
-Adds an Actions for a given User by their User ID
-
-
-
-
- ### Mandatory Body Fields
-
-
-
- The id of the user for whom the action is being created.
-
-
- The name of the Action being created.
-
-
-
-
-
-
-
-
- ```bash {{ title: 'cURL' }}
- curl --location --request POST 'https://app.formbricks.com/api/v1/client//actions' \
- --data-raw '{
- "userId": "1",
- "name": "new_action_v2"
-
- }'
- ```
-
- ```json {{ title: 'Example Request Body' }}
- {
- "userId": "1",
- "name": "new_action_v3"
- }
- ```
-
-
-
-
-
- ```json {{ title: '200 Success' }}
- {
- "data": {}
- }
- ```
-
- ```json {{ title: '400 Bad Request' }}
- {
- "code": "bad_request",
- "message": "Fields are missing or incorrectly formatted",
- "details": {
- "name": "Required"
- }
- }
- ```
-
-
-
-
-
-
----
diff --git a/apps/formbricks-com/app/docs/api/client/displays/page.mdx b/apps/formbricks-com/app/docs/api/client/displays/page.mdx
deleted file mode 100644
index fd14e1084f..0000000000
--- a/apps/formbricks-com/app/docs/api/client/displays/page.mdx
+++ /dev/null
@@ -1,145 +0,0 @@
-import { Fence } from "@/components/shared/Fence";
-
-export const metadata = {
- title: "Formbricks Public Client API Guide: Manage Survey Displays & Responses",
- description:
- "Dive deep into Formbricks' Public Client API designed for customisation. This comprehensive guide provides detailed instructions on how to mark create and update survey displays for users.",
-};
-
-#### Client API
-
-# Displays API
-
-The Public Client API is designed for the JavaScript SDK and does not require authentication. It's primarily used for creating persons, sessions, and responses within the Formbricks platform. This API is ideal for client-side interactions, as it doesn't expose sensitive information.
-
-This set of API can be used to
-- [Create Display](#create-display)
-- [Update Display](#update-display)
-
----
-
-## Create Display {{ tag: 'POST', label: '/api/v1/client//diplays' }}
-
-
-
-
- Create Display of survey for a user
-
- ### Mandatory Request Body JSON Keys
-
-
- Survey ID to mark as viewed for a person
-
-
-
- ### Optional Request Body JSON Keys
-
-
- Already existing user's ID to mark as viewed for a survey
-
-
- Already existing response's ID to link with this new Display
-
-
-
-
-
-
-
- Update a display by it's ID
-
- ### Optional Request Body JSON Keys
-
-
- Already existing user's ID to mark as viewed for a survey
-
-
- Already existing response's ID to link with this new Display
-
-
-
-
-
-
-
-
-
- ```bash {{ title: 'cURL' }}
- curl -X POST \
- 'https://app.formbricks.com/api/v1/client//displays/' \
- -H 'Content-Type: application/json' \
- -d '{
- "userId":""
- }'
- ```
-
-
-
-
-
- ```json {{title:'200 Success'}}
- {
- "data": {}
- }
- ```
-
- ```json {{ title: '400 Bad Request' }}
- {
- "code": "bad_request",
- "message": "Fields are missing or incorrectly formatted",
- "details": {
- "surveyId": "Required"
- }
- }
- ```
-
-
-
-
-
----
diff --git a/apps/formbricks-com/app/docs/api/client/overview/page.mdx b/apps/formbricks-com/app/docs/api/client/overview/page.mdx
deleted file mode 100644
index 8399456133..0000000000
--- a/apps/formbricks-com/app/docs/api/client/overview/page.mdx
+++ /dev/null
@@ -1,47 +0,0 @@
-export const metadata = {
- title: "Formbricks API Overview: Public Client & Management API Breakdown",
- description:
- "Get a detailed understanding of Formbricks' dual API offerings: the unauthenticated Public Client API optimized for client-side tasks and the secured Management API for advanced account operations. Choose the perfect fit for your integration needs and ensure robust data handling",
-};
-
-#### API
-
-# API Overview
-
-Formbricks offers two types of APIs: the **Public Client API** and the **Management API**. Each API serves a different purpose, has different authentication requirements, and provides access to different data and settings.
-
-Checkout the [API Key Setup](/docs/api/management/api-key-setup) - to generate, store, or delete API Keys.
-
-## Public Client API
-
-The Public Client API is designed for the JavaScript SDK and does not require authentication. It's primarily used for creating persons, sessions, and responses within the Formbricks platform. This API is ideal for client-side interactions, as it doesn't expose sensitive information.
-
-- [Actions API](/docs/api/client/actions) - Create actions for a person
-- [Displays API](/docs/api/client/displays) - Mark Survey as Displayed or Responded for a Person
-- [People API](/docs/api/client/people) - Create & update people (e.g. attributes)
-- [Responses API](/docs/api/client/responses) - Create & update responses for a survey
-
-## Management API
-
-The Management API provides access to all data and settings that are visible in the Formbricks App. This API requires a personal API Key for authentication, which can be generated in the Settings section of the Formbricks App. With the Management API, you can manage your Formbricks account programmatically, accessing and modifying data and settings as needed.
-
-**Auth:** Personal API Key
-
-API requests made to the Management API are authorized using a personal API key. This key grants the same rights and access as if you were logged in at formbricks.com. It's essential to keep your API key secure and not share it with others.
-
-To generate, store, or delete an API key, follow the instructions provided on the following page [API Key](/docs/api/management/api-key-setup).
-
-- [Action Class API](/docs/api/management/action-classes) - Create, Update, and Delete Action Classes
-- [Attribute Class API](/docs/api/management/attribute-classes) - Create, Update, and Delete Attribute Classes
-- [Me API](/docs/api/management/me) - Retrieve Account Information
-- [People API](/docs/api/management/people) - Create, Update, and Delete People
-- [Responses API](/docs/api/management/responses) - Create, Update, and Delete Responses
-- [Surveys API](/docs/api/management/surveys) - Create, Update, and Delete Surveys
-- [Webhook API](/docs/api/management/webhooks) - Create, Update, and Delete Webhooks
-
-
- By understanding the differences between these two APIs, you can choose the appropriate one for your needs,
- ensuring a secure and efficient integration with the Formbricks platform.
-
-
----
diff --git a/apps/formbricks-com/app/docs/api/client/people/page.mdx b/apps/formbricks-com/app/docs/api/client/people/page.mdx
deleted file mode 100644
index d4b85735b5..0000000000
--- a/apps/formbricks-com/app/docs/api/client/people/page.mdx
+++ /dev/null
@@ -1,130 +0,0 @@
-import { Fence } from "@/components/shared/Fence";
-
-export const metadata = {
- title: "Formbricks Public Client API Guide: Manage Users",
- description:
- "Dive deep into Formbricks' Public Client API designed for customisation. This comprehensive guide provides detailed instructions on creating and updating users to help in user identification.",
-};
-
-#### Client API
-
-# People API
-
-The Public Client API is designed for the JavaScript SDK and does not require authentication. It's primarily used for creating persons, sessions, and responses within the Formbricks platform. This API is ideal for client-side interactions, as it doesn't expose sensitive information.
-
-This set of API can be used to
-- [Create Person](#create-person)
-- [Update Person](#update-person)
-
----
-
-## Create Person {{ tag: 'POST', label: '/api/v1/client//people' }}
-
-
-
-
- Create User with your own User ID
-
- ### Mandatory Request Body JSON Keys
-
-
- User ID which you would like to identify the person with
-
-
-
-
-
-
- Update Person by their User ID
-
- ### Mandatory Request Body JSON Keys
-
-
- Key Value pairs of attributes to add to the user
-
-
-
-
-
-
-
-
- ```bash {{ title: 'cURL' }}
- curl -X POST \
- --location \
- 'https://app.formbricks.com/api/v1/client//people/'
- -H 'Content-Type: application/json' \
- -d '{
- "attributes":{
- "welcome_to":"formbricks"
- }
- }'
- ```
-
-
-
-
-
- ```json {{title:'200 Success'}}
- {
- "data": {}
- }
- ```
-
- ```json {{ title: '500 Internal Server Error' }}
- {
- "code": "internal_server_error",
- "message": "Database operation failed",
- "details": {}
- }
- ```
-
-
-
-
-
----
diff --git a/apps/formbricks-com/app/docs/api/client/responses/page.mdx b/apps/formbricks-com/app/docs/api/client/responses/page.mdx
deleted file mode 100644
index b2099d95fb..0000000000
--- a/apps/formbricks-com/app/docs/api/client/responses/page.mdx
+++ /dev/null
@@ -1,200 +0,0 @@
-import { Fence } from "@/components/shared/Fence";
-
-export const metadata = {
- title: "Formbricks Responses API Documentation - Manage Your Survey Data Seamlessly",
- description:
- "Unlock the full potential of Formbricks' Responses API. From fetching to updating survey responses, our comprehensive guide helps you integrate and manage survey data efficiently without compromising security. Ideal for client-side interactions.",
-};
-
-#### Client API
-
-# Responses API
-
-The Public Client API is designed for the JavaScript SDK and does not require authentication. It's primarily used for creating persons, sessions, and responses within the Formbricks platform. This API is ideal for client-side interactions, as it doesn't expose sensitive information.
-
-This set of API can be used to
-- [Create Response](#create-response)
-- [Update Response](#update-response)
-
----
-
-## Create Response {{ tag: 'POST', label: '/api/v1/client//responses' }}
-
-Add a new response to a survey.
-
-
-
-
- ### Mandatory Body Fields
-
-
-
- The id of the survey the response belongs to.
-
-
- Marks whether the response is complete or not.
-
-
- The data of the response as JSON object (key: questionId, value: answer).
-
-
-
-
- ### Optional Body Fields
-
-
-
- Pre-existing User ID to identify the user sending the response
-
-
-
-### Parameters Explained
-
-| field name | required | default | description |
-| ---------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
-| data | yes | - | The response data object (answers to the survey). In this object the key is the questionId, the value the answer of the user to this question. |
-| userId | no | - | The person this response is connected to. |
-| surveyId | yes | - | The survey this response is connected to. |
-| finished | yes | false | Mark a response as complete to be able to filter accordingly. |
-
-
-
-
- ### Mandatory Body Fields
-
-
-
- Marks whether the response is complete or not.
-
-
- The data of the response as JSON object (key: questionId, value: answer).
-
-
-
-### Parameters Explained
-
-| field name | required | default | description |
-| ---------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
-| data | yes | - | The response data object (answers to the survey). In this object the key is the questionId, the value the answer of the user to this question. |
-| finished | yes | false | Mark a response as complete to be able to filter accordingly. |
-
-
-
-
-
-
- ```bash {{ title: 'cURL' }}
- curl --location --request PUT 'https://app.formbricks.com/api/v1/client//responses/' \
- --data-raw '{
- "finished":false,
- "data": {
- "clfqjny0v0003yzgscnog1j9i": 10,
- "clfqjtn8n0070yzgs6jgx9rog": "I love Formbricks"
- }
- }'
- ```
-
- ```json {{ title: 'Example Request Body' }}
- {
- "finished":false,
- "data": {
- "clfqjny0v0003yzgscnog1j9i": 10,
- "clfqjtn8n0070yzgs6jgx9rog": "I love Formbricks"
- }
- }
- ```
-
-
-
-
-
- ```json {{ title: '200 Success' }}
- {
- "data": {}
- }
- ```
-
- ```json {{ title: '400 Bad Request' }}
- {
- "code": "bad_request",
- "message": "data was not provided.",
- "details": {
- "data": "This field is required."
- }
- }
- ```
-
- ```json {{ title: '404 Not Found' }}
- {
- "code": "not_found",
- "message": "Response not found"
- }
- ```
-
-
-
-
-
diff --git a/apps/formbricks-com/app/docs/api/management/action-classes/page.mdx b/apps/formbricks-com/app/docs/api/management/action-classes/page.mdx
deleted file mode 100644
index d7be643d30..0000000000
--- a/apps/formbricks-com/app/docs/api/management/action-classes/page.mdx
+++ /dev/null
@@ -1,297 +0,0 @@
-import { Fence } from "@/components/shared/Fence";
-import {generateManagementApiMetadata} from "@/lib/utils"
-export const metadata = generateManagementApiMetadata("Action Class",["Fetch","Create","Delete"])
-
-#### Management API
-
-# Action Classes API
-
-This set of API can be used to
-- [List Actions](#get-all-action-classes)
-- [Get Action](#get-action-class-by-id)
-- [Create Actions](#create-action-class)
-- [Delete Actions](#delete-action-class)
-
-You will need an API Key to interact with these APIs.
-
----
-
-## Get all Action Classes {{ tag: 'GET', label: '/api/v1/management/action-classes' }}
-
-
-
-
- Get all the existing action classes in your environment.
-
- ### Mandatory Headers
-
-
-
- Your Formbricks API key.
-
-
-
-
-
-
- Delete an action class by its ID.
-
- ### Mandatory Headers
-
-
-
- Your Formbricks API key.
-
-
-
-
-
-
-
-
- ```bash {{ title: 'cURL' }}
- curl -X DELETE https://app.formbricks.com/api/v1/management/action-classes/ \
- --header 'x-api-key: '
- ```
-
-
-
-
-
- ```json {{title:'200 Success'}}
- {
- "data": {
- "id": "cln9w1cno0008z8zu79nk5w0c",
- "createdAt": "2023-10-03T05:37:26.100Z",
- "updatedAt": "2023-10-03T05:37:26.100Z",
- "name": "My Action from API",
- "description": null,
- "type": "code",
- "noCodeConfig": null,
- "environmentId": "cln8k0t47000fz87njmmu2bck"
- }
- }
- ```
-
- ```json {{ title: '401 Unauthorized' }}
- {
- "code": "not_authenticated",
- "message": "Not authenticated",
- "details": {
- "x-Api-Key": "Header not provided or API Key invalid"
- }
- }
- ```
-
-
-
-
-
----
diff --git a/apps/formbricks-com/app/docs/api/management/api-key-setup/page.mdx b/apps/formbricks-com/app/docs/api/management/api-key-setup/page.mdx
deleted file mode 100644
index 8e9bb1ab8e..0000000000
--- a/apps/formbricks-com/app/docs/api/management/api-key-setup/page.mdx
+++ /dev/null
@@ -1,102 +0,0 @@
-import { MdxImage } from "@/components/shared/MdxImage";
-
-import AddApiKey from "./add-api-key.webp";
-import ApiKeySecret from "./api-key-secret.webp";
-
-export const metadata = {
- title: "Formbricks API Key: Setup and Testing",
- description:
- "This guide provides step-by-step instructions to generate, store, and delete API keys, ensuring safe and authenticated access to your Formbricks account.",
-};
-
-#### API
-
-# API Key Setup
-
-## Auth: Personal API key
-
-The API requests are authorized with a personal API key. This API key gives you the same rights as if you were logged in at formbricks.com - **don't share it around!**
-
-### How to generate an API key
-
-1. Go to your settings on [app.formbricks.com](https://app.formbricks.com).
-2. Go to page “API keys”
-
-3. Create a key for the development or production environment.
-4. Copy the key immediately. You won’t be able to see it again.
-
-
-
- ### Store API key safely Anyone who has your API key has full control over your account. For security
- reasons, you cannot view the API key again.
-
-
-### Test your API Key
-
-Hit the below request to verify that you are authenticated with your API Key and the server is responding.
-
-## Get My Profile {{ tag: 'GET', label: '/api/v1/me' }}
-
-
-
-
- Get the product details and environment type of your account.
-
- ### Mandatory Headers
-
-
-
- Your Formbricks API key.
-
-
-
-
-
-
-
-
- ```bash {{ title: 'cURL' }}
- curl --location \
- 'https://app.formbricks.com/api/v1/me' \
- --header \
- 'x-api-key: '
- ```
-
-
-
-
-
- ```json {{title:'200 Success'}}
- {
- "id": "cll2m30r70004mx0huqkitgqv",
- "createdAt": "2023-08-08T18:04:59.922Z",
- "updatedAt": "2023-08-08T18:04:59.922Z",
- "type": "production",
- "product": {
- "id": "cll2m30r60003mx0hnemjfckr",
- "name": "My Product"
- },
- "widgetSetupCompleted": false
- }
- ```
- ```json {{ title: '401 Not Authenticated' }}
- Not authenticated
- ```
-
-
-
-
-
----
-
-### Delete a personal API key
-
-1. Go to settings on [app.formbricks.com](https://app.formbricks.com/).
-2. Go to page “API keys”.
-3. Find the key you wish to revoke and select “Delete”.
-4. Your API key will stop working immediately.
diff --git a/apps/formbricks-com/app/docs/api/management/attribute-classes/page.mdx b/apps/formbricks-com/app/docs/api/management/attribute-classes/page.mdx
deleted file mode 100644
index 009376f10a..0000000000
--- a/apps/formbricks-com/app/docs/api/management/attribute-classes/page.mdx
+++ /dev/null
@@ -1,289 +0,0 @@
-import { Fence } from "@/components/shared/Fence";
-import {generateManagementApiMetadata} from "@/lib/utils"
-
-export const metadata = generateManagementApiMetadata("Attribute Class",["Fetch","Create","Delete"])
-
-#### Management API
-
-# Attribute Classes API
-
-This set of API can be used to
-- [List Attributes](#get-all-attribute-classes)
-- [Get Attributes](#get-attribute-class-by-id)
-- [Create Attributes](#create-attribute-class)
-- [Delete Attributes](#delete-attribute-class)
-
-You will need an API Key to interact with these APIs.
-
----
-
-## Get all Attribute Classes {{ tag: 'GET', label: '/api/v1/management/attribute-classes' }}
-
-
-
-
- Get all the existing attribute classes in your environment.
-
- ### Mandatory Headers
-
-
-
- Your Formbricks API key.
-
-
-
-
-
- Retrieve all the surveys you have for the environment with pagination.
-
- ### Mandatory Headers
-
-
-
- Your Formbricks API key.
-
-
-
- ### Query Parameters
-
-
- The number of surveys to skip before returning the results.
-
-
-
- The number of surveys to return.
-
-
-
-
-
We aim to provide the best possible customer service. Please email our CEO and she will personally handle your issue.
",
- "buttonUrl": "mailto:ceo@company.com",
- "buttonExternal": true,
- "dismissButtonLabel": "Skip"
- }
- ],
- "thankYouCard": {
- "enabled": false
- },
- "delay": 0,
- "autoComplete": null,
- "closeOnDate": null,
- "surveyClosedMessage": null,
- "verifyEmail": null
- }
- }
- ```
- ```json {{ title: '401 Not Authenticated' }}
- {
- "code": "not_authenticated",
- "message": "Not authenticated",
- "details": {
- "x-Api-Key": "Header not provided or API Key invalid"
- }
- }
- ```
-
-
-
-
-
----
diff --git a/apps/formbricks-com/app/docs/api/management/webhooks/page.mdx b/apps/formbricks-com/app/docs/api/management/webhooks/page.mdx
deleted file mode 100644
index a4efd78cf9..0000000000
--- a/apps/formbricks-com/app/docs/api/management/webhooks/page.mdx
+++ /dev/null
@@ -1,398 +0,0 @@
-import {generateManagementApiMetadata} from "@/lib/utils"
-
-export const metadata = generateManagementApiMetadata("Webhook",["Fetch","Create","Delete"])
-
-#### Management API
-
-# Webhook API
-
-Formbricks' Webhook API offers a powerful interface for interacting with webhooks. Webhooks allow you to receive real-time HTTP notifications of changes to specific objects in the Formbricks environment.
-
-The behavior of the webhooks is determined by their trigger settings. The trigger determines which updates the webhook sends. Current available triggers include "responseCreated", "responseUpdated", and "responseFinished". This allows you to customize your webhooks to only send notifications for the events that are relevant to your application.
-
-Webhooks are tied to a specific Formbricks environment. Once set, a webhook will receive updates from all surveys within this environment. This makes it easy to manage your data flow and ensure that all relevant updates are caught by the webhook.
-
-This set of API can be used to
-- [List All Webhooks](#list-webhooks)
-- [Get Webhook](#retrieve-webhook-by-id)
-- [Create Webhook](#create-webhook)
-- [Delete Webhook](#delete-webhook-by-id)
-
-And the detailed Webhook Payload is elaborated [here](#webhook-payload).
-
-These APIs are designed to facilitate seamless integration of Formbricks with third-party systems. By making use of our webhook API, you can automate the process of sending data to these systems whenever significant events occur within your Formbricks environment.
-
-You will need an API Key to interact with these APIs.
-
----
-
-## List Webhooks {{ tag: 'GET', label: '/api/v1/webhooks' }}
-
-
-
-
- Learn how to retrieve a list of all webhooks via API.
-
- ### Mandatory Headers
-
-
-
- Your Formbricks API key.
-
-
-
-
-
-
- ### Mandatory Headers
-
-
-
- Your Formbricks API key.
-
-
-
- ### Request Body Parameters
-
-
-
- The URL where the webhook will send data to.
-
-
- List of events that will trigger the webhook.
-
-
- List of survey IDs that will trigger the webhook. If not provided, the webhook will be triggered for all surveys.
-
-
-
-| field name | required | default | description |
-| ---------- | -------- | ------- | ----------------------------------------------------------------------------------------------------------------- |
-| url | yes | - | The endpoint that the webhook will send data to |
-| trigger | yes | - | The event that will trigger the webhook ("responseCreated" or "responseUpdated" or "responseFinished") |
-| surveyIds | no | - | List of survey IDs that will trigger the webhook. If not provided, the webhook will be triggered for all surveys. |
-
-
-
-
- ### Mandatory Headers
-
-
-
- Your Formbricks API key.
-
-
-
-
-
-
-
-
- ```bash {{ title: 'cURL' }}
- curl --location --request DELETE 'https://app.formbricks.com/api/v1/webhooks/' \
- --header 'x-api-key: '
- ```
-
-
-
-
-
- ```json {{ title: '200 Success' }}
- {
- "data": {
- "id": "cliu167rk000019zfhbo68bar",
- "createdAt": "2023-06-13T08:38:02.960Z",
- "updatedAt": "2023-06-13T08:38:02.960Z",
- "url": "https://mysystem.com/myendpoint",
- "environmentId": "clisypjy4000319t4imm289uo",
- "triggers": ["responseFinished"]
- }
- }
- ```
-
- ```json {{ title: '401 Not Authenticated' }}
- {
- "code": "not_authenticated",
- "message": "Not authenticated",
- "details": {
- "x-Api-Key": "Header not provided or API Key invalid"
- }
- }
- ```
-
- ```json {{ title: '404 Not Found' }}
- {
- "code": "not_found",
- "message": "Webhook not found.",
- "details": {
- "webhookId": "The requested webhook does not exist."
- }
- }
- ```
-
-
-
-
-
-
----
-
-## Webhook Payload
-
-This documentation helps understand the payload structure that will be received when the webhook is triggered in Formbricks.
-
-
-
-
-| Variable | Type | Description |
-| --------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
-| webhookId | String | Webhook's Id |
-| event | String | The name of the trigger event [responseCreated, responseUpdated, responseFinished] |
-| data | Object | Contains the details of the newly created response. |
-| data.id | String | Formbricks Response ID. |
-| data.createdAt | String | The timestamp when the response was created. |
-| data.updatedAt | String | The timestamp when the response was last updated. |
-| data.surveyId | String | The identifier of the survey associated with this response. |
-| data.finished | Boolean | A boolean value indicating whether the survey response is marked as finished. |
-| data.data | Object | An object containing the response data, where keys are question identifiers, and values are the corresponding answers given by the respondent. |
-| data.meta | Object | Additional metadata related to the response, such as the user's operating system and browser information. |
-| data.personAttributes | Object | An object with attributes related to the respondent, such as their email and a user ID (if available). |
-| data.person | Object | Information about the respondent, including their unique id, attributes, and creation/update timestamps. |
-| data.notes | Array | An array of notes associated with the response (if any). |
-| data.tags | Array | An array of tags assigned to the response (if any). |
-
-
-
-
- ### An example webhook payload
-
-
-
- ```json
- {
- "webhookId": "cljwxvjos0003qhnvj2jg4k5i",
- "event": "responseCreated",
- "data": {
- "id": "cljwy2m8r0001qhclco1godnu",
- "createdAt": "2023-07-10T14:14:17.115Z",
- "updatedAt": "2023-07-10T14:14:17.115Z",
- "surveyId": "cljsf3d7a000019cv9apt2t27",
- "finished": false,
- "data": {
- "qumbk3fkr6cky8850bvvq5z1": "Executive"
- },
- "meta": {
- "userAgent": {
- "os": "Mac OS",
- "browser": "Chrome"
- }
- },
- "personAttributes": {
- "email": "test@web.com",
- "userId": "THIS-IS-A-VERY-LONG-USER-ID-FOR-TESTING"
- },
- "person": {
- "id": "cljold01t0000qh8ewzigzmjk",
- "attributes": {
- "email": "test@web.com",
- "userId": "THIS-IS-A-VERY-LONG-USER-ID-FOR-TESTING"
- },
- "createdAt": "2023-07-04T17:56:17.154Z",
- "updatedAt": "2023-07-04T17:56:17.154Z"
- },
- "notes": [],
- "tags": []
- }
- }
- ```
-
-
-
-
-
-
----
diff --git a/apps/formbricks-com/app/docs/contributing/creating-a-service/page.mdx b/apps/formbricks-com/app/docs/contributing/creating-a-service/page.mdx
index 53a8a4cfd6..f07b37cd5f 100644
--- a/apps/formbricks-com/app/docs/contributing/creating-a-service/page.mdx
+++ b/apps/formbricks-com/app/docs/contributing/creating-a-service/page.mdx
@@ -209,13 +209,12 @@ We will rewrite the function `getApiKey` we created in the `service.ts` file to
```ts
-import { unstable_cache } from "next/cache";
+import { cache } from "@formbricks/lib/cache";
-import { SERVICES_REVALIDATION_INTERVAL } from "../constants";
import { apiKeyCache } from "./cache";
-export const getApiKey = async (apiKeyId: string): Promise =>
- unstable_cache(
+export const getApiKey = (apiKeyId: string): Promise =>
+ cache(
async () => {
validateInputs([apiKeyId, ZString]);
@@ -242,7 +241,6 @@ export const getApiKey = async (apiKeyId: string): Promise =>
[`getApiKey-${apiKeyId}`],
{
tags: [apiKeyCache.tag.byId(apiKeyId)],
- revalidate: SERVICES_REVALIDATION_INTERVAL,
}
)();
```
@@ -265,9 +263,7 @@ From the screenshot above we see that `unstable_cache` receives 3 arguments:
1. `fetchData`: In our case this is the exact function of your service without caching (step 3)
2. `keyParts`: As a rule of thumb, the key must consist of the name of the function and the arguments passed into the function, all separated by a dash. In our case it is called `getApiKey-${apiKeyId}` because the function name is `getApiKey` and we receive only one argument called `apiKeyId`
-3. `options`: which consists of **tags** and **revalidate**
- 1. `tags`: This is where the tags you created in step 4a comes in, tags are created solely based on the arguments passed to the function. (please reference existing services in `packages/lib` to see more variations of this when dealing with more than one argument)
- 2. `revalidate`: We have a global constant for this which you can use called `SERVICES_REVALIDATION_INTERVAL`
+3. `options`: which consists of **tags** that controls the revalidation of the cache. This is where the tags you created in step 4a comes in, tags are created solely based on the arguments passed to the function. (please reference existing services in `packages/lib` to see more variations of this when dealing with more than one argument)
In create, update and delete requests, you don’t need caching however these are the places where the revalidate method is called. For example when the apiKey is deleted we want to call the revalidate method and pass in the id and environmentId, so we invalidate every cached function with `id` and `environmentId` tags.
diff --git a/apps/formbricks-com/app/docs/getting-started/framework-guides/page.mdx b/apps/formbricks-com/app/docs/getting-started/framework-guides/page.mdx
index 7778813adf..6a04df4bcb 100644
--- a/apps/formbricks-com/app/docs/getting-started/framework-guides/page.mdx
+++ b/apps/formbricks-com/app/docs/getting-started/framework-guides/page.mdx
@@ -76,7 +76,7 @@ Install the Formbricks SDK using one of the package managers ie `npm`,`pnpm`,`ya
```shell {{ title: 'npm' }}
-npm install --save @formbricks/js
+npm install @formbricks/js
```
```shell {{ title: 'pnpm' }}
pnpm add @formbricks/js
@@ -153,7 +153,7 @@ Code snippets for the integration for both conventions are provided to further a
```shell {{ title: 'npm' }}
-npm install --save @formbricks/js
+npm install @formbricks/js
```
```shell {{ title: 'pnpm' }}
pnpm add @formbricks/js
@@ -283,7 +283,7 @@ We will make sure the SDK is only loaded and used on the client side, as it's no
```shell {{ title: 'npm' }}
-npm install --save @formbricks/js
+npm install @formbricks/js
````
```shell {{ title: 'pnpm' }}
diff --git a/apps/formbricks-com/app/docs/in-app-surveys/advanced-targeting/page.mdx b/apps/formbricks-com/app/docs/in-app-surveys/advanced-targeting/page.mdx
index 95e037eaba..faf91e577c 100644
--- a/apps/formbricks-com/app/docs/in-app-surveys/advanced-targeting/page.mdx
+++ b/apps/formbricks-com/app/docs/in-app-surveys/advanced-targeting/page.mdx
@@ -33,7 +33,7 @@ Advanced Targeting allows you to show surveys to the right group of people. You
details to start the freemium plan.
-1. On the Formbricks dashboard, click on **People & Segments** tab from the top navigation bar.
+1. On the Formbricks dashboard, click on **People** tab from the top navigation bar.
2. Switch to the **Segments** tab & click on **Create Segment**.
diff --git a/apps/formbricks-com/app/docs/in-app-surveys/developer-quickstart/page.mdx b/apps/formbricks-com/app/docs/in-app-surveys/developer-quickstart/page.mdx
new file mode 100644
index 0000000000..fdbc457c3f
--- /dev/null
+++ b/apps/formbricks-com/app/docs/in-app-surveys/developer-quickstart/page.mdx
@@ -0,0 +1,184 @@
+import DemoPreview from "@/components/dummyUI/DemoPreview";
+import { MdxImage } from "@/components/shared/MdxImage";
+
+export const metadata = {
+ title: "Formbricks Functions for Frontend Developers: Quickstart Guide",
+ description:
+ "An overview of all available options for frontend developers to integrate and display surveys in web applications. Learn the key methods, configuration settings, and best practices.",
+};
+
+# Formbricks Functions for Frontend Developers: Quickstart Guide
+
+An overview of all available options for frontend developers to integrate and display surveys in web applications. Learn the key methods, configuration settings, and best practices.
+
+## Formbricks Integration
+
+Integrating Formbricks into your web application is straightforward, but it's important to follow the correct steps to ensure proper setup and functionality. For detailed instructions tailored to your development environment, please refer to our [Framework Guides](/docs/getting-started/framework-guides).
+
+## Check Availability
+
+Before using Formbricks, it's best practice to confirm it's available on the current web page. You can use a simple check to ensure Formbricks is not null:
+
+
+
+
+```javascript
+if (window.formbricks !== null) {
+ console.log("Formbricks is available");
+} else {
+ console.error("Formbricks is not available");
+}
+```
+
+
+
+
+If Formbricks is not available, ensure it's properly integrated into your web application according to the installation guide.
+
+## Initializing Formbricks
+
+To start using Formbricks features, you must initialize it with the necessary environment information. This can be done with or without user identification.
+For comprehensive guidance on setting up user identification, please consult our [User Identification Guide](/docs/in-app-surveys/user-identification).
+
+### Initialization Without User ID
+
+If you do not need user-specific tracking (e.g. on public facing websites with a lot of traffic), you can initialize Formbricks with just the `environmentId` and `apiHost`:
+
+
+
+
+```javascript
+formbricks.init({
+ environmentId: "",
+ apiHost: "",
+});
+```
+
+
+
+
+### Initialization With User ID
+
+If you need user-specific tracking, initialize Formbricks with a `userId` in addition to the `environmentId` and `apiHost`:
+
+
+
+
+```javascript
+formbricks.init({
+ environmentId: "",
+ apiHost: "",
+ userId: "",
+});
+```
+
+
+
+
+This setup allows you to associate interactions with specific users, enabling detailed tracking and user-specific functionality.
+
+## Enabling Debug Mode
+
+To enable debug mode in Formbricks, add `?formbricksDebug=true` to your URL. This activates detailed debug messages in the browser console, providing deeper insights into Formbricks' operation and potential issues.
+
+For comprehensive guidance on using debug mode, refer to our [Debug Mode Documentation](/docs/getting-started/framework-guides#debugging-formbricks-integration). It covers additional troubleshooting tips and information on analyzing Formbricks' integration.
+## Tracking Code Actions
+
+Formbricks allows you to track code-based actions, which is useful for logging events or user interactions in your application.
+For detailed information on using code-based actions, please visit our [Code Actions Guide](/docs/in-app-surveys/actions#code-actions).
+
+
+
+
+```javascript
+formbricks.track("Code Action");
+```
+
+
+
+
+The parameter "Code Action" can be customized to represent various actions, providing flexibility for different tracking scenarios.
+
+## Setting User Attributes
+
+
+ Please note that this function requires user identification to be active. Ensure you've initialized Formbricks with a `userId` before attempting to use this function.
+
+
+If user identification is active, you can set custom attributes for the identified user. This can be helpful for segmenting users based on specific characteristics or properties.
+To learn how to set custom user attributes, please check out our [User Attributes Guide](/docs/in-app-surveys/attributes#setting-custom-user-attributes).
+
+
+
+
+```javascript
+formbricks.setAttribute("Plan", "Paid");
+```
+
+
+
+
+In this example, the "Plan" attribute is set to "Paid", indicating the user's subscription status. You can set multiple attributes to capture additional user information. These attributes can be used to target surveys to specific users. You cannot set `userId` via this function.
+
+
+
+## Setting User Email
+
+
+ Please note that this function requires user identification to be active. Ensure you've initialized Formbricks with a `userId` before attempting to use this function.
+
+
+To associate an email address with an identified user, you can use the `setEmail` function. This is useful for linking a user's email with their interactions:
+
+
+
+
+```javascript
+formbricks.setEmail("test@example.com");
+```
+
+
+
+
+Setting the email can facilitate user communication and integration with other systems, enabling a more seamless user experience.
+
+## Logout
+
+To log out and deinitialize Formbricks, use the `formbricks.logout()` function. This action clears the current initialization configuration and erases stored frontend information, such as the surveys a user has viewed or completed. It's an important step when a user logs out of your application or when you want to reset Formbricks.
+
+
+
+
+```javascript
+formbricks.logout();
+```
+
+
+
+
+
+ After calling `formbricks.logout()`, you'll need to reinitialize Formbricks before using any of its features again. Ensure that you properly reinitialize Formbricks to avoid unexpected errors or behavior in your application.
+
+
+## Resetting Formbricks
+
+The `formbricks.reset()` function is a convenient way to clear current Formbricks data, and then reinitialize Formbricks. This action not only removes stored frontend information, such as the surveys a user has viewed or completed, but also reinitializes Formbricks with the settings used during the original initialization.
+
+
+
+
+```javascript
+formbricks.reset();
+```
+
+
+
+
+After calling `formbricks.reset()`, Formbricks is reinitialized, meaning you can continue using its features without additional setup. Be aware that any custom attributes, tracking, or user-specific data will be cleared and restored to the initial state.
+
+## Deprecated Function
+
+Please be aware that the following function is deprecated and should not be used in new code or maintained projects:
+
+- `formbricks.setUserId()`: Instead of using this function, set the `userId` during the initialization of Formbricks. This change ensures a more consistent approach to user identification and reduces the risk of errors due to inconsistent user context.
+
diff --git a/apps/formbricks-com/app/docs/in-app-surveys/recontact/app-survey.webp b/apps/formbricks-com/app/docs/in-app-surveys/recontact/app-survey.webp
new file mode 100644
index 0000000000..467e536c8a
Binary files /dev/null and b/apps/formbricks-com/app/docs/in-app-surveys/recontact/app-survey.webp differ
diff --git a/apps/formbricks-com/app/docs/in-app-surveys/recontact/global-wait-time.webp b/apps/formbricks-com/app/docs/in-app-surveys/recontact/global-wait-time.webp
new file mode 100644
index 0000000000..6208dfa66b
Binary files /dev/null and b/apps/formbricks-com/app/docs/in-app-surveys/recontact/global-wait-time.webp differ
diff --git a/apps/formbricks-com/app/docs/in-app-surveys/recontact/ignore-wait-time.webp b/apps/formbricks-com/app/docs/in-app-surveys/recontact/ignore-wait-time.webp
new file mode 100644
index 0000000000..97809d77c2
Binary files /dev/null and b/apps/formbricks-com/app/docs/in-app-surveys/recontact/ignore-wait-time.webp differ
diff --git a/apps/formbricks-com/app/docs/in-app-surveys/recontact/page.mdx b/apps/formbricks-com/app/docs/in-app-surveys/recontact/page.mdx
new file mode 100644
index 0000000000..5716922ae1
--- /dev/null
+++ b/apps/formbricks-com/app/docs/in-app-surveys/recontact/page.mdx
@@ -0,0 +1,108 @@
+import { MdxImage } from "@/components/shared/MdxImage";
+
+import AppSurvey from "./app-survey.webp";
+import GlobalWaitTime from "./global-wait-time.webp";
+import SurveyRecontact from "./survey-recontact.webp";
+import IgnoreWaitTime from "./ignore-wait-time.webp";
+
+export const metadata = {
+ title: "Recontact Options in Formbricks: When to show a survey again to a user",
+ description:
+ "Explore how to configure Recontact options in Formbricks to control the frequency of survey exposure to users, ensuring effective feedback collection without compromising user experience.",
+};
+
+#### In-App Surveys
+
+# Recontact Options
+
+Recontact options in Formbricks enable you to manage how often and under what conditions a survey is shown to a user. This feature is crucial for balancing effective feedback collection with a positive user experience by preventing survey fatigue.
+
+## When do Recontact Options come into play?
+
+Recontact options are the last layer of the logic that determines if a survey is shown to the current user. The logic goes as follows:
+
+1. Targeting: Does the current user targeted to fill out this survey? If yes...
+2. Trigger: Is the survey triggered? If yes...
+3. **Recontact Options:** Should the survey be shown (again) to this user? That's dependent on:
+- Did the user see any survey recently (meaning, has Global Waiting Time passed)?
+- Did the user see this specific survey already?
+- How many times did the user see this specific survey already?
+- Has the user already responded to this survey?
+
+As you can see, there are a lot of different cases to cover. Let's have a closer look 👇
+
+
+## Recontact Options
+
+By default, a survey is shown to each user only once.
+
+You can adjust the default behavior by modifying the Recontact Options for each survey in the settings:
+
+1. Open the Survey Editor for the survey you want to see & modify the Recontact Options for.
+2. Select the Settings Tab.
+3. Ensure your Survey type is set to **App Survey**.
+
+
+
+4. Scroll down to the Recontact Options section.
+
+Available Recontact Options include:
+
+- **Show only once**: (default) Displays the survey a single time, regardless of whether it was completed.
+- **Until they Submit a Response**: If tareting matches and trigger fires, Formbricks keeps showing the survey until the user submits a response.
+- **Keep Showing while Conditions Match**: Always shows the survey while specific conditions are met. Useful for continuous feedback collection, such as in [Docs Feedback Survey](/docs/best-practices/docs-feedback) or the [Feedback Box](/docs/best-practices/feedback-box).
+
+
+
+## Product-wide Global Waiting Time
+The Global Waiting Time is a universal blocker to make sure that no user sees too many surveys. This is particularly helpful when several teams of large organisations use Formbricks at the same time.
+
+
+ The default Global Waiting Time is set to 7 days.
+
+
+To adjust the Global Waiting Time:
+
+1. Visit Formbricks Settings
+2. Go to Product Settings
+3. Find the **Recontact Waiting Time** section
+4. Modify the interval (in days) as needed.
+
+
+
+## Overriding Global Waiting Time for a Specific Survey
+
+For specific surveys, you may need to override the default waiting time. Below is how you can do that:
+
+1. In the Survey Editor, access the Settings Tab.
+2. Find the Ignore Waiting Time between Surveys toggle under Recontact Options.
+3. Enable this toggle to bypass the global setting.
+4. Set a custom recontact period:
+ - **Always Show Survey**: Displays the survey whenever triggered, ignoring the waiting time.
+ - **Wait `X` days before showing this survey again**: Sets a specific interval before the survey can be shown again.
+
+
+
+---
+
+Still struggling or something not working as expected? [Join our Discord!](https://formbricks.com/discord) and we'd be glad to assist you!
diff --git a/apps/formbricks-com/app/docs/in-app-surveys/recontact/survey-recontact.webp b/apps/formbricks-com/app/docs/in-app-surveys/recontact/survey-recontact.webp
new file mode 100644
index 0000000000..552871ab31
Binary files /dev/null and b/apps/formbricks-com/app/docs/in-app-surveys/recontact/survey-recontact.webp differ
diff --git a/apps/formbricks-com/app/docs/integrations/airtable/page.mdx b/apps/formbricks-com/app/docs/integrations/airtable/page.mdx
index 17511acfa6..c3ac424037 100644
--- a/apps/formbricks-com/app/docs/integrations/airtable/page.mdx
+++ b/apps/formbricks-com/app/docs/integrations/airtable/page.mdx
@@ -74,7 +74,7 @@ Before the next step, make sure that you have a Formbricks Survey with at least
-6. Now click on the "Link New Table" button to link a new Airtable with Formbricks and a modal will open up.
+6. Now click on the "Link New Table" button to link an Airtable with Formbricks and a modal will open up.
-Congratulations! You have successfully linked an Airtable with Formbricks. Now whenever a response is submitted for the linked Survey, it will be automatically added to the linked Airtable.
+Congratulations! You have successfully linked an Airtable with Formbricks. Now whenever a response is submitted for the linked survey, it will be automatically added to the linked Airtable.
Still struggling or something not working as expected? [Join our Discord!](https://formbricks.com/discord) and we'd be glad to assist you!
diff --git a/apps/formbricks-com/app/docs/integrations/google-sheets/page.mdx b/apps/formbricks-com/app/docs/integrations/google-sheets/page.mdx
index 2c0d24652a..1806baebca 100644
--- a/apps/formbricks-com/app/docs/integrations/google-sheets/page.mdx
+++ b/apps/formbricks-com/app/docs/integrations/google-sheets/page.mdx
@@ -24,10 +24,10 @@ The Google Sheets integration allows you to automatically send responses to a Go
This feature is enabled by default in Formbricks Cloud but needs to be self-configured when running a
- self-hosted version of Formbricks.
+ self-hosted version of Formbricks. For self-configuration, see additional setup [below](#setup-in-self-hosted-formbricks).
-## Formbricks Cloud
+## Connect Google Sheets
1. Go to the Integrations tab in your [Formbricks Cloud dashboard](https://app.formbricks.com/) and click on the "Connect" button under Google Sheets integration.
@@ -64,7 +64,7 @@ Before the next step, make sure that you have a Formbricks Survey with at least
-5. Now click on the "Link New Sheet" button to link a new Google Sheet with Formbricks and a modal will open up.
+5. Now click on the "Link New Sheet" button to link a Google Sheet with Formbricks and a modal will open up.
-Congratulations! You have successfully linked a Google Sheet with Formbricks. Now whenever a response is submitted for the linked Survey, it will be automatically added to the linked Google Sheet.
-
-## Setup in self-hosted Formbricks
-
-Enabling the Google Sheets Integration in a self-hosted environment isn't easy and requires a setup using Google Cloud and changing the environment variables of your Formbricks instance.
-
-This process is really complicated and we recommend using Formbricks Cloud for this feature.
-
-We will first create a Google Cloud Project and then enable the Google Sheets API for it. Then we will create an OAuth Client ID and Client Secret for our Formbricks instance and set them as environment variables.
-
-1. Go to the [Google Cloud Console](https://console.cloud.google.com/) and **create a new project**.
-2. Now select the project you just created and go to the "**APIs & Services**" section.
-3. Click on the "**Enable APIs and Services**" button and search for "**Google Sheets API**" and enable it.
-4. Now go to the "**OAuth Consent screen**" section and select the **"External" User Type** if you want any Google User to be able to use the integration or select "Internal" if you want only the users of your Google Workspace to be able to use the integration.
-5. Now provide it the details such as
- - App name (Will **show up in the OAuth modal** when the user is asked to authenticate with Google)
- - User support email (ideally should be **your email** for any support queries by the Users or Google)
- - Developer contact information (ideally should be **your email** for any **support queries by Google**)
-6. Now click on the "Save and Continue" button and you will be taken to the Scopes step.
-7. Click on the "**Add or Remove Scopes**" button and add the scopes `https://www.googleapis.com/auth/userinfo.email`, `https://www.googleapis.com/auth/spreadsheets` & `https://www.googleapis.com/auth/drive` and click on the "Update" button:
-8. Now Verify the scopes and click on the "Save and Continue" button.
-9. Now go to the **"Test Users" section, skip the step**, and click the "Save and Continue" button.
-10. You will now be shown a summary of the OAuth Consent Screen. Verify the details and Click on the "**Back to Dashboard**" button.
-11. Now go to the "**Credentials**" section and click on the "**Create Credentials**" button and select "**OAuth Client ID**".
-12. Select "**Web Application**" as the Application Type and provide it a name (this name will **not be visible** to your end users).
-13. Now add your **public facing URL** in the "**Authorized JavaScript Origins**" section:
- - https://`
-14. Now add the following URL in the "**Authorized redirect URIs**" section and click on the "**Create**" button:
- - https://`/api/google-sheet/callback
-15. You will now be shown the **Client ID** and **Client Secret**. Copy them and set them as the **environment variables** in your Formbricks instance as:
- - `GOOGLE_SHEETS_CLIENT_ID` - Client ID
- - `GOOGLE_SHEETS_CLIENT_SECRET` - Client Secret
-16. Also use the **same Authorized redirect URI** in the `GOOGLE_SHEETS_REDIRECT_URL` environment variable.
-17. One last that we need to do is to **enable the Google Drive API** for the project. For that, go to the "**APIs & Services**" section and click on the "**Enable APIs and Services**" button and search for "**Google Drive API**" and enable it.
-
-### By now, your environment variables should include the below ones as well:
-
-- `GOOGLE_SHEETS_CLIENT_ID`
-- `GOOGLE_SHEETS_CLIENT_SECRET`
-- `GOOGLE_SHEETS_REDIRECT_URL`
-
-Voila! You have successfully enabled the Google Sheets integration in your self-hosted Formbricks instance. Now you can follow the steps mentioned in the [Formbricks Cloud](#formbricks-cloud) section to link a Google Sheet with Formbricks.
+Congratulations! You have successfully linked a Google Sheet with Formbricks. Now whenever a response is submitted for the linked survey, it will be automatically added to the linked Google Sheet.
## Remove Integration with Google Account
To remove the integration with Google Account,
1. Visit the Integrations tab in your Formbricks Cloud dashboard.
-2. Select "Manage Sheets" button in the Google Sheets card.
-3. Click on the "Delete Integration" button.
-4. It will now ask for a confirmation to remove the integration. Click on the "Delete" button to remove the integration. You can always come back and connect again with the same Google Account.
+2. Select **Manage Sheets** button in the Google Sheets card.
+3. Click on the **Delete Integration** button.
+4. It will now ask for a confirmation to remove the integration. Click on the **Delete** button to remove the integration. You can always come back and connect again with the same Google Account.
-## What data do you need?
+## Setup in self-hosted Formbricks
+
+Integrating Google Sheets with a self-hosted Formbricks instance requires configuring Google Cloud and updating your environment variables. This guide provides step-by-step instructions to facilitate this setup using Google Cloud Project & OAuth Setup.
+
+This process is might be complicated and we recommend using Formbricks Cloud for this feature.
+
+1. Go to the [Google Cloud Console](https://console.cloud.google.com/) and **create a new project**.
+2. Enable necessary APIs:
+ - Now select the project you just created and go to the **APIs & Services** section.
+ - Click on the **Enable APIs and Services** button and search for **Google Sheets API** & **Google Drive API** and enable it.
+3. Configure OAuth Consent Screen:
+
+ - Go to **OAuth Consent screen** and select the appropriate User Type (External or Internal). Select **Internal** if you want only the users of your Google Workspace to be able to use the integration.
+ - Fill the required details:
+ - App name: Name displayed during OAuth authentication.
+ - User support email and Developer contact information: Your contact details for support.
+ - Click on **Save and Continue**.
+
+4. Add required Scopes:
+
+- Click on the **Add or Remove Scopes** button and add the scopes:
+ - `https://www.googleapis.com/auth/userinfo.email`
+ - `https://www.googleapis.com/auth/spreadsheets`
+ - `https://www.googleapis.com/auth/drive`
+- Click on the **Update** button. Verify the scopes and click on the **Save and Continue** button.
+- Skip the **Test Users** section and click on the **Save and Continue** button.
+
+5. View the OAuth Consent Screen summary and click on the **Back to Dashboard** button.
+
+6. Register OAuth Client:
+
+- Navigate to **Credentials** > **Create Credentials** > **OAuth Client ID**.
+- Select **Web Application** and set:
+ - Name: Name of the OAuth Client ID.
+ - Authorized JavaScript Origins: `https://`
+ - Authorized redirect URIs: `https:///api/google-sheet/callback`
+- Save and note the Client ID and Client Secret.
+
+7. Copy the Client ID and Client Secret and set them as environment variables in your Formbricks instance:
+
+ - `GOOGLE_SHEETS_CLIENT_ID`
+ - `GOOGLE_SHEETS_CLIENT_SECRET`
+ - `GOOGLE_SHEETS_REDIRECT_URL`
+
+8. Enable Google Drive API:
+ - Go to the **APIs & Services** section and click on the **Enable APIs and Services** button.
+ - Search for **Google Drive API** and enable it.
+
+By now, your **environment variables** should include the below ones as well:
+
+- `GOOGLE_SHEETS_CLIENT_ID`
+- `GOOGLE_SHEETS_CLIENT_SECRET`
+- `GOOGLE_SHEETS_REDIRECT_URL`
+
+Voila! You have successfully enabled the Google Sheets integration in your self-hosted Formbricks instance. Now you can follow the steps mentioned in the [Formbricks Cloud](#formbricks-cloud) section to link a Google Sheet with Formbricks.
+
+## What info do you need?
- Your **Email ID** for authentication (We use this to identify you)
- Your **Google Sheets Names and IDs** (We fetch this to list and show you the options of choosing a sheet to integrate with)
@@ -163,8 +178,7 @@ For the above, we ask for:
1. **Google Spreadsheet API**: To write to the spreadsheet you select (that's it, nothing else, we're opensource, see this method in our codebase [here](https://github.com/formbricks/formbricks/blob/main/packages/lib/googleSheet/service.ts#L70))
- We do not store any other information of yours! We value Privacy more than you and rest assured you're safe
- with us!
+ We store as little personal information as possible.
Still struggling or something not working as expected? [Join our Discord!](https://formbricks.com/discord) and we'd be glad to assist you!
diff --git a/apps/formbricks-com/app/docs/integrations/make/page.mdx b/apps/formbricks-com/app/docs/integrations/make/page.mdx
index aa34b22228..84efb9ea6d 100644
--- a/apps/formbricks-com/app/docs/integrations/make/page.mdx
+++ b/apps/formbricks-com/app/docs/integrations/make/page.mdx
@@ -95,7 +95,7 @@ Click "Create a webhook":
className="max-w-full rounded-lg sm:max-w-3xl"
/>
-Enter the Formbricks API key. Learn how to get one from the [API Key tutorial](/docs/api/management/api-key-setup).
+Enter the Formbricks API key. Learn how to get one from the [API Key tutorial](/docs/additional-features/api#how-to-generate-an-api-key).
-Now you need an API key. Please refer to the [API Key Setup](/docs/api/management/api-key-setup) page to learn how to create one.
+Now you need an API key. Please refer to the [API Key Setup](/docs/additional-features/api#how-to-generate-an-api-key) page to learn how to create one.
Once you copied it in the API Key field, hit Save button to test the connection and save the credentials.
diff --git a/apps/formbricks-com/app/docs/integrations/notion/page.mdx b/apps/formbricks-com/app/docs/integrations/notion/page.mdx
index a085041d49..e9cb1c1be0 100644
--- a/apps/formbricks-com/app/docs/integrations/notion/page.mdx
+++ b/apps/formbricks-com/app/docs/integrations/notion/page.mdx
@@ -61,7 +61,7 @@ The notion integration allows you to automatically send responses to a Notion da
database in the Notion account you integrated.
-5. Now click on the "Link New Database" button to link a new Notion database with Formbricks and a modal will open up.
+5. Now click on the "Link New Database" button to link a Notion database with Formbricks and a modal will open up.
-Congratulations! You have successfully linked a Notion database with Formbricks. Now whenever a response is submitted for the linked Survey, it will be automatically added to the linked Notion database.
+Congratulations! You have successfully linked a Notion database with Formbricks. Now whenever a response is submitted for the linked survey, it will be automatically added to the linked Notion database.
## Setup in self-hosted Formbricks
diff --git a/apps/formbricks-com/app/docs/integrations/slack/page.mdx b/apps/formbricks-com/app/docs/integrations/slack/page.mdx
index 7b0b2a70f8..fae388e073 100644
--- a/apps/formbricks-com/app/docs/integrations/slack/page.mdx
+++ b/apps/formbricks-com/app/docs/integrations/slack/page.mdx
@@ -69,7 +69,7 @@ The slack integration allows you to automatically send responses to a Slack chan
channel in the Slack workspace you integrated.
-5. Now click on the "Link channel" button to link a new Slack channel with Formbricks and a modal will open up.
+5. Now click on the "Link channel" button to link a Slack channel with Formbricks and a modal will open up.
-Congratulations! You have successfully linked a Slack channel with Formbricks. Now whenever a response is submitted for the linked Survey, it will be automatically sent to the linked Slack channel.
+Congratulations! You have successfully linked a Slack channel with Formbricks. Now whenever a response is submitted for the linked survey, it will be automatically sent to the linked Slack channel.
## Setup in self-hosted Formbricks
diff --git a/apps/formbricks-com/app/docs/integrations/zapier/page.mdx b/apps/formbricks-com/app/docs/integrations/zapier/page.mdx
index 2fa9005de0..1d65d346d9 100644
--- a/apps/formbricks-com/app/docs/integrations/zapier/page.mdx
+++ b/apps/formbricks-com/app/docs/integrations/zapier/page.mdx
@@ -93,7 +93,7 @@ Now, you have to connect Zapier with Formbricks via an API Key:
className="max-w-full rounded-lg sm:max-w-3xl"
/>
-Now you need an API key. Please refer to the [API Key Setup](/docs/api/management/api-key-setup) page to learn how to create one.
+Now you need an API key. Please refer to the [API Key Setup](/docs/additional-features/api#how-to-generate-an-api-key) page to learn how to create one.
Once you copied it in the newly opened Zapier window, you will be connected:
diff --git a/apps/formbricks-com/app/docs/link-surveys/data-prefilling/page.mdx b/apps/formbricks-com/app/docs/link-surveys/data-prefilling/page.mdx
index 26876a4825..89ed71e221 100644
--- a/apps/formbricks-com/app/docs/link-surveys/data-prefilling/page.mdx
+++ b/apps/formbricks-com/app/docs/link-surveys/data-prefilling/page.mdx
@@ -12,15 +12,16 @@ export const metadata = {
# Data Prefilling in Link Surveys
-Data prefilling via the URL allows you to increase conversion rate by prefilling data you already have in a different system.
+Data prefilling via the URL allows you to increase completion rate by prefilling data you already have in a different system. Formbricks allows you to prefill multiple questions in a survey.
## Purpose
-URL prefilling of data comes in handy when you:
+Data prefilling via URL comes in handy when you:
- Have data for some of the respondents, but not all
+- Have data you want the respondent to confirm or update
- Have data in a different system (e.g. your database) and want to add it to the user profile in Formbricks
-- Want to embed the first question in an email and increase conversion by prefilling the choice
+- Want to embed a survey in an email and increase completion by prefilling the choice selected in the email
## Quick Example
@@ -28,24 +29,24 @@ URL prefilling of data comes in handy when you:
```sh
-https://app.formbricks.com/s/clin3dxja02k8l80hpwmx4bjy?question_id=5
+https://app.formbricks.com/s/clin3dxja02k8l80hpwmx4bjy?question_id_1=answer_1&question_id_2=answer_2
```
## How it works
-To prefill the first question of a survey, append `?question_id=answer` at the end of the survey URL. The answer has to match the expected type of the question. For example, if the first question is a rating question, the answer has to be a number. If the first question is a single select question, the answer has to be a string.
+To prefill the questions of a survey, add query parameters to the survey URL. The query parameter should be in the format `questionId=answer`. The answer has to match the expected type of the question to pass through the [validation](/docs/link-surveys/data-prefilling#validation). For example, if the first question is a rating question, the answer has to be a number. If the first question is a single select question, the answer has to be a string identical to one of the answer options.
-Please make sure the answer is [URL encoded](https://www.urlencoder.org/).
+Please make sure the answer is [URL encoded](https://www.urlencoder.org/).
-
- ## Prefill only the first question Currently, you can only prefill the first question of a link survey.
-
+## Prefilling multiple values
+
+Formbricks let's you prefill as many values as you want. You can combine multiple values in the URL using `&` so for example `name=Bernadette&age=18`. The order of the query parameters does not matter so you can always move around questions or add new ones without having to worry about the order of the query parameters.
## Where do I find my question Id?
-You find the `questionId` in the Advanced Settings at the bottom of each question card in the Survey Editor. As you see, you can update the `questionId` to any string you like. However, once you published your survey, this `questionId` cannot be updated anymore:
+You find the `questionId` in the **Advanced Settings** toggle at the bottom of each question card in the Survey Editor. As you see, you can update the `questionId` to any string you like. However, once you published your survey, this `questionId` cannot be updated anymore:
-
+
```sh
https://app.formbricks.com/s/clin3yxja52k8l80hpwmx4bjy?rating_question_id=5
@@ -69,9 +72,13 @@ https://app.formbricks.com/s/clin3yxja52k8l80hpwmx4bjy?rating_question_id=5
+
### NPS Question
+
+Translates to an NPS rating of 10:
+
-
+
```sh
https://app.formbricks.com/s/clin3yxja52k8l80hpwmx4bjy?nps_question_id=10
@@ -79,9 +86,13 @@ https://app.formbricks.com/s/clin3yxja52k8l80hpwmx4bjy?nps_question_id=10
+
### Single Select Question (Radio)
+
+Chooses the option 'Very disappointed' in the single select question. The string has to be identical to the option in your question:
+
-
+
```sh
https://app.formbricks.com/s/clin3yxja52k8l80hpwmx4bjy?single_select_question_id=Very%20disappointed
@@ -89,9 +100,13 @@ https://app.formbricks.com/s/clin3yxja52k8l80hpwmx4bjy?single_select_question_id
+
### Multi Select Question (Checkbox)
+
+Selects three options 'Sun, Palms and Beach' in the multi select question. The strings have to be identical to the options in your question:
+
-
+
```sh
https://app.formbricks.com/s/clin3yxja52k8l80hpwmx4bjy?multi_select_question_id=Sun%2CPalms%2CBeach
@@ -99,9 +114,13 @@ https://app.formbricks.com/s/clin3yxja52k8l80hpwmx4bjy?multi_select_question_id=
+
### Open Text Question
+
+Adds 'I love Formbricks' as the answer to the open text question:
+
-
+
```sh
https://app.formbricks.com/s/clin3yxja52k8l80hpwmx4bjy?openText_question_id=I%20love%20Formbricks
@@ -109,9 +128,13 @@ https://app.formbricks.com/s/clin3yxja52k8l80hpwmx4bjy?openText_question_id=I%20
+
### CTA Question
+
+Adds 'clicked' as the answer to the CTA question. Alternatively, you can set it to 'dismissed' to skip the question:
+
-
+
```txt
https://app.formbricks.com/s/clin3yxja52k8l80hpwmx4bjy?cta_question_id=clicked
@@ -119,15 +142,50 @@ https://app.formbricks.com/s/clin3yxja52k8l80hpwmx4bjy?cta_question_id=clicked
+
+### Consent Question
+
+Adds 'accepted' as the answer to the Consent question. Alternatively, you can set it to 'dismissed' to skip the question.
+
+
+
+
+```txt
+https://app.formbricks.com/s/clin3yxja52k8l80hpwmx4bjy?consent_question_id=accepted
+```
+
+
+
+
+### Picture Selection Question
+
+Adds index of the selected image(s) as the answer to the Picture Selection question. The index starts from 1
+
+
+
+
+```txt
+https://app.formbricks.com/s/clin3yxja52k8l80hpwmx4bjy?pictureSelection_question_id=1%2C2%2C3
+```
+
+
+
+
+All other question types, you currently cannot prefill via the URL.
+
+
## Validation
-Make sure that the answer in the URL matches the expected type for the first question.
+Make sure that the answer in the URL matches the expected type for the questions.
The URL validation works as follows:
- For Rating or NPS questions, the response is parsed as a number and verified if it's accepted by the schema.
- For CTA type questions, the valid values are "clicked" (main CTA) and "dismissed" (skip CTA).
- For Consent type questions, the valid values are "accepted" (consent given) and "dismissed" (consent not given).
+- For Picture Selection type questions, the response is parsed as an array of numbers and verified if it's accepted by the schema.
- All other question types are strings.
-### You’re good to go! 🎉
+
+ If an answer is invalid, the prefilling will be ignored and the question is presented as if not prefilled.
+
diff --git a/apps/formbricks-com/app/docs/link-surveys/embed-in-email/email-content-with-survey.webp b/apps/formbricks-com/app/docs/link-surveys/embed-in-email/email-content-with-survey.webp
new file mode 100644
index 0000000000..6782b534ee
Binary files /dev/null and b/apps/formbricks-com/app/docs/link-surveys/embed-in-email/email-content-with-survey.webp differ
diff --git a/apps/formbricks-com/app/docs/link-surveys/embed-in-email/email-content-without-survey.webp b/apps/formbricks-com/app/docs/link-surveys/embed-in-email/email-content-without-survey.webp
new file mode 100644
index 0000000000..d35f1683dd
Binary files /dev/null and b/apps/formbricks-com/app/docs/link-surveys/embed-in-email/email-content-without-survey.webp differ
diff --git a/apps/formbricks-com/app/docs/link-surveys/embed-in-email/jo-signature.webp b/apps/formbricks-com/app/docs/link-surveys/embed-in-email/jo-signature.webp
new file mode 100644
index 0000000000..859260e6d1
Binary files /dev/null and b/apps/formbricks-com/app/docs/link-surveys/embed-in-email/jo-signature.webp differ
diff --git a/apps/formbricks-com/app/docs/link-surveys/embed-in-email/page.mdx b/apps/formbricks-com/app/docs/link-surveys/embed-in-email/page.mdx
new file mode 100644
index 0000000000..eea532e387
--- /dev/null
+++ b/apps/formbricks-com/app/docs/link-surveys/embed-in-email/page.mdx
@@ -0,0 +1,146 @@
+import { TellaVideo } from "@/components/docs/TellaVideo";
+import { MdxImage } from "@/components/shared/MdxImage";
+
+import EmailContentWithSurvey from "./email-content-with-survey.webp";
+import EmailContentWithoutSurvey from "./email-content-without-survey.webp";
+import JoSignature from "./jo-signature.webp";
+import PluginAddSurvey from "./plugin-add-survey.webp";
+import PluginSourceTab from "./plugin-source-tab.webp";
+
+export const metadata = {
+ title: "Embed Surveys in Your Emails",
+ description: "Embed Formbricks surveys seamlessly into your emails to collect feedback from your users.",
+};
+
+#### Link Surveys
+
+# Embed Surveys in Your Email
+
+Embedding Formbricks surveys directly into your emails allows you to collect valuable feedback from your users at every touchpoint. Seamlessly integrate interactive surveys into your email campaigns to gather insights and improve user experience.
+
+## Generate an Embed Code
+
+To embed a Formbricks survey in an email, first, create a survey and publish it. Follow these steps to generate the embed code:
+
+1. **Create and Publish a Survey**: Start by creating a link survey and publish it once ready.
+2. **Access the Share Options**: Go to the survey summary page and click the Share button (see below).
+3. **Get the Embed Code**: Click on Embed Survey at the bottom of the share modal, navigate to the `Embed in an Email` tab, and click `Copy Code`.
+4. **Preview and Test**: Before sending it to your users, click on Send Preview to receive a test email. This helps ensure the survey appears correctly.
+
+
+
+## Embedding the Survey in Emails
+
+Different email clients have different support for HTML and CSS. We recommend testing the email in different email clients to ensure the survey looks good in all of them.
+
+Below are some of the methods and services that we know that allows HTML embedding and how you can use them:
+
+
+ Please use the below methods at your own discretion. We do not officially endorse any of the services
+ mentioned below.
+
+
+### 1. Gmail
+
+Gmail does not support HTML embedding natively. It's a WYSIWYG (What You See Is What You Get) editor. However, you can use a free plugin like [HTML Editor for Gmail by cloudHQ](https://chromewebstore.google.com/detail/free-html-editor-for-gmai/ioinaaeeacahcmbgfmeaaofhfkijpdeb) to embed HTML in your emails.
+
+ - Install the plugin from the Chrome Web Store.
+ - Open Gmail and compose a new email.
+ - Write your email content after which you want to embed the survey.
+
+
+
+ - Right next to the Send button you will see a new button called **HTML Editor**. Click on it.
+ - This will open a new window with the **Design** tab active. Switch to the **Source** tab.
+
+
+
+ - Now paste the copied HTML code from Formbricks into this window. On the right, you will see a preview of how the email will look.
+
+
+
+ - Click on the **Close Editor** button to save the changes & close the editor.
+
+
+
+ - Voila! You have successfully embedded the survey in your email.
+
+### 2. Sendgrid
+
+Sendgrid supports HTML content in emails directly:
+
+ - Compose Your Email: Use Sendgrid's email composition tools to embed the HTML directly into your email body.
+ - Reference: For detailed steps, refer to Sendgrid's official documentation [here](https://sendgrid.com/en-us/solutions/email-marketing/email-design) or API docs [here](https://sendgrid.com/docs/for-developers/sending-email/api-getting-started/)
+
+### 3. Mailchimp
+
+Available in their Standard plan and above, Mailchimp allows HTML content embedding:
+
+ - Use the Code Block: Drag a code block into your email template and paste the HTML code for the survey.
+ - Reference: Check out Mailchimp's guide on pasting in custom HTML [here](https://mailchimp.com/help/paste-in-html-to-create-an-email/)
+
+### 4. Notemailer
+
+Nodemailer is a Node.js module that allows you to send emails with HTML content.
+
+ - If you use Node.js to send emails, just attach the `html` parameter in your email message.
+ - Reference: Take a look at Nodemailer's official message documentation [here](https://nodemailer.com/message/)
+
+
+ Please note that the above methods are not exhaustive and there are many other ways to embed HTML in emails.
+
+
+## Example: Email Footer Survey
+
+Embed a survey link in your email signature to collect feedback subtly yet effectively. Here’s how:
+
+
+
+1. Create a Survey: Adjust an existing survey or create a new one.
+2. Scroll down & enable the **Hidden Fields** option.
+3. Add a new hidden field with the name **helpful**.
+4. Now Publish the survey as a Link Survey & copy the link.
+5. Embed in Your Signature: Add this HTML snippet to your email signature in your email client settings.
+
+
+
+
+```html
+Was our conversation helpful? Yes 👍 | No 👎
+```
+
+
+
+
+Replace `YOUR_SURVEY_LINK` with the actual survey link.
+
+PS: If you do not see any signature settings, just use one of the methods we've mentioned above to embed the HTML code in your email.
+
+---
+
+**Can’t figure it out?** [Join our Discord!](https://formbricks.com/discord)
diff --git a/apps/formbricks-com/app/docs/link-surveys/embed-in-email/plugin-add-survey.webp b/apps/formbricks-com/app/docs/link-surveys/embed-in-email/plugin-add-survey.webp
new file mode 100644
index 0000000000..92d474a09c
Binary files /dev/null and b/apps/formbricks-com/app/docs/link-surveys/embed-in-email/plugin-add-survey.webp differ
diff --git a/apps/formbricks-com/app/docs/link-surveys/embed-in-email/plugin-source-tab.webp b/apps/formbricks-com/app/docs/link-surveys/embed-in-email/plugin-source-tab.webp
new file mode 100644
index 0000000000..6b765123e6
Binary files /dev/null and b/apps/formbricks-com/app/docs/link-surveys/embed-in-email/plugin-source-tab.webp differ
diff --git a/apps/formbricks-com/app/docs/link-surveys/embed-surveys/page.mdx b/apps/formbricks-com/app/docs/link-surveys/embed-surveys/page.mdx
new file mode 100644
index 0000000000..5ffff7c22e
--- /dev/null
+++ b/apps/formbricks-com/app/docs/link-surveys/embed-surveys/page.mdx
@@ -0,0 +1,81 @@
+import { TellaVideo } from "@/components/docs/TellaVideo";
+
+export const metadata = {
+ title: "Embed Surveys in Your Web Page",
+ description: "Embed Formbricks surveys seamlessly into your website or web application using an iframe.",
+};
+
+#### Embed Surveys
+
+# Embed Surveys in Your Web Page
+
+Embedding Formbricks surveys directly into your web pages allows you to integrate interactive surveys without redirecting users to a separate survey site. This method ensures a seamless integration and maintains the aesthetic continuity of your website or application.
+
+## How to Use it?
+
+
+
+1. Create and publish a link survey.
+
+2. Open survey summary page and click on **share** button on the top right.
+
+3. In the survey share modal, click on **Embed survey** button.
+
+4. Navigate to **Embed in a Web Page** tab and click on Copy code
+
+5. Paste the copied iframe code into the HTML of your web page where you want the survey to appear.
+
+### Example of Embedding a Survey
+
+
+
+
+```html
+
+
+
+```
+
+
+
+
+## Iframe Events
+
+The iframe fires a **formbricksSurveyCompleted** event when a user finishes a survey within the embedded iframe. This event can be captured through a message listener in your webpage's JavaScript
+
+### How to Use it?
+
+1. Embed the Formbricks survey on your webpage using the iframe method as described above.
+
+2. Add an event listener to your webpage’s JavaScript that listens for `message` events from the iframe.
+
+3. Check if the received message indicates that the survey is completed by comparing the `event.data` with the value `formbricksSurveyCompleted`.
+
+
+ It is important to verify the origin of the message to ensure it comes from the iframe containing your
+ survey, enhancing the security of your event handling.
+
+
+4. Implement your custom actions within the callback function based on the survey completion.
+
+### Example of Handling Survey Completion Events
+
+
+
+
+```javascript
+window.addEventListener("message", (event) => {
+ // Replace 'https://app.formbricks.com' with the actual web app url
+ if (event.origin === "https://app.formbricks.com" && event.data === "formbricksSurveyCompleted") {
+ console.log("Survey completed!");
+ // Implement your custom actions here
+ }
+});
+```
+
+
+
diff --git a/apps/formbricks-com/app/docs/self-hosting/enterprise/page.mdx b/apps/formbricks-com/app/docs/self-hosting/enterprise/page.mdx
index c4da1964d7..64c3dae5a5 100644
--- a/apps/formbricks-com/app/docs/self-hosting/enterprise/page.mdx
+++ b/apps/formbricks-com/app/docs/self-hosting/enterprise/page.mdx
@@ -26,8 +26,6 @@ Additional to the AGPL licensed Formbricks core, the Formbricks repository conta
| Multi-language surveys | ❌ | ✅ |
| Advanced targeting / Segments | ❌ | ✅ |
| Make code changes and keep private | ❌ | ✅ |
-| Whitelabel Formbricks | ❌ | ✅ |
-| Sell Formbricks as SaaS to others | ❌ | ✅ |
**Please note:** Sooner than later we will introduce a enterprise license pricing. For a free beta key, fill out this form:
diff --git a/apps/formbricks-com/app/docs/self-hosting/external-auth-providers/page.mdx b/apps/formbricks-com/app/docs/self-hosting/external-auth-providers/page.mdx
index 28f6b1f29c..4f0bc8518d 100644
--- a/apps/formbricks-com/app/docs/self-hosting/external-auth-providers/page.mdx
+++ b/apps/formbricks-com/app/docs/self-hosting/external-auth-providers/page.mdx
@@ -147,7 +147,7 @@ These variables can be provided at the runtime i.e. in your docker-compose file.
| S3_ACCESS_KEY | Access key for S3. | optional | (resolved by the AWS SDK) |
| S3_SECRET_KEY | Secret key for S3. | optional | (resolved by the AWS SDK) |
| S3_REGION | Region for S3. | optional | (resolved by the AWS SDK) |
-| S3_BUCKET_NAME | Bucket name for S3. | optional (required if S3 is enabled) | |
+| S3_BUCKET_NAME | S3 bucket name for data storage. Formbricks enables S3 storage when this is set. | optional (required if S3 is enabled) | |
| S3_ENDPOINT | Endpoint for S3. | optional | (resolved by the AWS SDK) |
| PRIVACY_URL | URL for privacy policy. | optional | |
| TERMS_URL | URL for terms of service. | optional | |
diff --git a/apps/formbricks-com/components/docs/Navigation.tsx b/apps/formbricks-com/components/docs/Navigation.tsx
index fd06cdcb5c..4bed3918b2 100644
--- a/apps/formbricks-com/components/docs/Navigation.tsx
+++ b/apps/formbricks-com/components/docs/Navigation.tsx
@@ -192,12 +192,14 @@ export const navigation: Array = [
title: "In-App Surveys",
links: [
{ title: "Quickstart", href: "/docs/getting-started/quickstart-in-app-survey" },
+ { title: "Developer Quickstart", href: "/docs/in-app-surveys/developer-quickstart" },
{ title: "Framework Guides", href: "/docs/getting-started/framework-guides" },
{ title: "Troubleshooting", href: "/docs/getting-started/troubleshooting" },
{ title: "Identify Users", href: "/docs/in-app-surveys/user-identification" },
{ title: "Actions", href: "/docs/in-app-surveys/actions" },
{ title: "Attributes", href: "/docs/in-app-surveys/attributes" },
{ title: "Advanced Targeting", href: "/docs/in-app-surveys/advanced-targeting" },
+ { title: "Recontact Options", href: "/docs/in-app-surveys/recontact" },
],
},
{
@@ -210,11 +212,17 @@ export const navigation: Array = [
{ title: "Source Tracking", href: "/docs/link-surveys/source-tracking" },
{ title: "Hidden Fields", href: "/docs/link-surveys/hidden-fields" },
{ title: "Start At Question", href: "/docs/link-surveys/start-at-question" },
+ { title: "Embed Surveys in Website", href: "/docs/link-surveys/embed-surveys" },
+ { title: "Embed Surveys in Email", href: "/docs/link-surveys/embed-in-email" },
],
},
{
title: "Additional Features",
- links: [{ title: "Multi Language Surveys", href: "/docs/additional-features/multi-language-surveys" }],
+ links: [
+ { title: "API", href: "/docs/additional-features/api" },
+ { title: "Multi-Language Surveys", href: "/docs/additional-features/multi-language-surveys" },
+ { title: "Metadata", href: "/docs/additional-features/metadata" },
+ ],
},
{
title: "Best Practices",
@@ -266,29 +274,6 @@ export const navigation: Array = [
{ title: "FAQ", href: "/docs/faq" },
],
},
- {
- title: "Client API",
- links: [
- { title: "Overview", href: "/docs/api/client/overview" },
- { title: "Actions", href: "/docs/api/client/actions" },
- { title: "Displays", href: "/docs/api/client/displays" },
- { title: "People", href: "/docs/api/client/people" },
- { title: "Responses", href: "/docs/api/client/responses" },
- ],
- },
- {
- title: "Management API",
- links: [
- { title: "API Key Setup", href: "/docs/api/management/api-key-setup" },
- { title: "Action Classes", href: "/docs/api/management/action-classes" },
- { title: "Attribute Classes", href: "/docs/api/management/attribute-classes" },
- { title: "Me", href: "/docs/api/management/me" },
- { title: "People", href: "/docs/api/management/people" },
- { title: "Responses", href: "/docs/api/management/responses" },
- { title: "Surveys", href: "/docs/api/management/surveys" },
- { title: "Webhooks", href: "/docs/api/management/webhooks" },
- ],
- },
];
export function Navigation(props: React.ComponentPropsWithoutRef<"nav">) {
diff --git a/apps/formbricks-com/components/docs/TellaVideo.tsx b/apps/formbricks-com/components/docs/TellaVideo.tsx
new file mode 100644
index 0000000000..21d2b8c9ea
--- /dev/null
+++ b/apps/formbricks-com/components/docs/TellaVideo.tsx
@@ -0,0 +1,18 @@
+import React from "react";
+
+export function TellaVideo({ tellaVideoIdentifier }: { tellaVideoIdentifier: string }) {
+ return (
+