* 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>
* feat: poc
* merge: individual docker-compose files
* fix: nits
* feat: postgres now only accessible internally
* feat: emoji time
* cleanup: my commented commands
* better emoji and warning on domain name
* fix: better handling of docker check
* feat: follow principle of least privilege and remove excess sudo in commands
* feat: read machine name dynamically
* feat: documentation for prod script
* feat: remove custom networks in the docker compose
* cleanup: comments in script
* update emojis to fix spacing
* attempt: new groyp
* attemp: move new group command at end for the ability to parse vars
* feat: it all works without sudo yay
* feat: cleanup docs as suggested
* documentation: self hosting for prod script
---------
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
* added validation to survey edit
* made refactors
* extracted validation rules into a single object and resolved draggable issue
* ran pnpm format
* fixed a validation bug
* fixed similar validation bug in other component
* implemented default and specific validation
* made some code refactors
* handled case where a question is deleted
* instead of storing questionIdx now we are storing question id in invalidQuestions array && ran pnpm format
* removed unused comment
* run pnpm format
* made requested changes
* removed unused export
* add types to validation.ts
* run pnpm format
---------
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
* url add to link-survey
* fixed
* fixed
* fixed
* fixed
* ran pnpm format
* make url optional in response input to not break existing integrations
---------
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
* feat: adds enhanced bug report github page and removes md version of it
* feat: adds enhanced feature request .yml github page and removes .md version of it
* refactor: makes the Desktop field as md editor on Bug Report Github Page
* refactor: converts the Environment field as checkbox on Bug Report Github Page
* Fix email notifications not working properly
* Fix response notification not working
* fix response meta schema
* fix typo in docs
* improve error message in webhooks
* feat: server rendering of event actions summary page & server actions
* chore: renaming event to action and minor refactoring
* fix: logging message
* delete: unnecessary file
* feat: migrate attributes overview page
* feat: impl grouped page & layout, logically differentiate attributes and actions
* pnpm format
* fix: logical addressing of dirs and minot bugs
* move: actionsAndAttributes navbar to dedicated dir from components
* fix: use server-only build-time checks and move actionsAttributes navbar
* revert: unnecessary docker compose changes
* resolve merge conflicts dynamically
* fix: address feedback comments
* use sparkles icon from heroicons
* fix updated action not updating in table
* remove async from client function due to warning
* move router.refresh in AddNoActionModal
* small rename
* feat: replace swr w server action in ActionSettingsTab
* replace custom error with ResourceNotFoundError error class
---------
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
* create people and survey on team create
* create people and responses / displays
* drafting GPT input
* add attributeClass, eventClass and people
* fix link in person detail page
* fix email instead of uid
* added two surveys
* add events, 3 more surveys
---------
Co-authored-by: Johannes <johannes@formbricks.com>
* feat: github action to build and push to dockerhub on release
* feat: docker repo and quickstart readmne
* fix: check for NEXTAUTH_SECRET in dockerfile before running
* fix: check for NEXTAUTH_SECRET as null or not
* add deployment guide
---------
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
* added metadata template
* created layout file in [survedId]
* changed Link to <a> for complete reload of individual survey
* added prop types for generateMetadata
* added page titles for sub pages
* Replaced survey title with Your Surveys
* fix layout metadata not working with latest changes to getAnalysisData()
* run pnpm format
* add new analysis folder for common layout
* fix conflicts
* add metadata to integrations page
---------
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
* feat: added a option to set ordering of choices
* changed the parameter for random ordering and used Switch instead of Select
* added logic for shuffle
* added shuffleOption in zod schema and fixed some copy.
* run pnpm format
* make shuffleOption optional in zod to prevent errors in existing data
* made fixes as asked in peer review and ran pnpm format
* minor bug fixes
* Update env.mjs
* fix shuffleArray to not shuffle reference object
* update shuffle method
---------
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
* Fix issue 427
* Address review comment
* jump back to top on long questions
* add to JS widget
---------
Co-authored-by: Seram Nitesh Singh <nitesh.s@auzmor.com>
Co-authored-by: Johannes <johannes@formbricks.com>
* add first part of sync service
* add actionClasses to js sync
* fix errors, add product to sync
* rewrite formbricks-js for new states and types
* fix tests
* fix build errors
* add cors
* fix cors errors and other bugs
* comment test in checks until working again
* feat: added surveyClosedMessage field to database and also added it's types
* feat: added the custom closed message to the frontend
* fix: fixes build issue
* fix: refactored the code to toggle surveyClosedMessage and redirectUrl
* pnpm format
* recreate prisma migration
---------
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
* add expiresAt prop to members call
* add expired badge in addition to pending in members list
* check for expired on invite link
* fix type error
* update invite expired message
* remove console.log
---------
Co-authored-by: Johannes <johannes@formbricks.com>
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
* add isDraft=true to all new questions and remove it on save
* update button to show on draft questions
* re-add input validation
---------
Co-authored-by: Johannes <johannes@formbricks.com>
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
* created new create-display and updated display endpoints with zod, db service-layer, and next.js route handlers
* changed the api URL and changed few type definations
* new getTeamDetails service is created which will be further used by display and response endpoints
* changed the prisma call with getTeamDetails service
* created display services and zod validation schema
* removed envId from func parameter
* fix build error by adding a type annotation
* Moved the return inside try block
* Removed comments
* changed the update display service name to markDisplayResponded
* Update route.ts
* reference person type in display, check response code first then transform to json
* add createdAt & updatedAt to person when query display
* pnpm format
* small optimizations
---------
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
* Added Notification API
* Added Email functionality to the weekly
notification
* Added no live survey email notification
* Activating weeklySummary notification alertSwitch
* Adding check to include only surveys which
have weeklySummary enabled
* Updated the condition for weekSummary
notification check
* update UI
* Update to reduce number of database calls
* Updated the email subject when no survey in weeklysummary
* applied pnpm format
* update notification settings with new types and fix functionality
* loop through all products to send weekly summary email, colocate files
* fix build errors
* add more types
* add vercel.json for cron configuration
* remove console.logs, limit responses to 5 per survey
* update email subject
* improve how responses are displayed in summary email
* update email layout
* add cron to github action instead of vercel
* add github action
* add beta flag
---------
Co-authored-by: Johannes <johannes@formbricks.com>
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
* feat: person overview is now a server rendered page
* feat: loader component & fix: minor changes as suggested
* hide: session count
* getAttributeValue always returns string
* fix: remove createdAt & updatedAt fields from user for now
* fix: use select instead of include to specify retreival fields
* feat: suspense streaming
* feat: skeleton table for streaming and loading
* fix: use integrated loading and cleanup components
---------
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
* enable consent summary
* fix type error
* fix Consent Summary to use dismissed instead of skipped and move to Server Component
* change Skipped to Dismissed in UI
---------
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
* only add packages once to their main package and remove them from other packages to avoid version conflicts
* update package versions
* update package versions, clean packages
* remove old vscode settings
* exclude formbricks-com from pnpm dev
* narrow down tsconfig includes, pnpm-lock update
* add pnpm test to github action
* fix: adds animation on duplicate tag
* fix: fixes error data flow
* fix: fixes tag getting animated on all errors
* fix: changes icon to heroicons
* fix: fixes error being thrown when adding duplicate tag
* fix: fixes responses not getting refetched
* init: jest for formbricks/js
* test: formbricks init
* test: formbricks set attributes
* test: formbricks updated attributes
* test: formbricks track, refresh, route change
* test: formbricks logout
* chore: use strict checking & replace let w const
* chore: destructure variables
* feat: test coverage visibility
* updated: pnpm lock file
* feat: tests now use a mock API
* fix: mock actual formbricks survey response and not empty placeholders
* rename: unit test for clarity
* chore: destructure setting attributes into individual tests
* feat: mock console logger for cleaner cli during tests
* add top level test script for turbo
* update babel config to fix errors in formbricks-js build
---------
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
* add placement enum and prop to db scheme
* enable placement toggle in setttings
* enable in-app survey placement demo
* add position helper function
* add placement to in-app-modal preview
* add placement prop to api endpoint
* add placement to widget
* remove coming soon
* add styling
* add apply tailwind styles instead of a ts function
* add clickoutside and darkoverlay prop
* add darkOverlay and clickOutside form
* update js package tailwind apply classes
* add background to widget and close on click outside
* only show backdrop and clickOutside if is center
* only display background when modal is centered
* responsive changes in js widget
* add updated migration, move styles from global.css to function
---------
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
* use new services for server-side data retrieval in survey responses & summary
* fix build errors
* add notes to response schema
* add response notes
* fix type conflicts
* add tag functionality
* run pnpm format
* fix tag state not updating correctly
* fat: added prisma model for Tag
* feat: adds api route for tags
* fat: added prisma model for Tag
* feat: adds mutation hook for creating a tag
* feat: adds apis for creating and retrieving tags
* feat: adds sample UI for creating and retrieving tags
* feat: adds UI components for Combobox
* feat: adds api router for fetching all tags for a product
* feat: adds combobox and api for appending tag to a response
* feat: adds api call for removing a tag from a response
* fix: relaced normal post with swr mutations
* fix: mutations for adding and deleting tags
* feat: integrated the create and delete tags apis and combobox
* fix: fixes api routes and db queries for tags apis
* fix: fixes api routes and headers
* feat: adds tag delete functionality
* feat: adds update tag api and UI
* feat: adds tags count api and integration
* feat: inital UI for tags table
* fix: UI for autosave name component
* fix: fixes api response
* fix: fixes errors on merge tags
* fat: added prisma model for Tag
* fix: replaces lodash.debounce with lodash
* fix: fixes capital letter tags not getting added
* fix: changed tag table to relate to environment
* fix: migrated tag apis from product to environment
* fix: formatting with prettier
* fix: fixes tags interface in single response
* fix: fixes UI bugs
* fix: fixes text on no tags
* fix: deleted local migrations
* fix: synced migrations with main
* fix: fixes combobox bugs
* fix: fixes placeholder
* update migrations
* fix build issues
* fix tag adding functionality
---------
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
* Add exit intent and scroll depth automatic actions
* Remove lorem ipsum text
* Modified event listeners to not get called if survey is already running
* Add trackEvent inside event listeners
* Remove lorem ipsum
* Move event listeners to init
* Fix exit intent listener
* Modify event listeners to get called everytime and change exit intent text
* Add missed files
* Move events to separate file and add name check
* Add name check
* Fix build error
* fix: remove environmentsNavbar on survey editor
* objects deep comparision utility function
* feat: confirm on window reload or close
* feat: confirm save on back
* feat: custom alert dialog
* remove radixui alert dialog
* replaced shadcn alert with new custom alert dialog
* fix: save button varient to darkCTA
* fix: moved beforeunload logic to surveymenubar
* fix: remove deepequal function
* installed lodash
* fix: survey not comparing on change
* fix: isqual import
* feat: added current person attributes to the user response
* feat: added tooltip showing user attributes in response view
* fix: switched to using the service layer and added annotations for json field
* rename PersonAttributesData to ResponsePersonAttributes to fit current naming scheme
---------
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
* Add env variable to check for team invite
* Check for only public invite env for invite
* Disable Add Member and block the invite API
* Change the invite disabled condition
* Update the condition for env variable
---------
Co-authored-by: Seram Nitesh Singh <nitesh.s@auzmor.com>
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
* feat: add deletes account button on profile section.
* feat: add delete account action when user click on delete account button
* feat:logout user when his account is deleted
* feat: added warning message before user deletes account
* feat: add description to Delete account
section
* fix: fix: build issue.
* fix: avoid giving the ownership of a team to a member who is not an admin
* fix: merge conflict
* fix: use !== in delete button disabled prop
* fix: typo semething -> Something
* refactor: simplified user deletion logic
* refactor: explain user deletion logic
* refactor: remove unecessary delete membership queries
* feat: add deletes account button on profile section.
* feat: add delete account action when user click on delete account button
* feat:logout user when his account is deleted
* feat: added warning message before user deletes account
* fix merge conlicts
* update to delete info text
* feat: delete the team if the owner deletes his account and the team has no admins
* add await
* Add method to check if user is admin or owner
* Add method to enable role based member invites
* Add Select Control element to UI to handle role based invite
* Add flag to allow add member feature for owner or admin level users only
* Fix error with role select element
* Add UI view to modify membership
* Add RoleElement component to handle the Role display
* Integrate api for Updating Accepted Member Role
* Integrate api for Updating Invitee's Role
* Resolve PR comments and merge conflicts
* add new zod schema for responses
* add new client endpoints for responses
* add services for responses and surveys
* add new responses model to webhooks & email
---------
Co-authored-by: Johannes <johannes@formbricks.com>
* remove debug loglevel from formbricks usage;
* remove license fields from internal packages
* improve package descriptions, add logger message for survey delay
* include formbricks api into formbricks js
* make formbricks errors package private
* update formbricks-js dependencies to include formbricks-api
* update formbricks-js to 0.1.20
* auto focus on sign up
* update PR template
* add updatedAt date to survey summary
* add animation to Progress, make timer smoother
* change button size in question card, auto focus
* add transition to js widget, fix auto focus in editor
---------
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
* use label instead of id in onboarding analysis, add logout to formbricks usage
* add await option for all sdk commands, fix logout bug in formbricks usage
* add @formbricks/api (api abstraction layer) and @formbricks/errors package to monorepo
* use @formbricks/api in @formbricks/js to expose an api endpoint
---------
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
* add moveQuestion function to handle index changes
* add dropdown arrows to context menu, disable on first / last element and call moveQuestion function
* fix: build error StartIcon typing
* fix: endIcon type for button
* Add new env variable NEXT_PUBLIC_WEBAPP_URL that is used server-side for the current address
* Move Next-Auth to App-Directory
* Move Membership-API & User-API to App-Directory
* Update env-examples with new structure
* add new onboarding for new and existing Formbricks users
* Add new personalized template view
---------
Co-authored-by: Johannes <johannes@formbricks.com>
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
* add team switch when user has multiple teams
* fix hydration error by changing the way env variables load
---------
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
* feat: add modal to add new product to current team
* feat: add create product endpoint and helper function
* feat: display available products in dropdown and include environmentId in request
* new icon
---------
Co-authored-by: moritzrengert <moritz@rengert.de>
description:"Suggest an idea for this project \U0001F680"
title:"[FEATURE]"
labels:enhancement
assignees:[]
body:
- 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 🤓
- 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)
<!-- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. -->
Fixes # (issue)
<!-- Please provide a screenshots or a loom video for visual changes to speed up reviews
Loom Video: https://www.loom.com/
-->
## Type of change
<!-- Please mark the relevant points by using [x] -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change adds a new database migration
- [ ] This change requires a documentation update
## How should this be tested?
<!-- Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration -->
- Test A
- Test B
## Checklist
<!-- 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 -->
### Required
- [ ] Filled out the "How to test" section in this PR
- [ ] 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`
- [ ] Checked for warnings, there are none
- [ ] 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
### 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
Copyright (c) 2023 Matthias Nannt, Johannes Dancker
Copyright (c) 2023 Formbricks GmbH
Portions of this software are licensed as follows:
- All content that resides under the "packages/ee/" directory of this repository, if that directory exists, is licensed under the license defined in "packages/ee/LICENSE".
- All content that resides under the "packages/js/" directory of this repository, if that directory exists, is licensed under the "MIT" license as defined in "packages/js/LICENSE".
- All content that resides under the "packages/js/", "packages/errors/" and "packages/api/" directories of this repository, if that directories exist, is licensed under the "MIT" license as defined in the "LICENSE" files of these packages.
- All third party components incorporated into the Formbricks Software are licensed under the original license provided by the owner of the applicable component.
- Content outside of the above mentioned directories or restrictions above is available under the "AGPLv3" license as defined below.
@@ -67,7 +67,7 @@ modification follow.
TERMS AND CONDITIONS
0. Definitions.
1. Definitions.
"This License" refers to version 3 of the GNU Affero General Public License.
> :octocat: Are you looking for snoopForms - the Open Source Typeform Alternative? We're building the next stage of the snoopForms evolution here with Formbricks - focused on experience management for fast growing companies. If you still are looking for the code of snoopForms you can find it in the [snoopforms branch](https://github.com/formbricks/formbricks/tree/snoopforms).
To celebrate Hacktoberfest, we've launched our FormTribe hackathon. Write code or perform non-code side quests to collect points and increase your chances of winning the MacBook Air M2!
Formbricks productizes best practices for qualitative in-app user discovery. Use micro-surveys to target the right users at the right time without making surveys annoying.
**Join lottery with a [single tweet!](https://formtribe.com). All info on [formtribe.com](https://formtribe.com)**
### Mission: Base your decisions on qualitative data.
## ✨ About Formbricks
Formbricks helps you apply best practices from data-driven work and experience management to make better business decisions. Use Formbricks to collect and manage insights from your users; run a product market fit survey to know which audience to focus on and whether your value proposition is being recognized.
Formbricks is your go-to solution for in-product micro-surveys that will supercharge your product experience. Use micro-surveys to target the right users at the right time without making surveys annoying.
- [Typescript](https://www.typescriptlang.org/)
- [Next.js](https://nextjs.org/)
- [React](https://reactjs.org/)
- [TailwindCSS](https://tailwindcss.com/)
- [Prisma](https://prisma.io/)
**Try it out in the cloud at [formbricks.com](https://formbricks.com)**
## Cloud vs. self-hosted
## 💪 Mission: Make customer-centric decisions based on data.
Formbricks is available Open-Source under AGPLv3 license. You can host Formbricks on your own servers without a subscription. Check out our [docs](https://formbricks.com/docs/formbricks-hq/self-hosting) to see how to self-host Formbricks.
We will soon offer a cloud version of Formbricks which saves you the hassle of maintaining your own servers. We will update this Readme once the cloud version is available.
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.
(In the future we may develop additional features that aren't in the free Open-Source version)
### Features
- 📲 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
- 💻 [Typescript](https://www.typescriptlang.org/)
- 🚀 [Next.js](https://nextjs.org/)
- ⚛️ [React](https://reactjs.org/)
- 🎨 [TailwindCSS](https://tailwindcss.com/)
- 📚 [Prisma](https://prisma.io/)
- 🔒 [Auth.js](https://authjs.dev/)
- 🧘♂️ [Zod](https://zod.dev/)
## 🚀 Getting started
We've got several options depending on your need to help you quickly get started with Formbricks.
### ☁️ 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).
### 🐳 Self-hosted version
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).
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)
### 👨💻 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)
## ✍️ Contribution
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 a particular issue 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>
## ⚖️ License
Distributed under the AGPLv3 License. See `LICENSE` for more information.
## 🔒 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.
This is Formbrick's security policy. Please reach out to us
on our Discord or, if privately, via <security@formbricks.com>
## Introduction
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.
## I. Third-Party Data Usage Policy
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:
- 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.
## II. Annual Penetration Testing (Pentest)
To understand and bolster our security stature, Formbricks undertakes:
- 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.
## 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.
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
## Getting Started
First, run the development server:
```bash
npm run dev
# or
yarn dev
# or
pnpm dev
```
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file.
[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`.
The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.
This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.
## Learn More
To learn more about Next.js, take a look at the following resources:
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
## Deploy on Vercel
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
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.
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
## Getting Started
First, run the development server:
```bash
npm run dev
# or
yarn dev
```
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file.
[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`.
The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.
## Learn More
To learn more about Next.js, take a look at the following resources:
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
## Deploy on Vercel
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
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 specfic URL. Up your survey game with precise and exact triggers.",
};
#### Actions
# Code Actions
Actions can also be set in the code base. 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:
title: "Implementing No-Code Actions in Formbricks | Real-time User Action Tracking",
description:
"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
The page URL action is triggered, when a user visits a specific page in your application. There are several match conditions:
- `exactMatch`: The URL should exactly match the provided string.
- `contains`: The URL should contain the specified string as a substring.
- `startsWith`: The URL should start with the specified string.
- `endsWith`: The URL should end with the specified string.
- `notMatch`: The URL should not match the specified condition.
- `notContains`: The URL should not contain the specified string as a substring.
## innerText Action
The innerText action checks if the `innerText` of a clicked HTML element matches a specific text, e.g. the label of a button. Display a survey on any button click!
## 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!
title: "Using Actions in Formbricks | Fine-tuning User Moments",
description:
"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?
Actions are a little notification sent from your application to Formbricks. You decide which actions are sent either in your [Code](/docs/actions/code) or by setting up a [No-Code](/docs/actions/no-code) action within Formbricks.
## How do actions work?
When a predefined action happens in your app, the Formbricks widget notices. This action can then trigger a survey to be shown to the user and is stored in the database.
## 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.
import { Fence } from "@/components/shared/Fence";
export const meta = {
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 surveys as displayed as well as responded for individual persons, ensuring seamless client-side interactions without compromising data security.",
};
#### Client API
# Displays API
The Public Client API is designed for the JavaScript SDK and does not require authentication. It's primarily used for creating persons, sessions, and responses within the Formbricks platform. This API is ideal for client-side interactions, as it doesn't expose sensitive information.
This set of API can be used to
- [Mark Survey as Displayed](#mark-survey-as-displayed-for-person)
- [Mark Survey as Responded](#mark-survey-as-responded-for-person)
---
## Mark Survey as Displayed for Person {{ tag: 'POST', label: '/api/v1/client/diplays' }}
<Row>
<Col>
Mark a Survey as seen for a Person provided valid SurveyId and PersonId.
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/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/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 meta = {
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
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.
---
## Create a response {{ tag: 'POST', label: '/api/v1/client/responses' }}
Add a new response to a survey.
<Row>
<Col>
### Mandatory Body Fields
<Properties>
<Property name="surveyId" type="string">
The id of the survey the response belongs to.
</Property>
<Property name="finished" type="boolean">
Marks whether the response is complete or not.
</Property>
<Property name="data" type="string">
The data of the response as JSON object (key: questionId, value: answer).
</Property>
</Properties>
### Optional Body Fields
<Properties>
<Property name="personId" type="string" required>
Internal Formbricks id to identify the user sending the response
| 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. |
| personId | 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 meta = {
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 meta = {
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 meta = {
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 meta = {
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 meta = {
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 meta = {
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)
- [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 your 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 Paylod 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",
title: "Guide for Setting Custom Attributes | Formbricks Documentation",
description:
"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:
import { Layout } from "@/components/docs/Layout";
export const meta = {
title: "Identifying Users",
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.
Once the Formbricks widget is loaded on your web app, our SDK exposes methods for identifying user attributes. Let's set it up!
@@ -11,33 +15,48 @@ Once the Formbricks widget is loaded on your web app, our SDK exposes methods fo
## Setting User ID
You can use the `setUserId` function to identify a user with any string. It's best to use the default identifier you use in your app (e.g. unique id from database) but you can also anonymize these as long as they are unique for every user. This function can be called multiple times with the same value safely and stores the identifier in local storage. We recommend you set the User ID whenever the user logs in to your website, as well as after the installation snippet (if the user is already logged in).
<Col>
<CodeGroup title="Setting User ID">
```javascript
formbricks.setUserId("USER_ID");
```
</CodeGroup>
</Col>
## Setting User Email
You can use the setEmail function to set the user's email:
<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.):
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:
<Col>
<CodeGroup title="Logging out User">
```javascript
formbricks.logout();
```
export default ({ children }) => <Layout meta={meta}>{children}</Layout>;
import { Layout } from "@/components/docs/Layout";
export const meta = {
title: "What are attributes and why are they useful?",
title: "Understanding User Attributes in Formbricks Surveys",
description:
"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?
@@ -17,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!
## Preview
<DemoPreview template="Churn Survey" />
## Formbricks Approach
- Ask at exactly the right point in time
- Follow-up to prevent bad reviews
- Coming soon: Make survey mandatory
## Overview
To run the Churn Survey in your app you want to proceed as follows:
1. Create new Churn Survey at [app.formbricks.com](http://app.formbricks.com/)
2. Set up the user action to display survey at right point in time
3. Choose correct recontact options to never miss a feedback
4. Prevent that churn!
<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
If you don't have an account yet, create one at [app.formbricks.com](https://app.formbricks.com/auth/signup)
Click on "Create Survey" and choose the template “Churn Survey”:
<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 max-w-full sm:max-w-3xl"
/>
_Want to change the button color? You can do so in the product settings._
Save, and move over to the “Audience” tab.
### 3. Pre-segment your audience
In this case, you don’t really need to pre-segment your audience. You likely want to ask everyone who hits the “Cancel subscription” button.
### 4. Set up a trigger
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 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 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 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.
<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
the survey before letting them cancel 🤷
</Note>
### 5. Select Action in the “When to ask” card
<Image
src={SelectAction}
alt="Select feedback button action"
quality="100"
className="rounded-lg max-w-full sm:max-w-3xl"
/>
### 6. Last step: Set Recontact Options correctly
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:
<Image
src={RecontactOptions}
alt="Set recontact options"
quality="100"
className="rounded-lg max-w-full sm:max-w-3xl"
/>
These settings make sure the survey is always displayed, when a user wants to Cancel their subscription.
### 7. Congrats! You’re ready to publish your survey 💃
<Image
src={PublishSurvey}
alt="Publish survey"
quality="100"
className="rounded-lg max-w-full sm:max-w-3xl"
/>
<Note>
## Formbricks Widget running?
You need to have the Formbricks Widget installed to display the Churn Survey in your app. Please follow [this
tutorial (Step 4 onwards)](/docs/getting-started/quickstart-in-app-survey) to install the widget.
import DocsFeedback from "@/components/docs/DocsFeedback";
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:
"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
Unlike yourself, your users don't spend 5-7 days per week thinking about your product. To fight the "Curse of Knowledge" you have to measure how clear your docs are.
## Preview
<DocsFeedback />
## Installation
To get this running, you'll need a bit of time. Here are the steps we're going through:
1. Set up Formbricks Cloud
2. Build the frontend
3. Connect to API
4. Test
### 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="max-w-full rounded-lg sm:max-w-3xl"
/>
3. Then, create a survey using the template “Docs Feedback”:
<Image
src={DocsTemplate}
alt="select docs template"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
/>
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="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”**.
<Note>
## Answers need to be identical 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.
</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="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:
<Image
src={AddAction}
alt="add action"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
className="rounded"
/>
8. Select the Non-Event in the dropdown. Now you see that the “Publish survey” button is active. Publish your survey 🤝
<Image
src={SelectNonevent}
alt="select nonevent"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
/>
**You’re all setup in Formbricks Cloud for now 👍**
### 2. Build the frontend
<Note>
## Your frontend might work differently Your frontend likely looks and works differently. This is an example
specific to our tech stack. We want to illustrate what you should consider building yours 😊
</Note>
Before we start, lets talk about the widget. It works like this:
- Once the user selects yes/no, a partial response is sent to the Formbricks API. It includes the feedback and the current page url.
- Then the user is presented with an additional open text field to further explain their choice. Once it's submitted, the previous response is updated with the additional feedback.
This allows us to capture and analyze partial feedback where the user is not willing to provide additional information.
**Let's do this 👇**
1. Open the code editor where you handle your docs page.
2. Likely, you have a template file or similar which renders the navigation at the bottom of the page:
<Image
src={DocsNavi}
alt="doc navigation"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
className="rounded"
/>
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 } from "@formbricks/ui/Popover";
{!sharedFeedback ? ( // displays Feedback buttons or Thank You message
<div>
Was this page helpful?
<Popover open={isOpen} onOpenChange={setIsOpen}>
<div className="ml-4 inline-flex space-x-3">
{["Yes 👍", " No 👎"].map((option) => ( // Popup Trigger is a button as well. This is a workaround to open the same form but send a different response to the API
const id = await handleFeedbackSubmit(option, router.asPath); // handleFeedbackSubmit sends the Yes / No choice as well as the current URL to Formbricks and returns the responseId
setResponseId(id); // add responseId to local state so we can use it if user decides to add more feedback in free text field
}}>
{option} // "Yes 👍" or "No 👎" - they have to be identical with the choices in the survey on app.formbricks.com for it to work (!)
e.preventDefault(); // prevent page from reloading (default HTML behaviour)
updateFeedback(freeText, responseId); // update initial Yes / No response with free text feedback
setIsOpen(false); // close Popover
setFreeText(""); // remove feedback from free text field local state
setSharedFeedback(true); // display Thank You message
}}>
Send
</Button>
</div>
</form>
</PopoverContent>
</Popover>
</div>
) : (
<div>Thanks a lot, boss! 🤝</div> // Thank You message
)}
</div>
);
}
```
</CodeGroup>
</Col>
## 3. Connecting to the Formbricks API
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.
Here is the code for the `handleFeedbackSubmit` function with comments:
<Col>
<CodeGroup title="handleFeedbackSubmit() function definition">
isHelpful: YesNo, // the "Yes 👍" or "No 👎" response. Remember: They have to be identical with the choices in the survey on app.formbricks.com for it to work.
pageUrl: pageUrl, // So you know which page the user gives feedback about.
},
};
const payload = {
response: response_data,
surveyId: process.env.NEXT_PUBLIC_FORMBRICKS_COM_DOCS_FEEDBACK_SURVEY_ID, // For testing, replace this with the survey ID of your survey (more info below)
};
try {
const res = await fetch(
`${process.env.NEXT_PUBLIC_FORMBRICKS_COM_API_HOST}/api/v1/client/environments/${process.env.NEXT_PUBLIC_FORMBRICKS_COM_ENVIRONMENT_ID}/responses`, // For testing, replace this with the API host and environemnt ID of your Development environment on app.formbricks.com
};
{
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(payload),
}
);
if (res.ok) {
const responseJson = await res.json();
return responseJson.id; // Returns the response ID
} else {
console.error("Error submitting form");
}
} catch (error) {
console.error("Error submitting form:", error);
}
};
```
</CodeGroup>
</Col>
And this is the `updateFeedback` function with comments:
<Col>
<CodeGroup title="updateFeedback() function definition">
<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/'
`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)
import DemoPreview from "@/components/dummyUI/DemoPreview";
import Image from "next/image";
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: "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.
## Preview
<DemoPreview template="Feature Chaser" />
## Formbricks Approach
- Trigger survey at exactly the right point in the user journey
- Never ask twice, keep your data clean
- Prevent survey fatigue with global waiting period
## Overview
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
<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
If you don't have an account yet, create one at [app.formbricks.com](https://app.formbricks.com/auth/signup)
Click on "Create Survey" and choose the template “Feature Chaser”:
<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 max-w-full sm:max-w-3xl"
/>
Save, and move over to where the magic happens: The “Audience” tab.
### 3. Set up a trigger for the Feature Chaser survey:
Before setting the right trigger, you need to identify a user action in your app which signals, that they have just used the feature you want to understand better. In most cases, it is clicking a specific button in your product.
You can create [Code Actions](/docs/actions/code) and [No Code Actions](/docs/actions/no-code) to follow users through your app. In this example, we will create a No Code Action.
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 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 max-w-full sm:max-w-3xl"
/>
Please follow our [Actions manual](/docs/actions/why) for an in-depth description of how Actions work.
### 4. Select Action in the “When to ask” card
<Image
src={SelectAction}
alt="Select PMF trigger button action"
quality="100"
className="rounded-lg max-w-full sm:max-w-3xl"
/>
### 5. Last step: Set Recontact Options correctly
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:
<Image
src={RecontactOptions}
alt="Set recontact options"
quality="100"
className="rounded-lg max-w-full sm:max-w-3xl"
/>
### 7. Congrats! You’re ready to publish your survey 💃
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.