* 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>
* update LP with walk through
* update docs with attributes and events
* update team UI + form validation
* add walk through to app
* small fixes
---------
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
### New Formbricks Release: Complete Rewrite, New Features & Enhanced UI 🚀
We're thrilled to announce the release of the new Formbricks, a complete overhaul of our codebase, packed with powerful features and an improved user experience.
#### What's New:
1. **Survey Builder**: Design and customize your in-product micro-surveys with our intuitive survey builder.
2. **Trigger Micro-Surveys**: Set up micro-surveys to appear at specific points within your app, allowing you to gather feedback when it matters most.
3. **JavaScript SDK**: Our new JavaScript SDK makes integration a breeze - just embed it once and you're ready to go.
4. **No-Code Events**: Set up events and triggers without writing a single line of code, making it accessible for everyone on your team.
5. **Revamped UI**: Enjoy an entirely new user interface that enhances usability and provides a smooth, delightful experience.
This release marks a major step forward for Formbricks, enabling you to better understand your users and build an outstanding product experience.
Please update your Formbricks integration to take advantage of these exciting new features, and let us know in the Discord if you have any questions or feedback!
Happy surveying! 🎉
Indent code blocks and texts in enumeration appropriately to make auto-enumeration work.
Use auto-enumeration (aka 1. for every enum item) to be more robust with respect to changes.
* add onboarding survey after user signup
* add user flag finishedOnboarding to database and session
* fix submission capture endpoint to allow customer property update
---------
Co-authored-by: Johannes <72809645+jobenjada@users.noreply.github.com>
Co-authored-by: knugget <johannes@knugget.de>
* add enterprise license, add ee package
* migrate database from workspaces to organisations
* add payment api endpoints and billing pages
* add stripe env variables to .env.example
* add PMF results dashboard
* add PMF Segmentation View
* add PMF setup instructions
* Built new Filter Navigation that is also used in Feedback
Co-authored-by: knugget <johannes@knugget.de>
* make all env variables required at build time
* update env files
* add .env.docker file with basic docker configuration
* update Readme with new instructions
* fixes committed conflict in README
* adds a devcontainer based on compose
includes mailhog and postgres containers
* adds launch.json for nextjs vscode quick actions
* mentions devcontainer in the readme
* auto prisma migration after creating devcontainer
* remote containers as recommended vscode extension
* adds nextauth url env to dev container
- to show correct links in mails when testing locally
Co-authored-by: Niklas Paulsen <npau@informatik.uni-kiel.de>
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
* #41: Display message for unpublished forms
* #41: Add publish/unpublish GUI
* #41: Revamp UI and add 'closed' parameter
* change indigo color of access-switch to red
* update live-form on republish, show error message to user in frontend when form unpublished
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
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
- [ ] First PR at Formbricks? [Please sign the CLA!](https://formbricks.com/clmyhzfrymr4ko00hycsg1tvx) Without it we wont be able to merge it 🙏
### Appreciated
- [ ] If a UI change was made: Added a screen recording or screenshots to this PR
- [ ] Updated the Formbricks Docs if changes were necessary
Hey there and thank you for opening this pull request! 👋🏼
We require pull request titles to follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/) and it looks like your proposed title needs to be adjusted.
Details:
```
${{ steps.lint_pr_title.outputs.error_message }}
```
# Delete a previous comment when the issue has been resolved
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to make participation in Formbricks and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment include:
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
- The use of sexualized language or imagery and unwelcome sexual attention or advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic address, without explicit permission
- Other conduct that could reasonably be considered inappropriate in a professional setting
## Our Responsibilities
We as project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
We have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned with this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project email address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at hola@formbricks.com - all complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident.
## Enforcement Guidelines
Community managers will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series of actions.
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public of private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within the community.
## Attribution
This Code of Conduct is adapted from the Contributor Covenant, version 2.0, available at [https://www.contributor-covenant.org/version/2/0/code_of_conduct.html](https://www.contributor-covenant.org/version/2/0/code_of_conduct.html).
First and foremost, we're absolutely thrilled that you're considering becoming a part of the Formbricks Tribe! 🤗
Discover a myriad of ways to leave your mark on Formbricks — whether it's by squashing bugs, crafting new features, or enhancing our documentation.
## 🐛 Issue Hunters
Did you stumble upon a bug? Encountered a hiccup in deployment? Perhaps you have some user feedback to share? Your quickest route to help us out is by [raising an issue](https://github.com/formbricks/formbricks/issues/new/choose). We're on standby to respond swiftly.
## 💡 Feature Architects
Are you brimming with brilliant ideas? For new features that can elevate Formbricks, create an issue and slap on the "Enhancement" tag. We adore every concept that you throw our way. Just make sure to provide us with the "why" behind your idea. We're all ears!
## 🛠 Crafting Pull Requests
Ready to dive into the code and make a real impact? Here's your path:
1.**Read our Best Practices**: [It takes 5 minutes](https://formbricks.com/docs/contributing/how-we-code) but will help you save hours 🤓
1.**Fork the Repository:** Fork our repository or use [Gitpod](https://formbricks.com/docs/contributing/gitpod)
1.**Tweak and Transform:** Work your coding magic and apply your changes.
1.**Pull Request Act:** If you're ready to go, craft a new pull request closely following our PR template 🙏
Would you prefer a chat before you dive into a lot of work? Our [Discord server](https://formbricks.com/discord) is your harbor. Share your thoughts, and we'll meet you there with open arms. We're responsive and friendly, promise!
## 🚀 Aspiring Features
If you spot a feature that isn't part of our official plan but could propel Formbricks forward, don't hesitate. Raise it as an enhancement issue, and let us know you're ready to take the lead. We'll be quick to respond.
Together, let's craft the future of Formbricks, making it better, bolder, and more brilliant! 🚀🧱🌟
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/", "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.
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
@@ -58,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.
> :warning: **Note**: This repository is still in an early stage of development. We love the open source community and want to show what we are working on early. We will update this readme with more information once it is safe to use. Until then, feel free to share your thoughts, contact us, and contribute if you'd like.
Spin up forms in minutes. Pipe your data exactly where you need it. Maximize your results with juicy analytics.
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.
## What is snoopHub?
**Try it out in the cloud at [formbricks.com](https://formbricks.com)**
The snoopHub is the heart of snoopForms. In it, all form submissions are processed, analyzed, forwarded and you can even build your own forms with the help of the no-code editor.
## 💪 Mission: Make customer-centric decisions based on data.
If you prefer to build your forms completely customizable and send the submissions directly to snoopHub, check out our [React library](https://github.com/snoopForms/snoopforms-react).
Formbricks is a powerful tool for creating in-product micro-surveys - and leverage a significantly higher conversion rate. It allows you to gather valuable insights from your users, enabling you to make data-driven decisions that enhance your product's user experience. With Formbricks, you can create surveys with our no-code editor, choose from a variety of templates, target specific user groups, and much more.
### Table of Contents
- [Features](#features)
- [Getting Started](#getting-started)
- [Cloud Version](#cloud-version)
- [Self-hosted Version](#self-hosted-version)
- [Development](#development)
- [Contribution](#contribution)
- [Contact](#contact-us)
- [License](#license)
- [Security](#security)
<a id="features"></a>
### Features
-React Lib & No Code Builder to build & integrate forms rapidly.
-100% compliant with all privacy regulations (self-hosted).
-(next) Put your data to work with integrations.
-(next) Juicy analytics out of the box.
-(always) smooth Developer Experience comes first.
-📲 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 With
### 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/)
- 💻 [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/)
## Gettingstarted
<a id="getting-started"></a>
To get the project running locally on your machine you need to have the following development tools installed:
## 🚀 Getting started
- Node.JS (we recommend v16)
- Yarn
- PostgreSQL
We've got several options depending on your need to help you quickly get started with Formbricks.
1. Clone the project:
<a id="cloud-version"></a>
```
git clone https://github.com/snoopForms/snoopforms.git && cd snoopforms
```
### ☁️ Cloud Version
2. Install Node.JS packages via yarn. Don't have yarn? Use `npm install --global yarn`.
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).
```
yarn install
```
<a id="self-hosted-version"></a>
3. Make sure you have a running database instance, e.g. by using docker. A quick and dirty instance can be spun up via:
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).
4. Create a `.env` file based on `.env.example` and change it according to your setup. Make sure the `DATABASE_URL` variable is set correctly according to your local database. For the signup process, an email server with valid SMTP data is necessary.
If you opt for self-hosting Formbricks, here are a few options to consider:
```
cp .env.example .env
```
#### Docker
For the example above, use the following:
To get started with self-hosting with Docker, take a look at our [self-hosting docs](https://formbricks.com/docs/self-hosting/deployment).
5. Use the code editor of your choice to edit the .env file. You need to change all fields according to your setup. The SMTP-credentials are essential for verification emails to work during user signup.
##### Railway
6. Make sure your PostgreSQL Database Server is running. Then let prisma set up the database for you:
You can deploy Formbricks on [Railway](https://railway.app) using the button below.
```
yarn prisma migrate dev
```
[](https://railway.app/new/template/PPDzCd)
6. Start the development server:
<a id="development"></a>
```
yarn dev
```
### 👨💻 Development
**You can now access the app on [https://localhost:3000](https://localhost:3000)**. You will be automatically redirected to the login. To use your local installation of snoopForms, create a new account.
#### Prerequisites
## Deployment
Here is what you need to be able to run Formbricks:
The easiest way to deploy the snoopHub on your own machine is using Docker. This requires Docker and the docker compose plugin on your system to work.
- [Docker](https://www.docker.com/) - to run PostgreSQL and MailHog
Clone the repository:
#### Local Setup
```
To get started locally, we've got a [guide to help you](https://formbricks.com/docs/contributing/setup).
git clone https://github.com/snoopForms/snoopforms.git && cd snoopforms
#### Gitpod Setup
```
1. Click the button below to open this project in Gitpod.
Create a `.env` file based on `.env.example` and change all fields according to your setup. The SMTP-credentials are essential for verification emails to work during user signup.
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)
cp .env.example .env && nano .env
<a id="contribution"></a>
```
## ✍️ Contribution
Start the docker compose process to build and spin up the snoopForms container as well as the postgres database.
We are very happy if you are interested in contributing to Formbricks 🤗
```
Here are a few options:
docker compose up -d
- Star this repo.
- Create issues every time you feel something is missing or goes wrong.
- Upvote issues with 👍 reaction so we know what the demand for a particular issue is to prioritize it within the roadmap.
```
Please check out [our contribution guide](https://formbricks.com/docs/contributing/introduction) and our [list of open issues](https://github.com/formbricks/formbricks/issues) for more information.
You can now access the app on [https://localhost:3000](https://localhost:3000). You will be automatically redirected to the login. To use your local installation of snoopForms, create a new account.
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**.
<a id="contact-us"></a>
1. Fork the project
2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
3. Make your changes
4. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
5. Push to the branch (`git push origin feature/AmazingFeature`)
6. Open a pull request
## 📆 Contact us
## License
Let's have a chat about your survey needs and get you started.
Distributed under the AGPLv3 License. See `LICENSE` for more information.
<a href="https://cal.com/johannes/onboarding?utm_source=banner&utm_campaign=oss"><img alt="Book us with Cal.com" src="https://cal.com/book-with-cal-dark.svg" /></a>
<a id="license"></a>
## ⚖️ License
Distributed under the AGPLv3 License. See [`LICENSE`](./LICENSE) for more information.
<a id="security"></a>
## 🔒 Security
We take security very seriously. If you come across any security vulnerabilities, please disclose them by sending an email to security@formbricks.com. We appreciate your help in making our platform as secure as possible and are committed to working with you to resolve any issues quickly and efficiently. See [`SECURITY.md`](./SECURITY.md) for more information.
<p align="right"><a href="#top">🔼 Back to top</a></p>
This is Formbrick's security policy. Please reach out to us
on our Discord or, if privately, via <security@formbricks.com>
## 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.
Tailwind Labs Inc. grants you an on-going, non-exclusive license to use the Components and Templates.
The license grants permission to **one individual** (the Licensee) to access and use the Components and Templates.
You **can**:
- Use the Components and Templates to create unlimited End Products.
- Modify the Components and Templates to create derivative components and templates. Those components and templates are subject to this license.
- Use the Components and Templates to create unlimited End Products for unlimited Clients.
- Use the Components and Templates to create End Products where the End Product is sold to End Users.
- Use the Components and Templates to create End Products that are open source and freely available to End Users.
You **cannot**:
- Use the Components and Templates to create End Products that are designed to allow an End User to build their own End Products using the Components and Templates or derivatives of the Components and Templates.
- Re-distribute the Components and Templates or derivatives of the Components and Templates separately from an End Product, neither in code or as design assets.
- Share your access to the Components and Templates with any other individuals.
- Use the Components and Templates to produce anything that may be deemed by Tailwind Labs Inc, in their sole and absolute discretion, to be competitive or in conflict with the business of Tailwind Labs Inc.
### Example usage
Examples of usage **allowed** by the license:
- Creating a personal website by yourself.
- Creating a website or web application for a client that will be owned by that client.
- Creating a commercial SaaS application (like an invoicing app for example) where end users have to pay a fee to use the application.
- Creating a commercial self-hosted web application that is sold to end users for a one-time fee.
- Creating a web application where the primary purpose is clearly not to simply re-distribute the components (like a conference organization app that uses the components for its UI for example) that is free and open source, where the source code is publicly available.
Examples of usage **not allowed** by the license:
- Creating a repository of your favorite Tailwind UI components or templates (or derivatives based on Tailwind UI components or templates) and publishing it publicly.
- Creating a React or Vue version of Tailwind UI and making it available either for sale or for free.
- Create a Figma or Sketch UI kit based on the Tailwind UI component designs.
- Creating a "website builder" project where end users can build their own websites using components or templates included with or derived from Tailwind UI.
- Creating a theme, template, or project starter kit using the components or templates and making it available either for sale or for free.
- Creating an admin panel tool (like [Laravel Nova](https://nova.laravel.com/) or [ActiveAdmin](https://activeadmin.info/)) that is made available either for sale or for free.
In simple terms, use Tailwind UI for anything you like as long as it doesn't compete with Tailwind UI.
### Personal License Definitions
Licensee is the individual who has purchased a Personal License.
Components and Templates are the source code and design assets made available to the Licensee after purchasing a Tailwind UI license.
End Product is any artifact produced that incorporates the Components or Templates or derivatives of the Components or Templates.
End User is a user of an End Product.
Client is an individual or entity receiving custom professional services directly from the Licensee, produced specifically for that individual or entity. Customers of software-as-a-service products are not considered clients for the purpose of this document.
## Team License
Tailwind Labs Inc. grants you an on-going, non-exclusive license to use the Components and Templates.
The license grants permission for **up to 25 Employees and Contractors of the Licensee** to access and use the Components and Templates.
You **can**:
- Use the Components and Templates to create unlimited End Products.
- Modify the Components and Templates to create derivative components and templates. Those components and templates are subject to this license.
- Use the Components and Templates to create unlimited End Products for unlimited Clients.
- Use the Components and Templates to create End Products where the End Product is sold to End Users.
- Use the Components and Templates to create End Products that are open source and freely available to End Users.
You **cannot**:
- Use the Components or Templates to create End Products that are designed to allow an End User to build their own End Products using the Components or Templates or derivatives of the Components or Templates.
- Re-distribute the Components or Templates or derivatives of the Components or Templates separately from an End Product.
- Use the Components or Templates to create End Products that are the property of any individual or entity other than the Licensee or Clients of the Licensee.
- Use the Components or Templates to produce anything that may be deemed by Tailwind Labs Inc, in their sole and absolute discretion, to be competitive or in conflict with the business of Tailwind Labs Inc.
### Example usage
Examples of usage **allowed** by the license:
- Creating a website for your company.
- Creating a website or web application for a client that will be owned by that client.
- Creating a commercial SaaS application (like an invoicing app for example) where end users have to pay a fee to use the application.
- Creating a commercial self-hosted web application that is sold to end users for a one-time fee.
- Creating a web application where the primary purpose is clearly not to simply re-distribute the components or templates (like a conference organization app that uses the components or a template for its UI for example) that is free and open source, where the source code is publicly available.
Examples of use **not allowed** by the license:
- Creating a repository of your favorite Tailwind UI components or template (or derivatives based on Tailwind UI components or templates) and publishing it publicly.
- Creating a React or Vue version of Tailwind UI and making it available either for sale or for free.
- Creating a "website builder" project where end users can build their own websites using components or templates included with or derived from Tailwind UI.
- Creating a theme or template using the components or templates and making it available either for sale or for free.
- Creating an admin panel tool (like [Laravel Nova](https://nova.laravel.com/) or [ActiveAdmin](https://activeadmin.info/)) that is made available either for sale or for free.
- Creating any End Product that is not the sole property of either your company or a client of your company. For example your employees/contractors can't use your company Tailwind UI license to build their own websites or side projects.
### Team License Definitions
Licensee is the business entity who has purchased a Team License.
Components and Templates are the source code and design assets made available to the Licensee after purchasing a Tailwind UI license.
End Product is any artifact produced that incorporates the Components or Templates or derivatives of the Components or Templates.
End User is a user of an End Product.
Employee is a full-time or part-time employee of the Licensee.
Contractor is an individual or business entity contracted to perform services for the Licensee.
Client is an individual or entity receiving custom professional services directly from the Licensee, produced specifically for that individual or entity. Customers of software-as-a-service products are not considered clients for the purpose of this document.
## Enforcement
If you are found to be in violation of the license, access to your Tailwind UI account will be terminated, and a refund may be issued at our discretion. When license violation is blatant and malicious (such as intentionally redistributing the Components or Templates through private warez channels), no refund will be issued.
The copyright of the Components and Templates is owned by Tailwind Labs Inc. You are granted only the permissions described in this license; all other rights are reserved. Tailwind Labs Inc. reserves the right to pursue legal remedies for any unauthorized use of the Components or Templates outside the scope of this license.
## Liability
Tailwind Labs Inc.’s liability to you for costs, damages, or other losses arising from your use of the Components or Templates — including third-party claims against you — is limited to a refund of your license fee. Tailwind Labs Inc. may not be held liable for any consequential damages related to your use of the Components or Templates.
This Agreement is governed by the laws of the Province of Ontario and the applicable laws of Canada. Legal proceedings related to this Agreement may only be brought in the courts of Ontario. You agree to service of process at the e-mail address on your original order.
## Questions?
Unsure which license you need, or unsure if your use case is covered by our licenses?
Email us at [support@tailwindui.com](mailto:support@tailwindui.com) with your questions.
title: "Implementing Code Actions in Formbricks | Real-time User Action Tracking",
description:
"Dive into the world of Formbricks' code actions. Learn how to seamlessly integrate formbricks.track() method into your codebase, enabling real-time tracking of user actions like button clicks, visiting a specific URL. Up your survey game with precise and exact triggers.",
};
#### Actions
# Code Actions
Actions can also be set in the codebase to trigger surveys. Please add the code action first in the Formbricks web interface to be able to configure your surveys to use this action.
After that you can fire an action using `formbricks.track()`
<Col>
<CodeGroup title="Track an action">
```javascript
formbricks.track("Action Name");
```
</CodeGroup>
</Col>
Here is an example of how to fire an action when a user clicks a button:
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 metadata = {
title: "Formbricks Responses API Documentation - Manage Your Survey Data Seamlessly",
description:
"Unlock the full potential of Formbricks' Client Actions API. Create Actions right from the API.",
};
#### Client API
# Actions API
The Public Client API is designed for the JavaScript SDK and does not require authentication. It's primarily used for creating persons, sessions, and responses within the Formbricks platform. This API is ideal for client-side interactions, as it doesn't expose sensitive information.
This API can be used to:
- [Add Action for User](#add-action-for-user)
---
## Add Action for User {{ tag: 'POST', label: '/api/v1/client/<environment-id>/actions' }}
Adds an Actions for a given User by their User ID
<Row>
<Col>
### Mandatory Body Fields
<Properties>
<Property name="userId" type="string">
The id of the user for whom the action is being created.
import { Fence } from "@/components/shared/Fence";
export const metadata = {
title: "Formbricks Public Client API Guide: Manage Survey Displays & Responses",
description:
"Dive deep into Formbricks' Public Client API designed for customisation. This comprehensive guide provides detailed instructions on how to mark create and update survey displays for users.",
};
#### Client API
# Displays API
The Public Client API is designed for the JavaScript SDK and does not require authentication. It's primarily used for creating persons, sessions, and responses within the Formbricks platform. This API is ideal for client-side interactions, as it doesn't expose sensitive information.
title: "Formbricks API Overview: Public Client & Management API Breakdown",
description:
"Get a detailed understanding of Formbricks' dual API offerings: the unauthenticated Public Client API optimized for client-side tasks and the secured Management API for advanced account operations. Choose the perfect fit for your integration needs and ensure robust data handling",
};
#### API
# API Overview
Formbricks offers two types of APIs: the **Public Client API** and the **Management API**. Each API serves a different purpose, has different authentication requirements, and provides access to different data and settings.
Checkout the [API Key Setup](/docs/api/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 metadata = {
title: "Formbricks Responses API Documentation - Manage Your Survey Data Seamlessly",
description:
"Unlock the full potential of Formbricks' Responses API. From fetching to updating survey responses, our comprehensive guide helps you integrate and manage survey data efficiently without compromising security. Ideal for client-side interactions.",
};
#### Management API
# Responses API
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 metadata = {
title: "Formbricks People API: Fetch or Create Person Overview",
description:
"Dive into Formbricks' People API within the Public Client API suite, designed to work without authentication requirements. Seamlessly fetch or create a person by their userId and environmentId, optimizing client-side interactions while maintaining data privacy.",
};
#### Management API
# Action Classes API
This set of API can be used to
- [List Actions](#get-all-action-classes)
- [Get Action](#get-action-class-by-id)
- [Create Actions](#create-action-class)
- [Delete Actions](#delete-action-class)
<Note>You will need an API Key to interact with these APIs.</Note>
---
## Get all Action Classes {{ tag: 'GET', label: '/api/v1/management/action-classes' }}
<Row>
<Col>
Get all the existing action classes in your environment.
"This guide provides step-by-step instructions to generate, store, and delete API keys, ensuring safe and authenticated access to your Formbricks account.",
};
#### API
# API Key Setup
## Auth: Personal API key
The API requests are authorized with a personal API key. This API key gives you the same rights as if you were logged in at formbricks.com - **don't share it around!**
### How to generate an API key
1. Go to your settings on [app.formbricks.com](https://app.formbricks.com).
2. Go to page “API keys”
<Image src={AddApiKey} alt="Add API Key" quality="100" className="rounded-lg max-w-full sm:max-w-3xl" />
3. Create a key for the development or production environment.
4. Copy the key immediately. You won’t be able to see it again.
<Image
src={ApiKeySecret}
alt="API Key Secret"
quality="100"
className="rounded-lg max-w-full sm:max-w-3xl"
/>
<Note>
### Store API key safely
Anyone who has your API key has full control over your account.
For security reasons, you cannot view the API key again.
</Note>
### Test your API Key
Hit the below request to verify that you are authenticated with your API Key and the server is responding.
## Get My Profile {{ tag: 'GET', label: '/api/v1/me' }}
<Row>
<Col>
Get the product details and environment type of your account.
import { Fence } from "@/components/shared/Fence";
export const metadata = {
title: "Formbricks People API: Fetch or Create Person Overview",
description:
"Dive into Formbricks' People API within the Public Client API suite, designed to work without authentication requirements. Seamlessly fetch or create a person by their userId and environmentId, optimizing client-side interAttributes while maintaining data privacy.",
};
#### Management API
# Attribute Classes API
This set of API can be used to
- [List Attributes](#get-all-attribute-classes)
- [Get Attributes](#get-attribute-class-by-id)
- [Create Attributes](#create-attribute-class)
- [Delete Attributes](#delete-attribute-class)
<Note>You will need an API Key to interact with these APIs.</Note>
---
## Get all Attribute Classes {{ tag: 'GET', label: '/api/v1/management/attribute-classes' }}
<Row>
<Col>
Get all the existing attribute classes in your environment.
import { Fence } from "@/components/shared/Fence";
export const metadata = {
title: "Formbricks People API: Fetch or Create Person Overview",
description:
"Dive into Formbricks' People API within the Public Client API suite, designed to work without authentication requirements. Seamlessly fetch or create a person by their userId and environmentId, optimizing client-side interactions while maintaining data privacy.",
};
#### Management API
# Me API
This API can be used to get your own current environment details.
<Note>You will need an API Key to interact with these APIs.</Note>
---
## Get Environment {{ tag: 'GET', label: '/api/v1/management/me' }}
import { Fence } from "@/components/shared/Fence";
export const metadata = {
title: "Formbricks People API: Fetch or Create Person Overview",
description:
"Dive into Formbricks' People API within the Public Client API suite, designed to work without authentication requirements. Seamlessly fetch or create a person by their userId and environmentId, optimizing client-side interactions while maintaining data privacy.",
};
#### Management API
# People API
This set of API can be used to
- [List People](#list-people)
- [Get Person](#get-person)
- [Delete Person](#delete-person)
<Note>You will need an API Key to interact with these APIs.</Note>
---
## List People {{ tag: 'GET', label: '/api/v1/management/people' }}
import { Fence } from "@/components/shared/Fence";
export const metadata = {
title: "Formbricks Responses API Documentation - Manage Your Survey Data Seamlessly",
description:
"Unlock the full potential of Formbricks' Responses API. From fetching to updating survey responses, our comprehensive guide helps you integrate and manage survey data efficiently without compromising security. Ideal for client-side interactions.",
};
#### Management API
# Responses API
This set of API can be used to
- [List Responses](#list-all-responses)
- [Get Response](#get-response-by-id)
- [Delete Response](#delete-a-response)
<Note>You will need an API Key to interact with these APIs.</Note>
---
## List all Responses {{ tag: 'GET', label: '/api/v1/management/responses' }}
<Row>
<Col>
Retrieve all the responses you have received in your environment.
import { Fence } from "@/components/shared/Fence";
export const metadata = {
title: "Formbricks Surveys API Documentation - How to Retrieve All Surveys",
description:
"Explore the comprehensive guide to the Formbricks Surveys API. Learn how to effectively retrieve all the surveys in your environment with the necessary headers and API key setup. Includes sample request and response formats.",
};
#### Management API
# Surveys API
This set of API can be used to
- [List All Surveys](#list-all-surveys)
- [Get Survey](#get-survey-by-id)
- [Create Survey](#create-survey)
- [Delete Survey](#delete-survey-by-id)
<Note>You will need an API Key to interact with these APIs.</Note>
---
## List all surveys {{ tag: 'GET', label: '/api/v1/management/surveys' }}
<Row>
<Col>
Retrieve all the surveys you have for the environment.
"headline": "You are one of our power users! Do you have 5 minutes?",
"required": false,
"buttonLabel": "Happy to help!",
"logic": [
{
"condition": "skipped",
"destination": "end"
}
],
"html": "<p class=\"fb-editor-paragraph\" dir=\"ltr\"><span>We would love to understand your user experience better. Sharing your insight helps a lot!</span></p>",
"buttonExternal": false,
"dismissButtonLabel": "No, thanks."
},
{
"id": "kp62fbqe8cfzmvy8qwpr81b2",
"type": "multipleChoiceSingle",
"headline": "How disappointed would you be if you could no longer use My Product?",
"subheader": "Please select one of the following options:",
"required": true,
"choices": [
{
"id": "bdgy1hnwd7uwmfxk1ljqp1n5",
"label": "Not at all disappointed"
},
{
"id": "poabnvgtwenp8rb2v70gj4hj",
"label": "Somewhat disappointed"
},
{
"id": "opfiqyqz8wrqn0i0f7t24d3n",
"label": "Very disappointed"
}
],
"shuffleOption": "none"
},
{
"id": "klvpwd4x08x8quesihvw5l92",
"type": "multipleChoiceSingle",
"headline": "What is your role?",
"subheader": "Please select one of the following options:",
"required": true,
"choices": [
{
"id": "c8nerw6l9gpsxcmqkn10f9hy",
"label": "Founder"
},
{
"id": "ebjqezei6a2axtuq86cleetn",
"label": "Executive"
},
{
"id": "ctiijjblyhlp22snypfamqt1",
"label": "Product Manager"
},
{
"id": "ibalyr0mhemfkkr82vypmg40",
"label": "Product Owner"
},
{
"id": "fipk606aegslbd0e7yhc0xjx",
"label": "Software Engineer"
}
],
"shuffleOption": "none"
},
{
"id": "ryo75306flyg72iaeditbv51",
"type": "openText",
"headline": "What type of people do you think would most benefit from My Product?",
"required": true
},
{
"id": "lkjaxb73ulydzeumhd51sx9g",
"type": "openText",
"headline": "What is the main benefit you receive from My Product?",
"required": true
},
{
"id": "ec7agikkr58j8uonhioinkyk",
"type": "openText",
"headline": "How can we improve My Product for you?",
"subheader": "Please be as specific as possible.",
"required": true
}
],
"thankYouCard": {
"enabled": true,
"headline": "Thank you!",
"subheader": "We appreciate your feedback."
},
"delay": 0,
"autoComplete": null,
"closeOnDate": null
}
]
}
```
```json {{ title: '401 Not Authenticated' }}
{
"code": "not_authenticated",
"message": "Not authenticated",
"details": {
"x-Api-Key": "Header not provided or API Key invalid"
}
}
```
</CodeGroup>
</Col>
</Row>
---
## Get Survey by ID {{ tag: 'GET', label: '/api/v1/management/surveys/<survey-id>' }}
"headline": "Why did you cancel your subscription?",
"subheader": "We're sorry to see you leave. Help us do better:",
"required": true,
"logic": [
{
"condition": "equals",
"value": "Difficult to use",
"destination": "easier-to-use"
},
{
"condition": "equals",
"value": "It's too expensive",
"destination": "30-off"
},
{
"condition": "equals",
"value": "I am missing features",
"destination": "missing-features"
},
{
"condition": "equals",
"value": "Poor customer service",
"destination": "poor-service"
},
{
"condition": "equals",
"value": "I just didn't need it anymore",
"destination": "end"
}
],
"choices": [
{
"id": "isud2xethsw63dlwl89kr4kj",
"label": "Difficult to use"
},
{
"id": "opuu4ba3dlele3n0gjkuh27c",
"label": "It's too expensive"
},
{
"id": "gnypapo0rhvkt8pwosrphvbl",
"label": "I am missing features"
},
{
"id": "wkgsrsrazd9kfunqhzjezx6t",
"label": "Poor customer service"
},
{
"id": "pykmgyyw74vg0gaeryj6bo4c",
"label": "I just didn't need it anymore"
}
]
},
{
"id": "easier-to-use",
"type": "openText",
"headline": "What would have made {{productName}} easier to use?",
"subheader": "",
"required": true,
"buttonLabel": "Send",
"logic": [
{
"condition": "submitted",
"destination": "end"
}
]
},
{
"id": "30-off",
"type": "cta",
"headline": "Get 30% off for the next year!",
"required": true,
"buttonLabel": "Get 30% off",
"logic": [
{
"condition": "clicked",
"destination": "end"
}
],
"html": "<p class=\"fb-editor-paragraph\" dir=\"ltr\"><span>We'd love to keep you as a customer. Happy to offer a 30% discount for the next year.</span></p>",
"buttonUrl": "https://formbricks.com",
"buttonExternal": true,
"dismissButtonLabel": "Skip"
},
{
"id": "missing-features",
"type": "openText",
"headline": "What features are you missing?",
"subheader": "",
"required": true,
"logic": [
{
"condition": "submitted",
"destination": "end"
}
]
},
{
"id": "poor-service",
"type": "cta",
"headline": "So sorry to hear 😔 Talk to our CEO directly!",
"required": true,
"buttonLabel": "Send email to CEO",
"logic": [
{
"condition": "clicked",
"destination": "end"
}
],
"html": "<p class=\"fb-editor-paragraph\" dir=\"ltr\"><span>We aim to provide the best possible customer service. Please email our CEO and she will personally handle your issue.</span></p>",
"buttonUrl": "mailto:ceo@company.com",
"buttonExternal": true,
"dismissButtonLabel": "Skip"
}
],
"thankYouCard": {
"enabled": false
},
"delay": 0,
"autoComplete": null,
"closeOnDate": null,
"surveyClosedMessage": null,
"verifyEmail": null
}
}
```
```json {{ title: '401 Not Authenticated' }}
{
"code": "not_authenticated",
"message": "Not authenticated",
"details": {
"x-Api-Key": "Header not provided or API Key invalid"
"headline": "Why did you cancel your subscription?",
"subheader": "We're sorry to see you leave. Help us do better:",
"required": true,
"logic": [
{
"condition": "equals",
"value": "Difficult to use",
"destination": "easier-to-use"
},
{
"condition": "equals",
"value": "It's too expensive",
"destination": "30-off"
},
{
"condition": "equals",
"value": "I am missing features",
"destination": "missing-features"
},
{
"condition": "equals",
"value": "Poor customer service",
"destination": "poor-service"
},
{
"condition": "equals",
"value": "I just didn't need it anymore",
"destination": "end"
}
],
"choices": [
{
"id": "isud2xethsw63dlwl89kr4kj",
"label": "Difficult to use"
},
{
"id": "opuu4ba3dlele3n0gjkuh27c",
"label": "It's too expensive"
},
{
"id": "gnypapo0rhvkt8pwosrphvbl",
"label": "I am missing features"
},
{
"id": "wkgsrsrazd9kfunqhzjezx6t",
"label": "Poor customer service"
},
{
"id": "pykmgyyw74vg0gaeryj6bo4c",
"label": "I just didn't need it anymore"
}
]
},
{
"id": "easier-to-use",
"type": "openText",
"headline": "What would have made {{productName}} easier to use?",
"subheader": "",
"required": true,
"buttonLabel": "Send",
"logic": [
{
"condition": "submitted",
"destination": "end"
}
]
},
{
"id": "30-off",
"type": "cta",
"headline": "Get 30% off for the next year!",
"required": true,
"buttonLabel": "Get 30% off",
"logic": [
{
"condition": "clicked",
"destination": "end"
}
],
"html": "<p class=\"fb-editor-paragraph\" dir=\"ltr\"><span>We'd love to keep you as a customer. Happy to offer a 30% discount for the next year.</span></p>",
"buttonUrl": "https://formbricks.com",
"buttonExternal": true,
"dismissButtonLabel": "Skip"
},
{
"id": "missing-features",
"type": "openText",
"headline": "What features are you missing?",
"subheader": "",
"required": true,
"logic": [
{
"condition": "submitted",
"destination": "end"
}
]
},
{
"id": "poor-service",
"type": "cta",
"headline": "So sorry to hear 😔 Talk to our CEO directly!",
"required": true,
"buttonLabel": "Send email to CEO",
"logic": [
{
"condition": "clicked",
"destination": "end"
}
],
"html": "<p class=\"fb-editor-paragraph\" dir=\"ltr\"><span>We aim to provide the best possible customer service. Please email our CEO and she will personally handle your issue.</span></p>",
"buttonUrl": "mailto:ceo@company.com",
"buttonExternal": true,
"dismissButtonLabel": "Skip"
}
],
"thankYouCard": {
"enabled": false
},
"delay": 0,
"autoComplete": null,
"closeOnDate": null,
"surveyClosedMessage": null,
"verifyEmail": null
}
}
```
```json {{ title: '401 Not Authenticated' }}
{
"code": "not_authenticated",
"message": "Not authenticated",
"details": {
"x-Api-Key": "Header not provided or API Key invalid"
title: "Formbricks Webhook API Documentation - List, Retrieve, Create, and Delete Webhooks",
description:
"Explore the comprehensive guide to the Formbricks Webhooks API. This is all you need to interact and play with the Formbricks Webhooks and integrate them into any third party app of your choice",
};
#### Management API
# Webhook API
Formbricks' Webhook API offers a powerful interface for interacting with webhooks. Webhooks allow you to receive real-time HTTP notifications of changes to specific objects in the Formbricks environment.
The behavior of the webhooks is determined by their trigger settings. The trigger determines which updates the webhook sends. Current available triggers include "responseCreated", "responseUpdated", and "responseFinished". This allows you to customize your webhooks to only send notifications for the events that are relevant to your application.
Webhooks are tied to a specific Formbricks environment. Once set, a webhook will receive updates from all surveys within this environment. This makes it easy to manage your data flow and ensure that all relevant updates are caught by the webhook.
This set of API can be used to
- [List All Webhooks](#list-webhooks)
- [Get Webhook](#retrieve-webhook-by-id)
- [Create Webhook](#create-webhook)
- [Delete Webhook](#delete-webhook-by-id)
And the detailed Webhook Payload is elaborated [here](#webhook-payload).
These APIs are designed to facilitate seamless integration of Formbricks with third-party systems. By making use of our webhook API, you can automate the process of sending data to these systems whenever significant events occur within your Formbricks environment.
<Note>You will need an API Key to interact with these APIs.</Note>
---
## List Webhooks {{ tag: 'GET', label: '/api/v1/webhooks' }}
<Row>
<Col>
Learn how to retrieve a list of all webhooks via API.
| event | String | The name of the trigger event [responseCreated, responseUpdated, responseFinished] |
| data | Object | Contains the details of the newly created response. |
| data.id | String | Formbricks Response ID. |
| data.createdAt | String | The timestamp when the response was created. |
| data.updatedAt | String | The timestamp when the response was last updated. |
| data.surveyId | String | The identifier of the survey associated with this response. |
| data.finished | Boolean | A boolean value indicating whether the survey response is marked as finished. |
| data.data | Object | An object containing the response data, where keys are question identifiers, and values are the corresponding answers given by the respondent. |
| data.meta | Object | Additional metadata related to the response, such as the user's operating system and browser information. |
| data.personAttributes | Object | An object with attributes related to the respondent, such as their email and a user ID (if available). |
| data.person | Object | Information about the respondent, including their unique id, attributes, and creation/update timestamps. |
| data.notes | Array | An array of notes associated with the response (if any). |
| data.tags | Array | An array of tags assigned to the response (if any). |
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
You can use the setAttribute function to set any custom attribute for the user (e.g. name, plan, etc.):
<Col>
<CodeGroup title="Setting Plan to Pro">
```javascript
formbricks.setAttribute("Plan", "Pro");
```
</CodeGroup>
</Col>
Generally speaking, the setAttribute function works like this:
title: "User Identification in Formbricks | Enhancing Survey Feedback",
description:
"A comprehensive guide on identifying users in Formbricks without compromising privacy. Learn how to set User ID, email, and custom attributes to optimize survey targeting, recontact users, and control survey intervals, all while respecting user anonymity.",
};
#### Attributes
# Identifying Users
At Formbricks, we value user privacy. By default, Formbricks doesn't collect or store any personal information from your users. However, we understand that it can be helpful for you to know which user submitted the feedback and also functionality like recontacting users and controlling the waiting period between surveys requires identifying the users. That's why we provide a way for you to share existing user data from your app, so you can view it in our dashboard.
If you would like to use the User Identification feature of Formbricks, target surveys to specific user segments and see more information about the user who responded to a survey, you can identify users by setting a User ID, email, and custom attributes. This guide will walk you through how to do that.
## Setting User ID
To enable the User identification feature you need to set the `userId` in the init() call of Formbricks. Only when the `userId` is set the person will be visible in the Formbricks dashboard. The `userId` can be any string and it's best to use the default identifier you use in your app (e.g. unique id from database or the email address if it's unique) but you can also anonymize these as long as they are unique for every user.
<Col>
<CodeGroup title="Setting User ID">
```javascript
formbricks.init({
environmentId: "<environment-id>",
apiHost: "<api-host>",
userId: "<user_id>",
});
```
</CodeGroup>
</Col>
## Setting User Email
The `userId` is the main identifier used in Formbricks and user identification is only enabled when it is set. In addition to the userId you can also set attributes that describes the user better. The email address can be set using the setEmail function:
<Col>
<CodeGroup title="Setting Email">
```javascript
formbricks.setEmail("user@example.com");
```
</CodeGroup>
</Col>
### Setting Custom User Attributes
You can use the setAttribute function to set any custom attribute for the user (e.g. name, plan, etc.):
<Col>
<CodeGroup title="Setting Custom Attributes">
```javascript
formbricks.setAttribute("Plan", "free");
```
</CodeGroup>
</Col>
### Logging Out Users
When a user logs out of your webpage, make sure to log them out of Formbricks as well. This will prevent new activity from being associated with an incorrect user. Use the logout function:
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?
Attributes are key-value pairs that you can set for each person individually. For example, the attribute "Plan" can be set to "Free" or "Paid".
## How do attributes work?
Attributes are sent from your application to Formbricks and are associated with the current user. We store it in our database and allow you to use it the next time you create a survey.
## 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".
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 your 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.
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.