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, create a survey using the template Docs Feedback:

- Change the Internal Question ID of the first question to βisHelpfulβ to make your life easier π

- Similarly, you can change the Internal Question ID of the Please elaborate question to βadditionalFeedbackβ and the one of the Page URL question to βpageUrlβ.
The answers must be identical. If you want different options than βYes πβ and βNo πβ, you need to update the choices accordingly. They must match the frontend weβre building in the next step.
- Click on βContinue to Settings or select the audience tab manually. Scroll down to βSurvey Triggerβ and create a new Action:

- Our goal is to create an event that never triggers. This might seem odd, but itβs a necessary workaround. Fill out the action as shown in the screenshot:

- Select the Non-Event in the dropdown. Now you see that the βPublish surveyβ button is active. Publish your survey π€

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:- Workspace ID (1) of the workspace on app.formbricks.com
- Survey ID (2) of your test survey

handleFeedbackSubmit:
Replace the ID and API accordingly
updateFeedback function
Replace the ID and API here as well