* fix: build error due to survey status becoming optional
* made refactors
* fix: use universal ID over newly created ID
* remove build step from github actions workflows
---------
Co-authored-by: Dhruwang <dhruwangjariwala18@gmail.com>
Co-authored-by: Matti Nannt <mail@matthiasnannt.com>
* feat: adds api handlers for upload and get file from S3
* feat: upload and fetch files from local storage
* feat: upload and fetch files from local storage
* feat: adds restriction check for allowed file extesnsions
* refactor
* fix: uses t3 env for validation
* fix: fixes validation issues in storage api
* merge with main
* fix: moves UPLOADS_DIR to constants file
* fix: moves private uploads to responseId
* chore: merge with main
* fix: changes api route
* remove comment in storage service, use services in client storage route
* simplify client storage endpoint
* rename fileType to contentType
* relocate storage endpoints, update validation
* update management storage route for readability
---------
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
* fix: docker env parsing & response bug when built w docker
* chore: bring back env example
* fix: docker compose envs are now single place defined
* add: renaming of .env in docs
* remove: existence of prisma_generate_data_proxy
* fix: use newer env vars and a smarter way to handle existing .env file
* fix: remove text to remove existing .enb
* fix: remove comments, local testing, and mention of more updating via echo in prod script
* fix: env ending
* fix: finalllyyy the docker compose works
* wip
* fix: update self host docker compose
* fix: echo log rename
* fix: docker env parsing & response bug when built w docker
* chore: bring back env example
* fix: docker compose envs are now single place defined
* add: renaming of .env in docs
* remove: existence of prisma_generate_data_proxy
* fix: use newer env vars and a smarter way to handle existing .env file
* fix: remove text to remove existing .enb
* fix: remove comments, local testing, and mention of more updating via echo in prod script
* fix: env ending
* fix: finalllyyy the docker compose works
* feat: short survey url support in docker compose
* fix: add envs to prod script
* chore: reorder env vars for uniformity
* update description for SHORT_SURVEY_BASE_URL
* fix: add ASSET_PREFIX_URL to prod script & docker compose
---------
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
* WIP
* added prisma actions
* remove console.logs
* some more fixes
* tweaks
* addressed all PR review comments
* remove hits from the prisma schema and all its corresponding service logic
* add nanoid
* corrected placeholders
* change database model, bring shortUrl service up to Formbricks code conventions
* update UI and shortUrl endpoint to work with new service
---------
Co-authored-by: Dhruwang <dhruwangjariwala18@gmail.com>
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
* feat: docs for management API
* fix: split api into client and management
* update navigation and pages
---------
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
* poc: use server session and api key validation on deletion
* feat: use server session and api key validation on deletion and creation
* feat: packages/lib/apiKey for apiKey services and auth
* shubham/auth-for-api-key
* fix: caching
* feat: handle authorization for action creation, update, delete
* feat: handle authorization for survey creation, updation & deletion
* feat: use cached method across and wrapper for authzn check
* fix: use cached wrapper & introduce more authzn check for survey services in actions
* fix: club caching methods and use authzn errors
* feat: add caching in canUserAccessApiKey
* feat: add caching in canUserAccessAction and use Authzn error
* fix: rename action to actionClass wherever needed
* feat: use caching in core method and update hasEnvAccess call
* fix: use authzn specific error
* fix: use cache getActionClass
* fix: make changes
* fix: import
* fix: import and suggested changes
* fix: rename action and use cache tag
* feat: use services to create team
* fix: atomic services for product & team creation
* improve teamUpdateInput
* use services in signup process
* redirect to prod environment when new product is created
* fix signup bug
---------
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
* add uniqueResponseId to link survey
* add uniqueResponseId to survey response
* add singUseId to database and link survey
* add singleUseId to api
* add single use option in survey response options
* add single use to getSurvey
* add getResponseBySingleUseId
* add ZSurveySingleUse schema to survey schema
* add logic to check if link with suid has response
* pass singleUseId as props, revert SWR changes
* generation of single-use url in LinkSurveyModal
* add singleUseId to SingleResponseCard
* update SurveyInactive for invalid link
* add suId to ZResponse schema
* fix typo in SurveyInactive
* update ResponseOptionCard
* add suId to response select
* add default message for SurveyLinkUsed
* update logic to render SurveyLinkUsed
* add comment for suId in prisma schema
* fix types
* refresh server component on save survey
* update logic
* fix build errors
* fix prisma schema
* add db migration
* update wording
* add singleUseId to localstorage
* fix survey link used over thank you
* add suid to people responses
* fix preview and copy link on surveys page.
* update text and icon for link survey modal
* check survey not finished before setting question
* update show surveylink used logic
* add zodtype to prisma
* fix logic to render last question answered/stored
* add better comments
* update default message for single use surveys
* add LinkSingleUseSurveyModal
* add guard before getting response with suid
* fix build error
* add default message for link used page
* add key and group imports
* add suId encryption and validation
* make survey url encryption optional
* fix build errors
* move singleUseId to server side in surveyList
* added validation to getResponseBySingleUseId service
* restored env var names
* import FORMBRICKS_ENCRYPTION_KEY from constants
* check if encryption environment variable is set, add length validation for env variable
---------
Co-authored-by: Ty Kerr <tykerr@Tys-MacBook-Pro.local>
Co-authored-by: Johannes <johannes@formbricks.com>
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
Co-authored-by: Dhruwang <dhruwangjariwala18@gmail.com>
* feat: connection states on integrations
* fix: missing action buttons
* make text more readable
---------
Co-authored-by: Johannes <johannes@formbricks.com>
* poc: use server session and api key validation on deletion
* feat: use server session and api key validation on deletion and creation
* feat: packages/lib/apiKey for apiKey services and auth
* shubham/auth-for-api-key
* fix: caching
* feat: handle authorization for tag creation, updation & deletion
* fix: use cached wrapper
* fix: club caching methods and use authzn errors
* feat: add caching in canUserAccessApiKey
* fix: suggrsted changes and authzn for response as well
* fix: work on suggested changes
* fix broken lock file
---------
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
* poc: use server session and api key validation on deletion
* feat: use server session and api key validation on deletion and creation
* feat: packages/lib/apiKey for apiKey services and auth
* shubham/auth-for-api-key
* fix: caching
* feat: handle authorization for action creation, update, delete
* feat: use cached method across and wrapper for authzn check
* fix: club caching methods and use authzn errors
* feat: add caching in canUserAccessApiKey
* feat: add caching in canUserAccessAction and use Authzn error
* fix: rename action to actionClass wherever needed
* fix: use cache getActionClass
* fix: make changes
* fix: import
---------
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
* poc: use server session and api key validation on deletion
* feat: use server session and api key validation on deletion and creation
* feat: packages/lib/apiKey for apiKey services and auth
* shubham/auth-for-api-key
* fix: caching
* fix: club caching methods and use authzn errors
* feat: add caching in canUserAccessApiKey
* init: rewritten formbricks api package
* restrucure: client prepended formbricks api package
* feat: cleanup error templating and node-fetch for non browser access
* feat: replace package (build error for js packge due to api)
* fix: rename methods & move error type
* fix: imports of api via js
* remove node-fetch
---------
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
* feat: privacy, imprint, and terms URL env vars now do not need rebuilding
* feat: disable_singup env var now do not need rebuilding
* feat: password_reset_disabled env var now do not need rebuilding
* feat: email_verification_disabled env var now do not need rebuilding
* feat: github_oauth & google_oauth env var now do not need rebuilding
* feat: move logic of env vars to serverside and send boolean client-side
* feat: invite_disabled env var now do not need rebuilding
* feat: rename vars logically
* feat: migration guide
* feat: update docker-compose as per v1.1
* deprecate: unused NEXT_PUBLIC_VERCEL_URL & VERCEL_URL
* deprecate: unused RAILWAY_STATIC_URL
* deprecate: unused RENDER_EXTERNAL_URL
* deprecate: unused HEROKU_APP_NAME
* fix: define WEBAPP_URL & replace NEXT_WEBAPP_URL with it
* migrate: NEXT_PUBLIC_IS_FORMBRICKS_CLOUD to IS_FORMBRICKS_CLOUD
* chore: move all env parsing to a constants.ts from page files
* feat: migrate client side envs to server side
* redo: isFormbricksCloud to navbar serverside page
* fix: constants is now a server only file
* fix: removal of use swr underway
* fix: move 1 tag away from swr to service
* feat: move away from tags swr
* feat: move away from surveys swr
* feat: move away from eventClass swr
* feat: move away from event swr
* fix: make constants server-only
* remove comments from .env.example, use constants in MetaInformation
* clean up services
* rename tag function
* fix build error
* fix smaller bugs, fix Response % not working in summary
---------
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
* feat: paginante people page
* undo: delete env example
* fix: rename vars and return empty arr over err
* fix: invalid page logic
* fix: handle bigger cases
* increase PEOPLE_PER_PAGE to 50
* fix: show no people when added invalid page no
* feat: add caching in people fetch services
* Revert "feat: add caching in people fetch services"
This reverts commit ab1e98c05e.
* fix build errors
---------
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
* chore: update npm packages
* update formbricks-web packages
* update packages in demo
* update packages in formbricks-com
* fix survey status dropdown has no value
* docs: add local and gitpod set
This links to our docs on formbricks.com for local setup and adds a gitpod setup banner
* feat: open mailhog after gitpod setup complete
* remove development doc
* added intro and surveySelect page
* added home page and wrapper component
* added spreadsheet select
* added data write functionality and added integration schema model
* improved UX
* reworked UI
* added google sheet integration
* removed some unused code
* added user email
* UI tweaks
* fixed build issues and made added question to top of spreadsheets
* adds refreshSheets and added empty survey/spreadsheets text
* restored pnpm-lock
* added duplicate sheet warning
* move process.env to t3env
* move migration
* update docs link, add note to show that sheets integration is not configured
* Add simple docs page for google-sheets
* added session check
* restored pnpm-lock
* Merge branch 'main' of github.com:formbricks/formbricks into Integration/Google-sheet
* added google sheet env variables to runtimeEnv
---------
Co-authored-by: Johannes <johannes@formbricks.com>
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
* feat: moves edit team name to server components
* feat: server components for membership roles
* feat: adds server actions and services
* fix: fixes invite server action
* feat: adds packages for jwt and email
* feat: server actions
* feat: moves edit memberships logic to server components
* feat: moves delete team logic to server components
* fix: fixes team loading states
* rename getAllMembershipsByUserId -> getMembershipsByUserId
* remove cache from mutating functions
* remove cache from updateInvite
* refactoring
* fix build error
---------
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
* fix: sync call gets called by other functions
* fix: sync call gets called by other functions
* remove unused imports
* remove unused import
* fix userId update
* added data fetching to server side and also added some actions
* made refactors
* replaced router.push with redirect
* updated profileUpdateInput
* move components in components folder
* update import for product update action
---------
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
* feat: webhooks now have a source to diff between user and third party
* fix: capitalise first letter of source and increase vertical padding in row
* fix: update webhhok source type in prisma and cleanup services
* combine two migrations into one
* add actions file for webhook UI
---------
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
* created a new service for survey data mutation
* made requested changes
* made some refactors
* ran pnpm format
* removed console logs
* removed some unused code
* made upateSurvey return TSurvey and added laoding state to AddNoCodeActionModal
* fixed minor bugs
* ran pnpm format
* fixed build issues
* Replaced old question types with new types
* fix survey list not up to date on changes
* solved back button issue
---------
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
* added documentation for make.com integration
* ran pnpm format
* update wording in docs
* updated docs for make integration
* updated connect link
---------
Co-authored-by: Johannes <johannes@formbricks.com>
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
* moved environment navbar to RSC
* added Error component
* format
* update errors path
* use standard services in environment navbar, update product service according to standards, add redirect shortcuts for teams and products
* update analysis github workflow with environment variables
* fix WEBAPP_URL is required
---------
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
* add vite survey package
* add renderSurvey method
* add all survey components
* First working version of renderSurvey
* integrate survey package into survey preview
* add survey modal functionality to formbricks-surveys
* fix build errors and add new template types
* add response queue
* add simple formbricks-js integration
* add local state management for surveys
* add local storage to multiple choice and open text questions
* add local state to other question types, layout fixes
* Fix modal close button, clean js package code
* add new calculate progress function
* fix progressbar on thankyou card
* fix churn survey branching in demo product
* use tsup to bundle @formbricks/js
* update survey positioning in link surveys
* fix preview reset button in link survey
* change logic for progress bar
* update progressbar logic
* update spacing
* add conditional autofocus / disable for iframe
* add userId to link survey
* integrated email verification
* moved token verification and reading to server component
* ran pnpm format
* added question prefilling
* ran pnpm format
* Moved question prefilling logic to Link Survey
* Refactor types
* centralize survey package props, fix build errors
* fix userId in link survey
* fix survey closed message
* add redirect on complete, fix bugs
* smaller bugfixes
* smaller bugfixes
* fix bugs
* fix build errors
* remove logs
---------
Co-authored-by: Johannes <johannes@formbricks.com>
Co-authored-by: Dhruwang <dhruwangjariwala18@gmail.com>
* fix: remove unused stripe_public_key env var
* feat: include all possible env vars in documentation
* update enviroment variables in docs
---------
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
* Improve developer experience by analyzing PRs automatically using Github actions
* update docker workflow base images
* use ubuntu latest image
* move issue label action to workflow dir
* feat: revamp nocode action across frontend, backend, and js lib
* fix: remove console warning for ref forwarding
* feat: make advancedToggle component and use it across
* feat: use advancedToggle all across survey editor
* feat: use advancedToggle all across survey editor for link surveys
* remove: unused imports
* ui tweaks
* fix: form registration
* chore: advancedOptionToggle now has grey box inside the div
* fix: handle multiple css selectors separately
* test no code demo app
* replace logout with reset in demo apps
---------
Co-authored-by: Johannes <johannes@formbricks.com>
* Initialized Gitpod tested scripts
* ignored ports 1025 and 8025
* added website dev environment
* removed api and error tasks and prioritized web task to be shown first
* moved link LinkSurvey to RSC
* made some code refactors
* made requested changes
* ran pnpm build and added configured inactive survey
* fixed a build issue
* made some code refactors
---------
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
* moved apikey settings to server component
* rename ZApiKeyData to ZApiKeyCreateInput
* Make smaller improvements
---------
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
* feat: migrate look and feel to serverside component with loading screen
* fix: use existing product type instead of creating a custom type
* fix: make improvements as Matti suggested
* change attributes order in updateProduct function
* run pnpm format
---------
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
* validate: for email in the user verification modal
* feat: email auth is now a server page, uses server-side zod lib for email input validation, removes validator lib
* Add FormWrapper to Error Message
---------
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
* made modal component responsive
* added tab switch
* added mobile preview mode for surveys
* did some refactors
* did some refactors
* added type defs
* ran pnpm format
* removed an unused comment
* fixed variable name typo
* fixed UI bugs and added mobile mockup to link surveys
* restored changes from fix long description PR
* fixed scroll to top issue and toggle hide bug
* fixed minor animation bug
* fixed placement issue
* re-embed restart button, make phone preview more responsive
---------
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
* Chore: moved profile settings to server component
* ran pnpm format
* fisxed a build issue
* made requested changes
* made some refactors
---------
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
* fix: fixes close survey on x response issue
* feat: updates
* chore: don't update _count
* chore: optimizations
* fix: fixes issue with not being able to enter a lower value at all
* update toast message
* add response count to toast
* only count completed responses
---------
Co-authored-by: Johannes <johannes@formbricks.com>
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
* feat: migration /[personId] page to server side
* feat: decouple components in person page
* fix: ZDisplaysWithSurveyName now extends the ZDisplay type
* feat: drop custom service and use existing service for survey and response
* run pnpm format
* shift data fetching to component level but still server side
* rename event to action
* move special person services to activity service
* remove activityFeedItem type in ActivityFeed
* simplify TResponseWithSurvey
---------
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
* fix: attempts to reduce time taken to create team
* fix: fixes long time taken in team creation
* fix: refactors prisma logic
* feat: added logic for adding demo data while signing up
* fix: adds comment
* fix: adds another logic for adding demo data
* fix: adds service for adding demo data
* fix: fixes
* fix: adds demo product creation logic in next auth options
* fix: fixes next auth options
* fix: fixes team creation logic
* refactor: clean up
* fix: moves the logic for adding demo product while creating team in bg
* fix: moves individual queries in a transaction
* refactor: service
* fix: moves api route to app-dir
* fix: fixes api calls
* fix: fixes cache
* fix: removes unused code
* feat: handle openssl producing special characters that were causing errrs for sed to read
* feat: use all variables in dockerfile from the sole env itself
* add back button, next with local storaage wip
* handle submission and skip submission logic
* handle showing stored value on same concurrent question type.
* remove console.log
* fix next button not showing, add saving answer on pressing back to local storage
* add temp props to QuestionCondition in preview modal
* add temp props to QuestionCondition in preview modal again...
* update navigation logic
* update survey question preview
* add back-button component
* add back button to formbricks/js
* refactor localStorage functions to lib
* remove unused import
* add form prefilling when reloading forms
* merge main into branch
* Revert "merge main into branch"
This reverts commit 13bc9c06ec.
* rename localStorage key answers->responses
* rename answers -> responses in linkSurvey lib
* when survey page reloaded jump to next question instead of current question
* rename getStoredAnswer -> getStoredResponse
* continue renaming
* continue renaming
* rename answerValue -> responseValue
---------
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
label:Is your feature request related to a problem? Please describe.
description:A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
validations:
required:true
- type:textarea
id:solution-description
attributes:
label:Describe the solution you'd like
description:A clear and concise description of what you want to happen.
validations:
required:true
- type:textarea
id:alternate-solution-description
attributes:
label:Describe alternatives you've considered
description:A clear and concise description of any alternative solutions or features you've considered.
validations:
required:false
- type:textarea
id:additional-context
attributes:
label:Additional context
description:Add any other context or screenshots about the feature request here.
validations:
required:false
- type:markdown
id:formbricks-info
attributes:
value:|
### How we code at Formbricks 🤓
- type:textarea
id:problem-description
attributes:
label:Is your feature request related to a problem? Please describe.
description:A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
validations:
required:true
- type:textarea
id:solution-description
attributes:
label:Describe the solution you'd like
description:A clear and concise description of what you want to happen.
validations:
required:true
- type:textarea
id:alternate-solution-description
attributes:
label:Describe alternatives you've considered
description:A clear and concise description of any alternative solutions or features you've considered.
validations:
required:false
- type:textarea
id:additional-context
attributes:
label:Additional context
description:Add any other context or screenshots about the feature request here.
validations:
required:false
- type:markdown
id:formbricks-info
attributes:
value:|
### How we code at Formbricks 🤓
- Everything is type-safe
- All UI components are in the package `formbricks/ui`
- Run `pnpm dev` to find a demo app to test in-app surveys at `localhost:3002`
- We use **chatGPT** to help refactor code. Use our [Formbricks ✨ megaprompt ✨](https://github.com/formbricks/formbricks/blob/main/megaprompt.md) to create the right
context before you write your prompt.
- Follow Best Practices lined out in our [Contributor Docs](https://formbricks.com/docs/contributing/how-we-code)
- First time: Please read our [introductory blog post](https://formbricks.com/blog/join-the-formtribe)
- All UI components are in the package `formbricks/ui`
- Run `pnpm go` to find a demo app to test in-app surveys at `localhost:3002`
- Everything is type-safe
- We use **chatGPT** to help refactor code. Use our [Formbricks ✨ megaprompt ✨](https://github.com/formbricks/formbricks/blob/main/megaprompt.md) to create the right
context before you write your prompt.
- Anything unclear? [Ask in Discord](https://formbricks.com/discord)
<!-- We're starting to get more and more contributions. Please help us making this efficient for all of us and go through this checklist. Please tick off what you did -->
- [ ] Added a screen recording or screenshots to this PR
### Required
- [ ] Filled out the "How to test" section in this PR
- [ ] Read the [contributing guide](https://github.com/formbricks/formbricks/blob/main/CONTRIBUTING.md)
- [ ] Read [How we Code at Formbricks](<[https://github.com/formbricks/formbricks/blob/main/CONTRIBUTING.md](https://formbricks.com/docs/contributing/how-we-code)>)
- [ ] Self-reviewed my own code
- [ ] Commented on my code in hard-to-understand bits
- [ ] Ran `pnpm build`
@@ -41,4 +42,9 @@ Fixes # (issue)
- [ ] Removed all `console.logs`
- [ ] Merged the latest changes from main onto my branch with `git pull origin main`
- [ ] My changes don't cause any responsiveness issues
- [ ] First PR at Formbricks? [Please sign the CLA!](https://formbricks.com/clmyhzfrymr4ko00hycsg1tvx) Without it we wont be able to merge it 🙏
### Appreciated
- [ ] If a UI change was made: Added a screen recording or screenshots to this PR
- [ ] Updated the Formbricks Docs if changes were necessary
Hey there and thank you for opening this pull request! 👋🏼
We require pull request titles to follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/) and it looks like your proposed title needs to be adjusted.
Details:
```
${{ steps.lint_pr_title.outputs.error_message }}
```
# Delete a previous comment when the issue has been resolved
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to make participation in Formbricks and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment include:
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
- The use of sexualized language or imagery and unwelcome sexual attention or advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic address, without explicit permission
- Other conduct that could reasonably be considered inappropriate in a professional setting
## Our Responsibilities
We as project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
We have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned with this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project email address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at hola@formbricks.com - all complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident.
## Enforcement Guidelines
Community managers will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series of actions.
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public of private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within the community.
## Attribution
This Code of Conduct is adapted from the Contributor Covenant, version 2.0, available at [https://www.contributor-covenant.org/version/2/0/code_of_conduct.html](https://www.contributor-covenant.org/version/2/0/code_of_conduct.html).
We are so happy that you are interested in contributing to Formbricks 🤗
# 🚀 Join the Formbricks Tribe! 🧱
There are many ways to contribute to Formbricks with writing Issues, fixing bugs, building new features or updating the docs.
First and foremost, we're absolutely thrilled that you're considering becoming a part of the Formbricks Tribe! 🤗
# Issues
Discover a myriad of ways to leave your mark on Formbricks — whether it's by squashing bugs, crafting new features, or enhancing our documentation.
Spotted a bug? Has deployment gone wrong? Do you have user feedback? [Raise an issue](https://github.com/formbricks/formbricks/issues/new/choose) for the fastest response.
## 🐛 Issue Hunters
... or pick up and fix an issue if you want to do a Pull Request.
Did you stumble upon a bug? Encountered a hiccup in deployment? Perhaps you have some user feedback to share? Your quickest route to help us out is by [raising an issue](https://github.com/formbricks/formbricks/issues/new/choose). We're on standby to respond swiftly.
# Feature requests
## 💡 Feature Architects
Raise an issue for these and tag it as an Enhancement. We love every idea. Please give us as much context on the why as possible.
Are you brimming with brilliant ideas? For new features that can elevate Formbricks, create an issue and slap on the "Enhancement" tag. We adore every concept that you throw our way. Just make sure to provide us with the "why" behind your idea. We're all ears!
# Creating a PR
## 🛠 Crafting Pull Requests
Please fork the repository, make your changes and create a new pull request if you want to make an update.
Ready to dive into the code and make a real impact? Here's your path:
If you want to speak to us before doing lots of work, please join our [Discord server](https://formbricks.com/discord) and tell us what you would like to work on - we're very responsive and friendly!
1.**Read our Best Practices**: [It takes 5 minutes](https://formbricks.com/docs/contributing/how-we-code) but will help you save hours 🤓
For QA of your Pull-Request, you can also get in touch with Matti on Discord. But we will also get to your PR without you taking additional action ;-)
1.**Fork the Repository:** Fork our repository or use [Gitpod](https://formbricks.com/docs/contributing/gitpod)
# Features
1.**Tweak and Transform:** Work your coding magic and apply your changes.
We are currently working on having a clear [Roadmap](https://github.com/orgs/formbricks/projects/1) for the next steps ahead.
1.**Pull Request Act:** If you're ready to go, craft a new pull request closely following our PR template 🙏
But you can also pick a feature that is not already on the roadmap if you think it creates a positive impact for Formbricks.
Would you prefer a chat before you dive into a lot of work? Our [Discord server](https://formbricks.com/discord) is your harbor. Share your thoughts, and we'll meet you there with open arms. We're responsive and friendly, promise!
If you are at all unsure, just raise it as an enhancement issue first and tell us that you like to work on it, and we'll very quickly respond.
## 🚀 Aspiring Features
If you spot a feature that isn't part of our official plan but could propel Formbricks forward, don't hesitate. Raise it as an enhancement issue, and let us know you're ready to take the lead. We'll be quick to respond.
Together, let's craft the future of Formbricks, making it better, bolder, and more brilliant! 🚀🧱🌟
@@ -39,17 +44,31 @@ Formbricks is your go-to solution for in-product micro-surveys that will superch
## 💪 Mission: Make customer-centric decisions based on data.
Formbricks helps you apply best practices from data-driven work and experience management to make better business decisions. Ask users as they experience your product - and leverage a significantly higher conversion rate. Gather all insights you can - including partial submissions and build conviction for the next product decision. Better data, better business.
Formbricks is a powerful tool for creating in-product micro-surveys - and leverage a significantly higher conversion rate. It allows you to gather valuable insights from your users, enabling you to make data-driven decisions that enhance your product's user experience. With Formbricks, you can create surveys with our no-code editor, choose from a variety of templates, target specific user groups, and much more.
### Table of Contents
- [Features](#features)
- [Getting Started](#getting-started)
- [Cloud Version](#cloud-version)
- [Self-hosted Version](#self-hosted-version)
- [Development](#development)
- [Contribution](#contribution)
- [Contact](#contact-us)
- [License](#license)
- [Security](#security)
<a id="features"></a>
### Features
- 📲 Create **in-product surveys** with our nocode editor with multiple question types
- 📚 Choose from a variety of best-practice **templates**
- 👩🏻 Launch and **target your surveys to specific user groups** without changing your application code
- 🔗 Create shareable **link surveys**
- 👨👩👦 Invite your team members to **collaborate** on your surveys
- 🔌 Integrate Formbricks with **Slack, Posthog, Zapier and more**
- 🔒 All **open source**, transparent and self-hostable
- 📲 Create **in-product surveys** with our no-code editor with multiple question types.
- 📚 Choose from a variety of best-practice **templates**.
- 👩🏻 Launch and **target your surveys to specific user groups** without changing your application code.
- 🔗 Create shareable **link surveys**.
- 👨👩👦 Invite your team members to **collaborate** on your surveys.
- 🔌 Integrate Formbricks with **Slack, Posthog, Zapier, n8n and more**.
- 🔒 All **open source**, transparent and self-hostable.
### Built on Open Source
@@ -61,17 +80,65 @@ Formbricks helps you apply best practices from data-driven work and experience m
- 🔒 [Auth.js](https://authjs.dev/)
- 🧘♂️ [Zod](https://zod.dev/)
<a id="getting-started"></a>
## 🚀 Getting started
We've got several options depending on your need to help you quickly get started with Formbricks.
<a id="cloud-version"></a>
### ☁️ Cloud Version
Formbricks has a hosted cloud offering with a generous free plan to get you up and running as quickly as possible. To get started, please visit [formbricks.com](https://formbricks.com)
Formbricks has a hosted cloud offering with a generous free plan to get you up and running as quickly as possible. To get started, please visit [formbricks.com](https://formbricks.com).
<a id="self-hosted-version"></a>
### 🐳 Self-hosted version
Formbricks is available Open-Source under AGPLv3 license. You can host Formbricks on your own servers using Docker without a subscription. To get started with self-hosting, take a look at our [self-hosting docs](https://formbricks.com/docs/self-hosting/deployment).
Formbricks is available Open-Source under AGPLv3 license. You can host Formbricks on your own servers using Docker without a subscription.
(In the future we may develop additional features that aren't in the free Open-Source version)
(In the future we may develop additional features that aren't in the free Open-Source version).
If you opt for self-hosting Formbricks, here are a few options to consider:
#### Docker
To get started with self-hosting with Docker, take a look at our [self-hosting docs](https://formbricks.com/docs/self-hosting/deployment).
#### Community-managed One Click Hosting
##### Railway
You can deploy Formbricks on [Railway](https://railway.app) using the button below.
[](https://railway.app/new/template/PPDzCd)
<a id="development"></a>
### 👨💻 Development
#### Prerequisites
Here is what you need to be able to run Formbricks:
- [Docker](https://www.docker.com/) - to run PostgreSQL and MailHog
#### Local Setup
To get started locally, we've got a [guide to help you](https://formbricks.com/docs/contributing/setup).
#### Gitpod Setup
1. Click the button below to open this project in Gitpod.
2. This will open a fully configured workspace in your browser with all the necessary dependencies already installed.
[](https://gitpod.io/#https://github.com/formbricks/formbricks)
<a id="contribution"></a>
## ✍️ Contribution
@@ -79,22 +146,36 @@ We are very happy if you are interested in contributing to Formbricks 🤗
Here are a few options:
- Star this repo
- Create issues every time you feel something is missing or goes wrong
- Upvote issues with 👍 reaction so we know what's the demand for particular issue to prioritize it within roadmap
- Star this repo.
- Create issues every time you feel something is missing or goes wrong.
- Upvote issues with 👍 reaction so we know what the demand for a particular issue is to prioritize it within the roadmap.
Please check out [our contribution guide](https://formbricks.com/docs/contributing/introduction) and our [list of open issues](https://github.com/formbricks/formbricks/issues) for more information.
Let's have a chat about your survey needs and get you started.
<a href="https://cal.com/johannes/onboarding?utm_source=banner&utm_campaign=oss"><img alt="Book us with Cal.com" src="https://cal.com/book-with-cal-dark.svg" /></a>
<a id="license"></a>
## ⚖️ License
Distributed under the AGPLv3 License. See `LICENSE` for more information.
Distributed under the AGPLv3 License. See [`LICENSE`](./LICENSE) for more information.
<a id="security"></a>
## 🔒 Security
We take security very seriously. If you come across any security vulnerabilities, please disclose them by sending an email to security@formbricks.com. We appreciate your help in making our platform as secure as possible and are committed to working with you to resolve any issues quickly and efficiently. See `SECURITY.md` for more information.
We take security very seriously. If you come across any security vulnerabilities, please disclose them by sending an email to security@formbricks.com. We appreciate your help in making our platform as secure as possible and are committed to working with you to resolve any issues quickly and efficiently. See [`SECURITY.md`](./SECURITY.md) for more information.
<p align="right"><a href="#top">🔼 Back to top</a></p>
This is Formbrick's security policy. Please reach out to us
on our Discord or, if privately, via <security@formbricks.com>
Based on [https://supabase.com/.well-known/security.txt](https://supabase.com/.well-known/security.txt)
## Introduction
At Formbricks, we consider the security of our systems a top priority. But no matter how much effort we put into system security, there can still be vulnerabilities present.
Formbricks is dedicated to maintaining the integrity and security of our systems and our clients' data. In our pursuit to keep our technology environment safe, we welcome the collaborative efforts of our user community and security researchers to enhance security protocols and continuously secure our platform. This security policy outlines our approach towards handling data, ensuring secure practices, and managing the disclosure of vulnerabilities.
If you discover a vulnerability, we would like to know about it so we can take steps to address it as quickly as possible. We would like to ask you to help us better protect our clients and our systems.
## I. Third-Party Data Usage Policy
## Out of scope vulnerabilities:
We affirm our commitment towards meticulous validation of data usage and collection scope by any third-party library or integration utilized in our operations. We adhere to the following protocols:
-Clickjacking on pages with no sensitive actions.
-Unauthenticated/logout/login CSRF.
-Attacks requiring MITM or physical access to a user's device.
- Any activity that could lead to the disruption of our service (DoS).
- Content spoofing and text injection issues without showing an attack vector/without being able to modify HTML/CSS.
- Email spoofing
- Missing DNSSEC, CAA, CSP headers
- Lack of Secure or HTTP only flag on non-sensitive cookies
- Deadlinks
-Rigorous vetting of third-party services to confirm adherence to our data usage and privacy standards.
-Continuous monitoring and assessment of third-party practices to ensure ongoing compliance.
-Immediate action to mitigate risks if a third-party deviates from agreed-upon data practices.
## Please do the following:
## II. Annual Penetration Testing (Pentest)
- E-mail your findings to [security@formbricks.com](mailto:security@formbricks.com).
- Do not run automated scanners on our infrastructure or dashboard. If you wish to do this, contact us and we will set up a sandbox for you.
- Do not take advantage of the vulnerability or problem you have discovered, for example by downloading more data than necessary to demonstrate the vulnerability or deleting or modifying other people's data,
- Do not reveal the problem to others until it has been resolved,
- Do not use attacks on physical security, social engineering, distributed denial of service, spam or applications of third parties,
- Do provide sufficient information to reproduce the problem, so we will be able to resolve it as quickly as possible. Usually, the IP address or the URL of the affected system and a description of the vulnerability will be sufficient, but complex vulnerabilities may require further explanation.
To understand and bolster our security stature, Formbricks undertakes:
## What we promise:
- Annual penetration testing executed by an independent, skilled third party.
- Prioritization of any identified issues, with immediate action on critical vulnerabilities.
- Transparent communication and learnings shared with relevant stakeholders.
- We will respond to your report within 3 business days with our evaluation of the report and an expected resolution date,
- If you have followed the instructions above, we will not take any legal action against you in regard to the report,
- We will handle your report with strict confidentiality, and not pass on your personal details to third parties without your permission,
- We will keep you informed of the progress towards resolving the problem,
- In the public information concerning the problem reported, we will give your name as the discoverer of the problem (unless you desire otherwise), and
- We strive to resolve all problems as quickly as possible, and we would like to play an active role in the ultimate publication on the problem after it is resolved.
## III. Vulnerability Reporting and Management
Please do not use attacks on physical security, social engineering, distributed denial of service, spam or applications of third parties.
### **A. When to Report a Vulnerability**
We invite you to report if:
- A potential security vulnerability in Formbricks is identified.
- There is uncertainty about how a vulnerability affects our platform.
- A vulnerability is detected in a dependent project of Formbricks.
- An action was executed which, in your belief, should be restricted.
### **B. When Reporting is Unnecessary**
Avoid reporting if:
- Assistance is needed to optimize Formbricks for security – please engage on our Discord for this.
- Help is required for applying security-related updates.
- The concern is not related to security.
### **C. Vulnerability Reporting Procedure**
In the interest of responsibly managing vulnerabilities, please adhere to the following procedure:
> Do not reveal the problem to others until it has been resolved.
1.**Send a Detailed Report**:
- Address emails to [security@formbricks.com](mailto:security@formbricks.com).
- Include:
- Problem description.
- Detailed, reproducible steps, with screenshots where possible.
- Affected version(s).
- Known possible mitigations.
- Your Discord username or preferred contact method.
2.**Acknowledgement of Receipt**:
- Our security team will acknowledge receipt and provide an initial response within 48 hours.
- Following verification of the vulnerability and the fix, a release plan will be formulated, with the fix deployed between 7 to 28 days, depending on the severity and complexity.
3.**Ongoing Communication**:
- A project maintainer may engage with you for additional details or clarification.
- We appreciate your patience as we explore the reported item, verify its authenticity, and ascertain the existence of a vulnerability.
---
### Please Read the below carefully
If you have followed the instructions above, we will **not** take any legal action against you in regard to the report,
We will handle your report with strict confidentiality, and not pass on your personal details to third parties without your permission, We will keep you informed of the progress towards resolving the problem, In the public information concerning the problem reported, we will give your name as the discoverer of the problem (unless you desire otherwise).
We, at Formbricks, wish to express our gratitude towards all individuals who assist us in fortifying our security posture. Your responsible disclosure and cooperation enable us to elevate our security protocols, safeguarding our platform and data therein.
Tailwind Labs Inc. grants you an on-going, non-exclusive license to use the Components and Templates.
The license grants permission to **one individual** (the Licensee) to access and use the Components and Templates.
You **can**:
- Use the Components and Templates to create unlimited End Products.
- Modify the Components and Templates to create derivative components and templates. Those components and templates are subject to this license.
- Use the Components and Templates to create unlimited End Products for unlimited Clients.
- Use the Components and Templates to create End Products where the End Product is sold to End Users.
- Use the Components and Templates to create End Products that are open source and freely available to End Users.
You **cannot**:
- Use the Components and Templates to create End Products that are designed to allow an End User to build their own End Products using the Components and Templates or derivatives of the Components and Templates.
- Re-distribute the Components and Templates or derivatives of the Components and Templates separately from an End Product, neither in code or as design assets.
- Share your access to the Components and Templates with any other individuals.
- Use the Components and Templates to produce anything that may be deemed by Tailwind Labs Inc, in their sole and absolute discretion, to be competitive or in conflict with the business of Tailwind Labs Inc.
### Example usage
Examples of usage **allowed** by the license:
- Creating a personal website by yourself.
- Creating a website or web application for a client that will be owned by that client.
- Creating a commercial SaaS application (like an invoicing app for example) where end users have to pay a fee to use the application.
- Creating a commercial self-hosted web application that is sold to end users for a one-time fee.
- Creating a web application where the primary purpose is clearly not to simply re-distribute the components (like a conference organization app that uses the components for its UI for example) that is free and open source, where the source code is publicly available.
Examples of usage **not allowed** by the license:
- Creating a repository of your favorite Tailwind UI components or templates (or derivatives based on Tailwind UI components or templates) and publishing it publicly.
- Creating a React or Vue version of Tailwind UI and making it available either for sale or for free.
- Create a Figma or Sketch UI kit based on the Tailwind UI component designs.
- Creating a "website builder" project where end users can build their own websites using components or templates included with or derived from Tailwind UI.
- Creating a theme, template, or project starter kit using the components or templates and making it available either for sale or for free.
- Creating an admin panel tool (like [Laravel Nova](https://nova.laravel.com/) or [ActiveAdmin](https://activeadmin.info/)) that is made available either for sale or for free.
In simple terms, use Tailwind UI for anything you like as long as it doesn't compete with Tailwind UI.
### Personal License Definitions
Licensee is the individual who has purchased a Personal License.
Components and Templates are the source code and design assets made available to the Licensee after purchasing a Tailwind UI license.
End Product is any artifact produced that incorporates the Components or Templates or derivatives of the Components or Templates.
End User is a user of an End Product.
Client is an individual or entity receiving custom professional services directly from the Licensee, produced specifically for that individual or entity. Customers of software-as-a-service products are not considered clients for the purpose of this document.
## Team License
Tailwind Labs Inc. grants you an on-going, non-exclusive license to use the Components and Templates.
The license grants permission for **up to 25 Employees and Contractors of the Licensee** to access and use the Components and Templates.
You **can**:
- Use the Components and Templates to create unlimited End Products.
- Modify the Components and Templates to create derivative components and templates. Those components and templates are subject to this license.
- Use the Components and Templates to create unlimited End Products for unlimited Clients.
- Use the Components and Templates to create End Products where the End Product is sold to End Users.
- Use the Components and Templates to create End Products that are open source and freely available to End Users.
You **cannot**:
- Use the Components or Templates to create End Products that are designed to allow an End User to build their own End Products using the Components or Templates or derivatives of the Components or Templates.
- Re-distribute the Components or Templates or derivatives of the Components or Templates separately from an End Product.
- Use the Components or Templates to create End Products that are the property of any individual or entity other than the Licensee or Clients of the Licensee.
- Use the Components or Templates to produce anything that may be deemed by Tailwind Labs Inc, in their sole and absolute discretion, to be competitive or in conflict with the business of Tailwind Labs Inc.
### Example usage
Examples of usage **allowed** by the license:
- Creating a website for your company.
- Creating a website or web application for a client that will be owned by that client.
- Creating a commercial SaaS application (like an invoicing app for example) where end users have to pay a fee to use the application.
- Creating a commercial self-hosted web application that is sold to end users for a one-time fee.
- Creating a web application where the primary purpose is clearly not to simply re-distribute the components or templates (like a conference organization app that uses the components or a template for its UI for example) that is free and open source, where the source code is publicly available.
Examples of use **not allowed** by the license:
- Creating a repository of your favorite Tailwind UI components or template (or derivatives based on Tailwind UI components or templates) and publishing it publicly.
- Creating a React or Vue version of Tailwind UI and making it available either for sale or for free.
- Creating a "website builder" project where end users can build their own websites using components or templates included with or derived from Tailwind UI.
- Creating a theme or template using the components or templates and making it available either for sale or for free.
- Creating an admin panel tool (like [Laravel Nova](https://nova.laravel.com/) or [ActiveAdmin](https://activeadmin.info/)) that is made available either for sale or for free.
- Creating any End Product that is not the sole property of either your company or a client of your company. For example your employees/contractors can't use your company Tailwind UI license to build their own websites or side projects.
### Team License Definitions
Licensee is the business entity who has purchased a Team License.
Components and Templates are the source code and design assets made available to the Licensee after purchasing a Tailwind UI license.
End Product is any artifact produced that incorporates the Components or Templates or derivatives of the Components or Templates.
End User is a user of an End Product.
Employee is a full-time or part-time employee of the Licensee.
Contractor is an individual or business entity contracted to perform services for the Licensee.
Client is an individual or entity receiving custom professional services directly from the Licensee, produced specifically for that individual or entity. Customers of software-as-a-service products are not considered clients for the purpose of this document.
## Enforcement
If you are found to be in violation of the license, access to your Tailwind UI account will be terminated, and a refund may be issued at our discretion. When license violation is blatant and malicious (such as intentionally redistributing the Components or Templates through private warez channels), no refund will be issued.
The copyright of the Components and Templates is owned by Tailwind Labs Inc. You are granted only the permissions described in this license; all other rights are reserved. Tailwind Labs Inc. reserves the right to pursue legal remedies for any unauthorized use of the Components or Templates outside the scope of this license.
## Liability
Tailwind Labs Inc.’s liability to you for costs, damages, or other losses arising from your use of the Components or Templates — including third-party claims against you — is limited to a refund of your license fee. Tailwind Labs Inc. may not be held liable for any consequential damages related to your use of the Components or Templates.
This Agreement is governed by the laws of the Province of Ontario and the applicable laws of Canada. Legal proceedings related to this Agreement may only be brought in the courts of Ontario. You agree to service of process at the e-mail address on your original order.
## Questions?
Unsure which license you need, or unsure if your use case is covered by our licenses?
Email us at [support@tailwindui.com](mailto:support@tailwindui.com) with your questions.
title: "Implementing Code Actions in Formbricks | Real-time User Action Tracking",
description:
"Dive into the world of Formbricks' code actions. Learn how to seamlessly integrate formbricks.track() method into your codebase, enabling real-time tracking of user actions like button clicks, visiting a specific URL. Up your survey game with precise and exact triggers.",
};
#### Actions
# Code Actions
Actions can also be set in the codebase to trigger surveys. Please add the code action first in the Formbricks web interface to be able to configure your surveys to use this action.
After that you can fire an action using `formbricks.track()`
<Col>
<CodeGroup title="Track an action">
```javascript
formbricks.track("Action Name");
```
</CodeGroup>
</Col>
Here is an example of how to fire an action when a user clicks a button:
import { Layout } from "@/components/docs/Layout";
export const meta = {
title: "No-Code Actions",
export const metadata = {
title: "Implementing No-Code Actions in Formbricks | Real-time User Action Tracking",
description:
"Utilize Formbricks' No-Code Actions like Page URL, innerText, and CSS Selector for easy survey triggers and enhanced user insights.",
"Discover the power of Formbricks' No-Code Actions. Easily set up triggers based on Page URL, innerText, and CSS Selectors without touching a line of code. Inccrease user engagement and get insights at precise moments in the user journey.",
};
#### Actions
# No-Code Actions
No-Code actions can be set up within Formbricks with just a few clicks. There are three types of No-Code actions:
## Page URL Action
@@ -26,5 +28,3 @@ The innerText action checks if the `innerText` of a clicked HTML element matches
## CSS Selector Action
The CSS Selector action checks if the provided CSS selector matches the selector of a clicked HTML element. The CSS selector can be a class, id or any other CSS selector within your website. Display a survey on any element click!
export default ({ children }) => <Layout meta={meta}>{children}</Layout>;
import { Layout } from "@/components/docs/Layout";
export const meta = {
title: "What are actions and why are they useful?",
export const metadata = {
title: "Using Actions in Formbricks | Fine-tuning User Moments",
description:
"Actions in Formbricks enable targeted survey displays during specific user journey moments. Enhance user segmentation by tracking actions for granular surveying.",
"Dive deep into how actions in Formbricks help products and teams to engage users at precise moments in their journey. Discover the power of actions, from coding to no-code setups, to refine user targeting and generate richer, more detailed user insights.",
};
#### Actions
# What are actions and why are they useful?
You want to understand what your users think and feel during specific moments in the user journey. To be able to ask at exactly the right point in time, you need actions.
## What are actions?
@@ -19,5 +21,3 @@ When a predefined action happens in your app, the Formbricks widget notices. Thi
## Why are actions useful?
Actions help you to display your surveys at the right time. Later on, you will be able to segment your users based on the actions they have triggered in the past. This way, you can create much more granular user segments, e.g. only target users that already have used a specific feature.
export default ({ children }) => <Layout meta={meta}>{children}</Layout>;
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' 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/<environment-id>/actions' }}
Adds an Actions for a given User by their User ID
<Row>
<Col>
### Mandatory Body Fields
<Properties>
<Property name="userId" type="string">
The id of the user for whom the action is being created.
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.
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.
- [Displays API](/docs/api/client/displays) - Mark Survey as Displayed or Responded for a Person
- [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
<Note>
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.
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/<environment-id>/people' }}
<Row>
<Col>
Create User with your own User ID
### Mandatory Request Body JSON Keys
<Properties>
<Property name="userId" type="string">
User ID which you would like to identify the person with
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.
| 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. |
| 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. |
import { Fence } from "@/components/shared/Fence";
export const metadata = {
title: "Formbricks People API: Fetch or Create Person Overview",
description:
"Dive into Formbricks' People API within the Public Client API suite, designed to work without authentication requirements. Seamlessly fetch or create a person by their userId and environmentId, optimizing client-side interactions while maintaining data privacy.",
};
#### 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)
<Note>You will need an API Key to interact with these APIs.</Note>
---
## Get all Action Classes {{ tag: 'GET', label: '/api/v1/management/action-classes' }}
<Row>
<Col>
Get all the existing action classes in your environment.
"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”
<Image src={AddApiKey} alt="Add API Key" quality="100" className="rounded-lg max-w-full sm:max-w-3xl" />
3. Create a key for the development or production environment.
4. Copy the key immediately. You won’t be able to see it again.
<Image
src={ApiKeySecret}
alt="API Key Secret"
quality="100"
className="rounded-lg max-w-full sm:max-w-3xl"
/>
<Note>
### 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.
</Note>
### 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' }}
<Row>
<Col>
Get the product details and environment type of your account.
import { Fence } from "@/components/shared/Fence";
export const metadata = {
title: "Formbricks People API: Fetch or Create Person Overview",
description:
"Dive into Formbricks' People API within the Public Client API suite, designed to work without authentication requirements. Seamlessly fetch or create a person by their userId and environmentId, optimizing client-side interAttributes while maintaining data privacy.",
};
#### 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)
<Note>You will need an API Key to interact with these APIs.</Note>
---
## Get all Attribute Classes {{ tag: 'GET', label: '/api/v1/management/attribute-classes' }}
<Row>
<Col>
Get all the existing attribute classes in your environment.
import { Fence } from "@/components/shared/Fence";
export const metadata = {
title: "Formbricks People API: Fetch or Create Person Overview",
description:
"Dive into Formbricks' People API within the Public Client API suite, designed to work without authentication requirements. Seamlessly fetch or create a person by their userId and environmentId, optimizing client-side interactions while maintaining data privacy.",
};
#### Management API
# Me API
This API can be used to get your own current environment details.
<Note>You will need an API Key to interact with these APIs.</Note>
---
## Get Environment {{ tag: 'GET', label: '/api/v1/management/me' }}
import { Fence } from "@/components/shared/Fence";
export const metadata = {
title: "Formbricks People API: Fetch or Create Person Overview",
description:
"Dive into Formbricks' People API within the Public Client API suite, designed to work without authentication requirements. Seamlessly fetch or create a person by their userId and environmentId, optimizing client-side interactions while maintaining data privacy.",
};
#### Management API
# People API
This set of API can be used to
- [List People](#list-people)
- [Get Person](#get-person)
- [Delete Person](#delete-person)
<Note>You will need an API Key to interact with these APIs.</Note>
---
## List People {{ tag: 'GET', label: '/api/v1/management/people' }}
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.",
};
#### Management API
# Responses API
This set of API can be used to
- [List Responses](#list-all-responses)
- [Get Response](#get-response-by-id)
- [Delete Response](#delete-a-response)
<Note>You will need an API Key to interact with these APIs.</Note>
---
## List all Responses {{ tag: 'GET', label: '/api/v1/management/responses' }}
<Row>
<Col>
Retrieve all the responses you have received in your environment.
import { Fence } from "@/components/shared/Fence";
export const metadata = {
title: "Formbricks Surveys API Documentation - How to Retrieve All Surveys",
description:
"Explore the comprehensive guide to the Formbricks Surveys API. Learn how to effectively retrieve all the surveys in your environment with the necessary headers and API key setup. Includes sample request and response formats.",
};
#### Management API
# Surveys API
This set of API can be used to
- [List All Surveys](#list-all-surveys)
- [Get Survey](#get-survey-by-id)
- [Create Survey](#create-survey)
- [Update Survey](#update-survey-by-id)
- [Delete Survey](#delete-survey-by-id)
<Note>You will need an API Key to interact with these APIs.</Note>
---
## List all surveys {{ tag: 'GET', label: '/api/v1/management/surveys' }}
<Row>
<Col>
Retrieve all the surveys you have for the environment.
"headline": "You are one of our power users! Do you have 5 minutes?",
"required": false,
"buttonLabel": "Happy to help!",
"logic": [
{
"condition": "skipped",
"destination": "end"
}
],
"html": "<p class=\"fb-editor-paragraph\" dir=\"ltr\"><span>We would love to understand your user experience better. Sharing your insight helps a lot!</span></p>",
"buttonExternal": false,
"dismissButtonLabel": "No, thanks."
},
{
"id": "kp62fbqe8cfzmvy8qwpr81b2",
"type": "multipleChoiceSingle",
"headline": "How disappointed would you be if you could no longer use My Product?",
"subheader": "Please select one of the following options:",
"required": true,
"choices": [
{
"id": "bdgy1hnwd7uwmfxk1ljqp1n5",
"label": "Not at all disappointed"
},
{
"id": "poabnvgtwenp8rb2v70gj4hj",
"label": "Somewhat disappointed"
},
{
"id": "opfiqyqz8wrqn0i0f7t24d3n",
"label": "Very disappointed"
}
],
"shuffleOption": "none"
},
{
"id": "klvpwd4x08x8quesihvw5l92",
"type": "multipleChoiceSingle",
"headline": "What is your role?",
"subheader": "Please select one of the following options:",
"required": true,
"choices": [
{
"id": "c8nerw6l9gpsxcmqkn10f9hy",
"label": "Founder"
},
{
"id": "ebjqezei6a2axtuq86cleetn",
"label": "Executive"
},
{
"id": "ctiijjblyhlp22snypfamqt1",
"label": "Product Manager"
},
{
"id": "ibalyr0mhemfkkr82vypmg40",
"label": "Product Owner"
},
{
"id": "fipk606aegslbd0e7yhc0xjx",
"label": "Software Engineer"
}
],
"shuffleOption": "none"
},
{
"id": "ryo75306flyg72iaeditbv51",
"type": "openText",
"headline": "What type of people do you think would most benefit from My Product?",
"required": true
},
{
"id": "lkjaxb73ulydzeumhd51sx9g",
"type": "openText",
"headline": "What is the main benefit you receive from My Product?",
"required": true
},
{
"id": "ec7agikkr58j8uonhioinkyk",
"type": "openText",
"headline": "How can we improve My Product for you?",
"subheader": "Please be as specific as possible.",
"required": true
}
],
"thankYouCard": {
"enabled": true,
"headline": "Thank you!",
"subheader": "We appreciate your feedback."
},
"delay": 0,
"autoComplete": null,
"closeOnDate": null
}
]
}
```
```json {{ title: '401 Not Authenticated' }}
{
"code": "not_authenticated",
"message": "Not authenticated",
"details": {
"x-Api-Key": "Header not provided or API Key invalid"
}
}
```
</CodeGroup>
</Col>
</Row>
---
## Get Survey by ID {{ tag: 'GET', label: '/api/v1/management/surveys/<survey-id>' }}
"headline": "Why did you cancel your subscription?",
"subheader": "We're sorry to see you leave. Help us do better:",
"required": true,
"logic": [
{
"condition": "equals",
"value": "Difficult to use",
"destination": "easier-to-use"
},
{
"condition": "equals",
"value": "It's too expensive",
"destination": "30-off"
},
{
"condition": "equals",
"value": "I am missing features",
"destination": "missing-features"
},
{
"condition": "equals",
"value": "Poor customer service",
"destination": "poor-service"
},
{
"condition": "equals",
"value": "I just didn't need it anymore",
"destination": "end"
}
],
"choices": [
{
"id": "isud2xethsw63dlwl89kr4kj",
"label": "Difficult to use"
},
{
"id": "opuu4ba3dlele3n0gjkuh27c",
"label": "It's too expensive"
},
{
"id": "gnypapo0rhvkt8pwosrphvbl",
"label": "I am missing features"
},
{
"id": "wkgsrsrazd9kfunqhzjezx6t",
"label": "Poor customer service"
},
{
"id": "pykmgyyw74vg0gaeryj6bo4c",
"label": "I just didn't need it anymore"
}
]
},
{
"id": "easier-to-use",
"type": "openText",
"headline": "What would have made {{productName}} easier to use?",
"subheader": "",
"required": true,
"buttonLabel": "Send",
"logic": [
{
"condition": "submitted",
"destination": "end"
}
]
},
{
"id": "30-off",
"type": "cta",
"headline": "Get 30% off for the next year!",
"required": true,
"buttonLabel": "Get 30% off",
"logic": [
{
"condition": "clicked",
"destination": "end"
}
],
"html": "<p class=\"fb-editor-paragraph\" dir=\"ltr\"><span>We'd love to keep you as a customer. Happy to offer a 30% discount for the next year.</span></p>",
"buttonUrl": "https://formbricks.com",
"buttonExternal": true,
"dismissButtonLabel": "Skip"
},
{
"id": "missing-features",
"type": "openText",
"headline": "What features are you missing?",
"subheader": "",
"required": true,
"logic": [
{
"condition": "submitted",
"destination": "end"
}
]
},
{
"id": "poor-service",
"type": "cta",
"headline": "So sorry to hear 😔 Talk to our CEO directly!",
"required": true,
"buttonLabel": "Send email to CEO",
"logic": [
{
"condition": "clicked",
"destination": "end"
}
],
"html": "<p class=\"fb-editor-paragraph\" dir=\"ltr\"><span>We aim to provide the best possible customer service. Please email our CEO and she will personally handle your issue.</span></p>",
"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"
"headline": "Why did you cancel your subscription?",
"subheader": "We're sorry to see you leave. Help us do better:",
"required": true,
"logic": [
{
"condition": "equals",
"value": "Difficult to use",
"destination": "easier-to-use"
},
{
"condition": "equals",
"value": "It's too expensive",
"destination": "30-off"
},
{
"condition": "equals",
"value": "I am missing features",
"destination": "missing-features"
},
{
"condition": "equals",
"value": "Poor customer service",
"destination": "poor-service"
},
{
"condition": "equals",
"value": "I just didn't need it anymore",
"destination": "end"
}
],
"choices": [
{
"id": "isud2xethsw63dlwl89kr4kj",
"label": "Difficult to use"
},
{
"id": "opuu4ba3dlele3n0gjkuh27c",
"label": "It's too expensive"
},
{
"id": "gnypapo0rhvkt8pwosrphvbl",
"label": "I am missing features"
},
{
"id": "wkgsrsrazd9kfunqhzjezx6t",
"label": "Poor customer service"
},
{
"id": "pykmgyyw74vg0gaeryj6bo4c",
"label": "I just didn't need it anymore"
}
]
},
{
"id": "easier-to-use",
"type": "openText",
"headline": "What would have made {{productName}} easier to use?",
"subheader": "",
"required": true,
"buttonLabel": "Send",
"logic": [
{
"condition": "submitted",
"destination": "end"
}
]
},
{
"id": "30-off",
"type": "cta",
"headline": "Get 30% off for the next year!",
"required": true,
"buttonLabel": "Get 30% off",
"logic": [
{
"condition": "clicked",
"destination": "end"
}
],
"html": "<p class=\"fb-editor-paragraph\" dir=\"ltr\"><span>We'd love to keep you as a customer. Happy to offer a 30% discount for the next year.</span></p>",
"buttonUrl": "https://formbricks.com",
"buttonExternal": true,
"dismissButtonLabel": "Skip"
},
{
"id": "missing-features",
"type": "openText",
"headline": "What features are you missing?",
"subheader": "",
"required": true,
"logic": [
{
"condition": "submitted",
"destination": "end"
}
]
},
{
"id": "poor-service",
"type": "cta",
"headline": "So sorry to hear 😔 Talk to our CEO directly!",
"required": true,
"buttonLabel": "Send email to CEO",
"logic": [
{
"condition": "clicked",
"destination": "end"
}
],
"html": "<p class=\"fb-editor-paragraph\" dir=\"ltr\"><span>We aim to provide the best possible customer service. Please email our CEO and she will personally handle your issue.</span></p>",
"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"
title: "Formbricks Webhook API Documentation - List, Retrieve, Create, and Delete Webhooks",
description:
"Explore the comprehensive guide to the Formbricks Webhooks API. This is all you need to interact and play with the Formbricks Webhooks and integrate them into any third party app of your choice",
};
#### 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.
<Note>You will need an API Key to interact with these APIs.</Note>
---
## List Webhooks {{ tag: 'GET', label: '/api/v1/webhooks' }}
<Row>
<Col>
Learn how to retrieve a list of all webhooks via API.
| 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). |
import { Layout } from "@/components/docs/Layout";
export const meta = {
title: "Setting attributes with code",
export const metadata = {
title: "Guide for Setting Custom Attributes | Formbricks Documentation",
description:
"Set attributes in code using setAttribute function. Enhance user segmentation, target surveys effectively, and gather valuable insights for better decisions. All open-source.",
"Learn how to set attributes in code using setAttribute function. Enhance user segmentation, target surveys effectively, and gather valuable insights for better decisions. Easily send user-specific details for better survey segmentation and gain deeper insights.",
};
#### Attributes
# Setting attributes with code
One way to send attributes to Formbricks is in your code. In Formbricks, there are two special attributes for [user identification](/docs/attributes/identify-users)(user ID & email) and custom attributes. An example:
### Setting Custom User Attributes
## Setting Custom User Attributes
You can use the setAttribute function to set any custom attribute for the user (e.g. name, plan, etc.):
<Col>
<CodeGroup title="Setting Plan to Pro">
```javascript
formbricks.setAttribute("Plan", "Pro");
```
</CodeGroup>
</Col>
Generally speaking, the setAttribute function works like this:
title: "User Identification in Formbricks | Enhancing Survey Feedback",
description:
"A comprehensive guide on identifying users in Formbricks without compromising privacy. Learn how to set User ID, email, and custom attributes to optimize survey targeting, recontact users, and control survey intervals, all while respecting user anonymity.",
};
#### Attributes
# Identifying Users
At Formbricks, we value user privacy. By default, Formbricks doesn't collect or store any personal information from your users. However, we understand that it can be helpful for you to know which user submitted the feedback and also functionality like recontacting users and controlling the waiting period between surveys requires identifying the users. That's why we provide a way for you to share existing user data from your app, so you can view it in our dashboard.
If you would like to use the User Identification feature of Formbricks, target surveys to specific user segments and see more information about the user who responded to a survey, you can identify users by setting a User ID, email, and custom attributes. This guide will walk you through how to do that.
## Setting User ID
To enable the User identification feature you need to set the `userId` in the init() call of Formbricks. Only when the `userId` is set the person will be visible in the Formbricks dashboard. The `userId` can be any string and it's best to use the default identifier you use in your app (e.g. unique id from database or the email address if it's unique) but you can also anonymize these as long as they are unique for every user.
<Col>
<CodeGroup title="Setting User ID">
```javascript
formbricks.init({
environmentId: "<environment-id>",
apiHost: "<api-host>",
userId: "<user_id>",
});
```
</CodeGroup>
</Col>
## Setting User Email
The `userId` is the main identifier used in Formbricks and user identification is only enabled when it is set. In addition to the userId you can also set attributes that describes the user better. The email address can be set using the setEmail function:
<Col>
<CodeGroup title="Setting Email">
```javascript
formbricks.setEmail("user@example.com");
```
</CodeGroup>
</Col>
### Setting Custom User Attributes
You can use the setAttribute function to set any custom attribute for the user (e.g. name, plan, etc.):
<Col>
<CodeGroup title="Setting Custom Attributes">
```javascript
formbricks.setAttribute("Plan", "free");
```
</CodeGroup>
</Col>
### Logging Out Users
When a user logs out of your webpage, make sure to log them out of Formbricks as well. This will prevent new activity from being associated with an incorrect user. Use the logout function:
import { Layout } from "@/components/docs/Layout";
export const meta = {
title: "What are attributes and why are they useful?",
export const metadata = {
title: "Understanding User Attributes in Formbricks Surveys",
description:
"How to use attributes for user segmentation, enhancing survey targeting & results. Improve feedback quality and make data-driven decisions.",
"Dive into the importance of attributes in surveys. Learn how key-value pairs can significantly improve survey targeting, enhance feedback quality, and guide data-driven decisions with Formbricks.",
};
#### Attributes
# What are attributes and why are they useful?
Surveying your user base without segmentation leads to weak results and survey fatigue. Attributes help you segment your users into groups.
## What are attributes?
@@ -19,5 +21,3 @@ Attributes are sent from your application to Formbricks and are associated with
## Why are attributes useful?
Attributes help show surveys to the right group of people. For example, you can show a survey to all users who have a "Plan" attribute set to "Paid".
export default ({ children }) => <Layout meta={meta}>{children}</Layout>;
description: "Learn how to effectively utilize Formbricks' Churn Surveys to gain deeper insights into user departures. Dive into a step-by-step guide to craft, trigger, and optimize your churn surveys, ensuring you capture invaluable feedback at critical junctures",
};
#### Best Practices
# Learn from Churn
Churn is hard, but can teach you a lot. Whenever a user decides that your product isn’t worth it anymore, you have a unique opportunity to get deep insights. These insights are pure gold to reduce churn.
## Purpose
The Churn Survey is among the most effective ways to identify weaknesses in you offering. People were willing to pay but now are not anymore: What changed? Let’s find out!
The Churn Survey is among the most effective ways to identify weaknesses in your offering. People were willing to pay but now are not anymore: What changed? Let’s find out!
## Preview
@@ -43,11 +44,11 @@ To run the Churn Survey in your app you want to proceed as follows:
3. Choose correct recontact options to never miss a feedback
We assume that you have already installed the Formbricks Widget in your web app. It’s required to display
messages and surveys in your app. If not, please follow the [Quick Start Guide (takes 15mins
max.)](/docs/getting-started/quickstart)
</Callout>
<Note>
## Formbricks Widget running?
We assume that you have already installed the Formbricks Widget in your web app. It’s required to display messages
and surveys in your app. If not, please follow the [Quick Start Guide (takes 15mins max.)](/docs/getting-started/quickstart-in-app-survey)
</Note>
### 1. Create new Churn Survey
@@ -55,13 +56,23 @@ If you don't have an account yet, create one at [app.formbricks.com](https://app
Click on "Create Survey" and choose the template “Churn Survey”:
<Image src={CreateChurnFlow} alt="Create churn survey by template" quality="100" className="rounded-lg" />
<Image
src={CreateChurnFlow}
alt="Create churn survey by template"
quality="100"
className="rounded-lg max-w-full sm:max-w-3xl"
/>
### 2. Update questions (if you like)
You’re free to update the question and answer options. However, based on our experience, we suggest giving the provided template a go 😊
<Image src={ChangeText} alt="Change text content" quality="100" className="rounded-lg" />
<Image
src={ChangeText}
alt="Change text content"
quality="100"
className="rounded-lg max-w-full sm:max-w-3xl"
/>
_Want to change the button color? You can do so in the product settings._
@@ -77,49 +88,79 @@ To create the trigger for your Churn Survey, you have two options to choose from
1. **Trigger by innerText:** You likely have a “Cancel Subscription” button in your app. You can setup a user Action with the according `innerText` to trigger the survey, like so:
<Image src={TriggerInnerText} alt="Set the trigger by inner Text" quality="100" className="rounded-lg" />
<Image
src={TriggerInnerText}
alt="Set the trigger by inner Text"
quality="100"
className="rounded-lg max-w-full sm:max-w-3xl"
/>
2. **Trigger by CSS Selector:** In case you have more than one button saying “Cancel Subscription” in your app and only want to display the survey when one of them is clicked, you want to be more specific. The best way to do that is to give this button the HTML `id=“cancel-subscription”` and set your user action up like so:
<Image src={TriggerCSS} alt="Set the trigger by CSS Selector" quality="100" className="rounded-lg" />
<Image
src={TriggerCSS}
alt="Set the trigger by CSS Selector"
quality="100"
className="rounded-lg max-w-full sm:max-w-3xl"
/>
3. **Trigger by pageURL:** Lastly, you could also display your survey on a subpage “/subscription-cancelled” where you forward users once they cancelled the trial subscription. You can then create a user Action with the type `pageURL` with the following settings:
<Image src={TriggerPageUrl} alt="Set the trigger by page URL" quality="100" className="rounded-lg" />
<Image
src={TriggerPageUrl}
alt="Set the trigger by page URL"
quality="100"
className="rounded-lg max-w-full sm:max-w-3xl"
/>
Whenever a user visits this page, matches the filter conditions above and the recontact options (below) the survey will be displayed ✅
Here is our complete [Actions manual](/docs/actions/why) covering [Code](/docs/actions/code) and [No-Code](/docs/actions/no-code) Actions.
We’re currently building full-screen survey pop-ups. You’ll be able to prevent users from closing the survey unless they respond to it. It’s certainly debatable if you want that but you could force them to click through the survey before letting them cancel 🤷
</Callout>
<Note>
## Pre-churn flow coming soon
We’re currently building full-screen survey pop-ups. You’ll be able to prevent users from closing the survey
unless they respond to it. It’s certainly debatable if you want that but you could force them to click through
Lastly, scroll down to “Recontact Options”. Here you have to choose the correct settings to make sure you milk these super valuable insights. You want to make sure that this survey is always displayed, no matter if the user has already seen a survey in the past days:
import { Layout } from "@/components/docs/Layout";
import { Fence } from "@/components/shared/Fence";
import { Callout } from "@/components/shared/Callout";
import Image from "next/image";
import DocsFeedback from "@/components/docs/DocsFeedback";
import AddAction from "./add-action.png";
import ChangeId from "./change-id.png";
import DocsNavi from "./docs-navi.png";
import DocsTemplate from "./docs-template.png";
import SelectNonevent from "./select-nonevent.png";
import SwitchToDev from "./switch-to-dev.png";
import WhenToAsk from "./when-to-ask.png";
import CopyIds from "./copy-ids.png";
import AddAction from "./add-action.webp";
import ChangeId from "./change-id.webp";
import DocsNavi from "./docs-navi.webp";
import DocsTemplate from "./docs-template.webp";
import SelectNonevent from "./select-nonevent.webp";
import SwitchToDev from "./switch-to-dev.webp";
import WhenToAsk from "./when-to-ask.webp";
import CopyIds from "./copy-ids.webp";
export const meta = {
title: "Docs Feedback",
description: "Docs Feedback allows you to measure how clear your documentation is.",
export const metadata = {
title:
"Integrate Docs Feedback in Your Website: A Step-by-Step Guide on getting feedback on your Documentation with Formbricks",
description:
"Learn the step-by-step process to effectively measure the clarity of your documentation using Formbricks Cloud. Dive into best practices, setting up cloud environments, integrating feedback widgets on your frontend, and connecting to the Formbricks API for a seamless user experience.",
};
#### Best Practices
# Docs Feedback
Docs Feedback allows you to measure how clear your documentation is.
## Purpose
@@ -37,49 +40,80 @@ To get this running, you'll need a bit of time. Here are the steps we're going t
3. Connect to API
4. Test
### 1. Setting up Formbricks Cloud
## 1. Setting up Formbricks Cloud
1. To get started, create an account for the [Formbricks Cloud](https://app.formbricks.com/auth/signup).
2. In the Menu (top right) you see that you can switch between a “Development” and a “Production” environment. These are two separate environments so your test data doesn’t mess up the insights from prod. Switch to “Development”:
<Image src={SwitchToDev} alt="switch to dev environment" quality="100" className="rounded-lg" />
<Image
src={SwitchToDev}
alt="switch to dev environment"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
/>
3. Then, create a survey using the template “Docs Feedback”:
4. Change the Internal Question ID of the first question to **“isHelpful”** to make your life easier 😉
<Image src={ChangeId} alt="switch to dev environment" quality="100" className="rounded-lg" />
<Image
src={ChangeId}
alt="switch to dev environment"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
/>
5. In the same way, you can change the Internal Question ID of the _Please elaborate_ question to **“additionalFeedback”** and the one of the _Page URL_ question to **“pageUrl”**.
<Callout title="Answers need to be identical" type="note">
If you want different answers than “Yes 👍” and “No 👎” you need update the choices accordingly. They have
to be identical to the frontend we're building in the next step.
</Callout>
<Note>
Answers need to be identical If you want different answers than “Yes 👍” and “No 👎” you need to update the
choices accordingly. They have to be identical to the frontend we're building in the next step.
</Note>
6. Click on “Continue to Settings or select the audience tab manually. Scroll down to “When to ask” and create a new Action:
<Image src={WhenToAsk} alt="set up when to ask card" quality="100" className="rounded-lg" />
<Image
src={WhenToAsk}
alt="set up when to ask card"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
/>
7. Our goal is to create an event that never fires. This is a bit nonsensical because it is a workaround. Stick with me 😃 Fill the action out like on the screenshot:
Locate that file. We are using the [Tailwind Template “Syntax”](https://tailwindui.com/templates/syntax) for our docs. Here is our [Layout.tsx](https://github.com/formbricks/formbricks/blob/main/apps/formbricks-com/components/docs/Layout.tsx) file.
3. Write the frontend code for the widget. Here is the full component (we break it down right below):
<Col>
<CodeGroup title="Entire Widget">
```tsx
import { useState } from "react";
import { handleFeedbackSubmit, updateFeedback } from "../../lib/handleFeedbackSubmit";
import { Popover, PopoverTrigger, PopoverContent, Button } from "@formbricks/ui";
import { Popover, PopoverTrigger, PopoverContent } from "@formbricks/ui/Popover";
import { Button } from "@formbricks/ui/Button";
import { useRouter } from "next/router";
export default function DocsFeedback() {
@@ -173,9 +216,13 @@ export default function DocsFeedback() {
}
```
</CodeGroup>
</Col>
**Let’s break it down!**
Setting the local states and getting the current URL:
<Col>
<CodeGroup title="State Management">
```tsx
const router = useRouter(); // to get the URL of the current docs page
@@ -185,11 +232,13 @@ const [responseId, setResponseId] = useState(null); // to store responseID (will
const [freeText, setFreeText] = useState(""); // to locally store the additional info provided by user
```
</CodeGroup>
</Col>
Disabling feedback if config environment variables are not set properly:
<Col>
<CodeGroup title="Disable feedback if incorrect config env vars">
```tsx
// Disables feedback if key info like survey ID, API Host, or Formbricks environment ID are missing
The last step is to hook up your sparkling new frontend to the Formbricks API. To do so, we followed the “[Create Response](/docs/client-api/create-response)” and “[Update Response](/docs/client-api/update-response)” pages in our docs.
The last step is to hook up your sparkling new frontend to the Formbricks API. To do so, we followed the “[Create Response](/docs/api/client/responses#create-a-response)” and “[Update Response](/docs/api/client/responses#update-a-response)” pages in our docs.
Here is the code for the `handleFeedbackSubmit` function with comments:
<Col>
<CodeGroup title="handleFeedbackSubmit() function definition">
Now, you have to replace the IDs and the API host accordingly in your `handleFeedbackSubmit`:
<Col>
<CodeGroup title="Replace the ID and API accordingly">
```tsx
const payload = {
@@ -366,20 +431,24 @@ Now, you have to replace the IDs and the API host accordingly in your `handleFee
};
```
</CodeGroup>
</Col>
And lastly, in the `updateFeedback` function
<Col>
<CodeGroup title="Replace the ID and API here as well">
```tsx
try {
const res = await fetch(
// Note that we also updated the API host to 'https://app.formbricks.com/'
// Note that we also updated the API host to 'https://app.formbricks.com/'
`https:app.formbricks.com/api/v1/client/environments/clgwcwp4z000lpf0hur7uxbuv/responses/${responseId}`, // Note that we also updated the API host to 'https://app.formbricks.com/'
}
```
</CodeGroup>
</Col>
### You’re good to go! 🎉
Something doesn’t work? Check your browser console for the error.
Can’t figure it out? [Join our Discord!](https://formbricks.com/discord)
export default ({ children }) => <Layout meta={meta}>{children}</Layout>;
import { Layout } from "@/components/docs/Layout";
import { Fence } from "@/components/shared/Fence";
import { Callout } from "@/components/shared/Callout";
import DemoPreview from "@/components/dummyUI/DemoPreview";
import Image from "next/image";
import ActionCSS from "./action-css.png";
import ActionText from "./action-text.png";
import ChangeText from "./change-text.png";
import CreateSurvey from "./create-survey.png";
import Publish from "./publish.png";
import RecontactOptions from "./recontact-options.png";
import SelectAction from "./select-action.png";
import ActionCSS from "./action-css.webp";
import ActionText from "./action-text.webp";
import ChangeText from "./change-text.webp";
import CreateSurvey from "./create-survey.webp";
import Publish from "./publish.webp";
import RecontactOptions from "./recontact-options.webp";
import SelectAction from "./select-action.webp";
export const meta = {
title: "Feature Chaser",
description: "Follow up with users who used a specific feature. Gather feedback and improve your product.",
export const metadata = {
title: "Setting Up Feature Chaser Surveys with Formbricks: A Comprehensive Guide",
description: "Learn how to harness the power of Formbricks to gather targeted user feedback on specific features. Dive deep into creating, triggering, and publishing the Feature Chaser survey to enhance your product with actionable insights for specific users.",
};
#### Best Practices
# Feature Chaser
Following up on specific features only makes sense with very targeted surveys. Formbricks is built for that.
## Purpose
Product analytics never tell you why a feature is used - and why not. Following up on specfic features with highly relevant questions is a great way to gather feedback and improve your product.
Product analytics never tell you why a feature is used - and why not. Following up on specific features with highly relevant questions is a great way to gather feedback and improve your product.
## Preview
@@ -40,11 +41,11 @@ To run the Feature Chaser survey in your app you want to proceed as follows:
1. Create new Feature Chaser survey at [app.formbricks.com](http://app.formbricks.com/)
2. Setup a user action to display survey at the right point in time
We assume that you have already installed the Formbricks Widget in your web app. It’s required to display
messages and surveys in your app. If not, please follow the [Quick Start Guide (takes 15mins
max.)](/docs/getting-started/quickstart)
</Callout>
<Note>
## Formbricks Widget running?
We assume that you have already installed the Formbricks Widget in your web app. It’s required to display messages
and surveys in your app. If not, please follow the [Quick Start Guide (takes 15mins max.)](/docs/getting-started/quickstart-in-app-survey)
</Note>
### 1. Create new Feature Chaser
@@ -52,13 +53,23 @@ If you don't have an account yet, create one at [app.formbricks.com](https://app
Click on "Create Survey" and choose the template “Feature Chaser”:
<Image src={CreateSurvey} alt="Create survey by template" quality="100" className="rounded-lg" />
<Image
src={CreateSurvey}
alt="Create survey by template"
quality="100"
className="rounded-lg max-w-full sm:max-w-3xl"
/>
### 2. Update questions
The questions you want to ask are dependent on your feature and can be very specific. In the template, we suggest a high-level check on how easy it was for the user to achieve their goal. We also add an opportunity to provide context:
<Image src={ChangeText} alt="Change text content" quality="100" className="rounded-lg" />
<Image
src={ChangeText}
alt="Change text content"
quality="100"
className="rounded-lg max-w-full sm:max-w-3xl"
/>
Save, and move over to where the magic happens: The “Audience” tab.
@@ -72,35 +83,54 @@ There are two ways to track a button:
1. **Trigger by innerText:** You might have a button with a unique text at the end of your feature e.g. "Export Report". You can setup a user Action with the according `innerText` to trigger the survey, like so:
<Image src={ActionText} alt="Set the trigger by inner Text" quality="100" className="rounded-lg" />
<Image
src={ActionText}
alt="Set the trigger by inner Text"
quality="100"
className="rounded-lg max-w-full sm:max-w-3xl"
/>
2. **Trigger by CSS Selector:** In case you have more than one button saying “Export Report” in your app and only want to display the survey when one of them is clicked, you want to be more specific. The best way to do that is to give this button the HTML `id=“export-report-featurename”` and set your user action up like so:
<Image src={ActionCSS} alt="Set the trigger by CSS Selector" quality="100" className="rounded-lg" />
<Image
src={ActionCSS}
alt="Set the trigger by CSS Selector"
quality="100"
className="rounded-lg max-w-full sm:max-w-3xl"
/>
Please follow our [Actions manual](/docs/actions/why) for an in-depth description of how Actions work.
Lastly, scroll down to “Recontact Options”. Here you have full freedom to decide who you want to ask. Generally, you only want to ask every user once and prevent survey fatigue. It's up to you to decide if you want to ask again, when the user did not yet reply:
import { Layout } from "@/components/docs/Layout";
import { Fence } from "@/components/shared/Fence";
import Link from "next/link";
import Image from "next/image";
import { Callout } from "@/components/shared/Callout";
import DemoPreview from "@/components/dummyUI/DemoPreview";
import AddAction from "./add-action.png";
import AddCSSAction from "./add-css-action.png";
import AddHTMLAction from "./add-html-action.png";
import ChangeTextContent from "./change-text-content.png";
import CreateFeedbackBox from "./create-feedback-box-by-template.png";
import PublishSurvey from "./publish-survey.png";
import SelectAction from "./select-feedback-button-action.png";
import RecontactOptions from "./set-recontact-options.png";
import AddAction from "./add-action.webp";
import AddCSSAction from "./add-css-action.webp";
import AddHTMLAction from "./add-html-action.webp";
import ChangeTextContent from "./change-text-content.webp";
import CreateFeedbackBox from "./create-feedback-box-by-template.webp";
import PublishSurvey from "./publish-survey.webp";
import SelectAction from "./select-feedback-button-action.webp";
import RecontactOptions from "./set-recontact-options.webp";
export const meta = {
title: "Feedback Box",
description: "The Feedback Box gives your users a direct channel to share their feedback and feel heard.",
export const metadata = {
title: "Implementing the Feedback Box with Formbricks: A Step-by-Step Tutorial",
description: "Unlock user insights effortlessly! Discover how to set up the Feedback Box in your app using Formbricks, allowing your users to provide real-time feedback. Follow our comprehensive guide to enhance user experience and respond rapidly to feedback",
};
#### Best Practices
# Feedback Box
The Feedback Box gives your users a direct channel to share their feedback and feel heard.
## Purpose
@@ -48,58 +49,83 @@ If you don't have an account yet, create one at [app.formbricks.com](https://app
Then, create a new survey and look for the "Feedback Box" template:
<Image src={CreateFeedbackBox} alt="Create feedback box by template" quality="100" className="rounded-lg" />
<Image
src={CreateFeedbackBox}
alt="Create feedback box by template"
quality="100"
className="rounded-lg max-w-full sm:max-w-3xl"
/>
### 2. Update question content
Change the questions and answer options according to your preference:
<Image src={ChangeTextContent} alt="Change text content" quality="100" className="rounded-lg" />
<Image
src={ChangeTextContent}
alt="Change text content"
quality="100"
className="rounded-lg max-w-full sm:max-w-3xl"
/>
### 3. Create user action to trigger Feedback Box:
Go to the “Audience” tab, find the “When to send” card and choose “Add Action”. We will now use our super cool No-Code User Action Tracker:
<Callout title="You can also add actions in your code" type="note">
You can also create [Code Actions](/docs/actions/code) using `formbricks.track("Eventname")` - they will
automatically appear in your Actions overview as long as the SDK is embedded.
</Callout>
<Note>
## You can also add actions in your code
You can also create [Code Actions](/docs/actions/code) using `formbricks.track("Eventname")` - they will automatically
appear in your Actions overview as long as the SDK is embedded.
</Note>
We have two options to track the Feedback Button in your application: innerText and CSS-Selector:
1. **innerText:** This means that whenever a user clicks any HTML item in your app which has an `innerText` of `Feedback` the Feedback Box will be displayed.
2. **CSS-Selector:** This means that when an element with a specific CSS-Selector like `#feedback-button` is clicked, your Feedback Box is triggered.
Scroll down to “Recontact Options”. Here you have to choose the right settings so that the Feedback Box pops up every time the user action is performed. (Our default is that every user sees every survey only once):
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.