Purpose
Your users donβt spend as much time thinking about your product as you do. To fight the βCurse of Knowledgeβ you have to measure how clear your docs are.Installation
To get this running, youβll need a bit of time. Here are the steps weβre going through:- Set up Formbricks Cloud
- Build the frontend
- Connect to API
- Test
1. Setting up Formbricks Cloud
Create a Formbricks Cloud account, then a survey from the Docs Feedback template β New Survey β Choose a template, then search for it.Make it a link survey
Open Settings β Survey Type and make sure Link survey is selected. A new survey inherits its type from the workspace channel chosen during onboarding, so a workspace set up for a website or app creates app surveys by default β check it rather than assuming it. This matters more than it looks. You are going to post responses to the client API from your own frontend, so nothing here uses the Formbricks widget. An app survey cannot be published without a trigger βsurvey-menu-bar.tsx refuses to save one with no triggers β which is why older versions of this guide told you to invent an action that never fires. A link survey has no such requirement, so the workaround is unnecessary.
Set the question IDs
The frontend below refers to questions by ID, so give them names you will recognise. Open a question, click Show Question settings at the foot of its card, and set the Question ID:The answers must match the frontend too. If you replace βYes πβ and βNo πβ with your own wording, change the choices in the code below to match β they are compared as strings.
2. Build the frontend
Your frontend might work differently Your frontend likely looks and works
differently. This is an example specific to our tech stack. We want to
illustrate what you should consider building yours.
- Once the user selects yes/no, a partial response is sent to the Formbricks API. It includes the feedback and the current page url.
- Then the user is presented with an additional open text field to further explain their choice. Once itβs submitted, the previous response is updated with the additional feedback.
- Open the code editor where you handle your docs page.
- Likely, you have a template file or similar which renders the navigation at the bottom of the page:

- Write the frontend code for the widget. Here is the full component (we break it down right below):
Entire Widget
State Management
Disable feedback if incorrect config env vars
Actual Frontend
3. Connecting to the Formbricks API
The last step is to hook up your new frontend to the Formbricks API. To achieve that, we followed the βCreate Responseβ and βUpdate Responseβ pages in our docs. Here is the code for thehandleFeedbackSubmit function with comments:
handleFeedbackSubmit() function definition
updateFeedback function with comments:
updateFeedback() function definition
4. Setting it up for testing
Before you roll it out in production, you want to test it. To do so, you need two things:- the workspace ID
- the survey ID of your test survey
handleFeedbackSubmit:
Replace the ID and API accordingly
updateFeedback function
Replace the ID and API here as well