Compare commits

..

51 Commits

Author SHA1 Message Date
Johannes
38d21be5fa remove SurveyBg and PreviewSurveyDesktop 2023-11-27 13:30:57 +01:00
Neil Chauhan
5c47bd00d7 fix: merge conflict issue 2023-11-23 15:31:51 +05:30
Neil Chauhan
6091413d82 chore: refactor surveyBg and previewDesktopSurveyBg code into a single component 2023-11-23 15:06:47 +05:30
Anjy Gupta
d8e1e103ee Merge branch 'main' into surveyBg 2023-11-23 13:05:42 +05:30
Anjy Gupta
a063f920be Merge branch 'main' into surveyBg 2023-11-21 14:19:43 +05:30
Johannes
ab4c8838f9 Merge branch 'main' into surveyBg 2023-11-20 11:38:05 +01:00
Johannes
7d2fffbdab Merge main again 2023-11-19 16:34:22 +01:00
Johannes
b14d4e4235 Merge main 2023-11-19 16:33:24 +01:00
Johannes
52659b14ac Merge branch 'main' of github.com:formbricks/formbricks into surveyBg 2023-11-19 16:28:43 +01:00
Johannes
cbe610aa90 remove shadow from card 2023-11-19 16:27:23 +01:00
Johannes
d4a302fb20 refactor survey bg tabs 2023-11-19 14:18:56 +01:00
Johannes
28a33ee818 Merge branch 'main' into surveyBg 2023-11-19 14:00:10 +01:00
Johannes
870ba09abe fix merge conflicts 2023-11-19 13:58:39 +01:00
Johannes
39b11f9dba Merge branch 'main' of github.com:formbricks/formbricks into surveyBg 2023-11-19 13:56:00 +01:00
Anjy Gupta
71cfd31b7a Merge branch 'main' into surveyBg 2023-11-19 13:40:06 +05:30
Anjy Gupta
b47eeb4673 Update constants.ts 2023-11-17 01:47:48 +05:30
Anjy Gupta
708bfd8810 Merge branch 'main' into surveyBg 2023-11-17 01:46:46 +05:30
Anjy Gupta
e6e41b81a3 fix: tweaks 2023-11-15 19:21:02 +00:00
Anjy Gupta
e7d8a675c9 Merge branch 'main' into surveyBg 2023-11-15 19:05:21 +00:00
Johannes
12e4cc110c remove black bars 2023-11-15 10:29:44 +01:00
anjy7
fa7f7c497c fix: ux tweaks 2023-11-14 17:19:31 +05:30
anjy7
4066fbf7d6 fix: image bg file upload 2023-11-14 16:54:46 +05:30
Anjy Gupta
16245fe355 Merge branch 'main' into surveyBg 2023-11-14 14:19:53 +05:30
anjy7
057d2ec446 fix: tweaks 2023-11-14 02:33:41 +05:30
Anjy Gupta
9f80ed6ec2 fix: tweaks in ui 2023-11-13 20:29:12 +00:00
Anjy Gupta
90b0734cd2 fix: made ui changes 2023-11-13 20:02:05 +00:00
Anjy Gupta
6711543cdf fix: fixed overlay 2023-11-13 17:27:18 +00:00
Anjy Gupta
862e72ca8f Merge branch 'formbricks:main' into surveyBg 2023-11-13 20:40:14 +05:30
Anjy Gupta
14c249cbde Merge branch 'main' into surveyBg 2023-11-11 01:05:38 +05:30
Anjy Gupta
1bded4cce1 Merge branch 'main' into surveyBg 2023-11-09 15:07:05 +05:30
Anjy Gupta
bbc6dfbc97 Merge branch 'main' into surveyBg 2023-11-08 15:22:48 +05:30
Anjy Gupta
351ade6448 fix: made requested changes 2023-11-07 17:27:12 +00:00
Johannes
a530017c3b Merge branch 'main' into surveyBg 2023-11-07 09:49:35 +01:00
Anjy Gupta
0479c34be9 Merge branch 'main' into surveyBg 2023-11-04 00:01:27 +05:30
Anjy Gupta
e0e5ca93b6 Merge branch 'main' into surveyBg 2023-11-01 12:06:22 +05:30
Anjy Gupta
c80dde1ba1 Merge branch 'main' into surveyBg 2023-10-31 20:39:18 +05:30
anjy7
c9ba9e8e1b fix: fixed box overflow and width 2023-10-31 20:38:51 +05:30
Johannes
fd5284025f Merge branch 'main' into surveyBg 2023-10-30 21:45:20 +00:00
anjy7
2213adb24a fix: added overlay 2023-10-31 01:34:09 +05:30
Anjy Gupta
8d028cdf45 Merge branch 'main' into surveyBg 2023-10-30 23:03:58 +05:30
Anjy Gupta
e705fcf763 Merge branch 'main' into surveyBg 2023-10-30 21:30:09 +05:30
anjy7
7f65b41b59 fix: removed unnecessary changes 2023-10-30 19:17:42 +05:30
anjy7
0809055247 fix: added props interface to new components 2023-10-30 19:12:07 +05:30
anjy7
8546ce918c fix: added id to file input 2023-10-30 19:03:01 +05:30
anjy7
3cf1e7ad3b fix: added zod validation 2023-10-30 19:00:05 +05:30
anjy7
c7e2e08026 fix: made changes 2023-10-30 19:00:05 +05:30
Anjy Gupta
f39b15790b Merge branch 'main' into surveyBg 2023-10-30 18:44:41 +05:30
Anjy Gupta
aa9142b3c0 Merge branch 'main' into surveyBg 2023-10-30 14:33:40 +05:30
anjy7
ca634cd798 fix: added components 2023-10-30 14:30:10 +05:30
anjy7
f8518fcd80 fix: added animation 2023-10-29 20:24:27 +05:30
anjy7
2e2ad05367 feat: added change background feature 2023-10-29 12:34:40 +05:30
823 changed files with 11237 additions and 17163 deletions

View File

@@ -1,5 +1,5 @@
# [Choice] Node.js version (use -bullseye variants on local arm64/Apple Silicon): 18, 16, 14, 18-bullseye, 16-bullseye, 14-bullseye, 18-buster, 16-buster, 14-buster
ARG VARIANT=20
ARG VARIANT=18-bullseye
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT}
# [Optional] Uncomment this section to install additional OS packages.
@@ -13,4 +13,4 @@ FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT}
# [Optional] Uncomment if you want to install more global node modules
# RUN su node -c "npm install -g <your-package-list-here>"
RUN su node -c "npm install -g pnpm"
RUN su node -c "npm install -g pnpm"

View File

@@ -2,27 +2,29 @@
// https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/javascript-node-postgres
// Update the VARIANT arg in docker-compose.yml to pick a Node.js version
{
"name": "Node.js & PostgreSQL",
"dockerComposeFile": "docker-compose.yml",
"service": "app",
"workspaceFolder": "/workspace",
"name": "Node.js & PostgreSQL",
"dockerComposeFile": "docker-compose.yml",
"service": "app",
"workspaceFolder": "/workspace",
// Configure tool-specific properties.
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
// Add the IDs of extensions you want installed when the container is created.
"extensions": ["dbaeumer.vscode-eslint"]
}
},
// Configure tool-specific properties.
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"dbaeumer.vscode-eslint"
]
}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// This can be used to network with other containers or with the host.
"forwardPorts": [3000, 5432, 8025],
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// This can be used to network with other containers or with the host.
"forwardPorts": [3000, 5432, 8025],
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "cp .env.example .env && sed -i '/^ENCRYPTION_KEY=/c\\ENCRYPTION_KEY='$(openssl rand -hex 32) .env && sed -i '/^NEXTAUTH_SECRET=/c\\NEXTAUTH_SECRET='$(openssl rand -hex 32) .env && pnpm install && pnpm db:migrate:dev",
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "pnpm install",
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "node"
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "node"
}

View File

@@ -6,10 +6,10 @@ services:
context: .
dockerfile: Dockerfile
args:
# Update 'VARIANT' to pick an LTS version of Node.js: 20, 18, 16, 14.
# Update 'VARIANT' to pick an LTS version of Node.js: 18, 16, 14.
# Append -bullseye or -buster to pin to an OS version.
# Use -bullseye variants on local arm64/Apple Silicon.
VARIANT: "20"
VARIANT: "18"
volumes:
- ..:/workspace:cached
@@ -33,7 +33,7 @@ services:
environment:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
POSTGRES_DB: formbricks
POSTGRES_DB: postgres
# Add "forwardPorts": ["5432"] to **devcontainer.json** to forward PostgreSQL locally.
# (Adding the "ports" property to this file will not forward from a Codespace.)

View File

@@ -64,10 +64,10 @@ SMTP_PASSWORD=smtpPassword
#####################
# Email Verification. If you enable Email Verification you have to setup SMTP-Settings, too.
EMAIL_VERIFICATION_DISABLED=1
# EMAIL_VERIFICATION_DISABLED=1
# Password Reset. If you enable Password Reset functionality you have to setup SMTP-Settings, too.
PASSWORD_RESET_DISABLED=1
# PASSWORD_RESET_DISABLED=1
# Signup. Disable the ability for new users to create an account.
# SIGNUP_DISABLED=1
@@ -99,6 +99,7 @@ AZUREAD_AUTH_ENABLED=0
AZUREAD_CLIENT_ID=
AZUREAD_CLIENT_SECRET=
AZUREAD_TENANT_ID=
AZURE_DIRECT_REDIRECT=0
# Cron Secret
CRON_SECRET=
@@ -106,10 +107,6 @@ CRON_SECRET=
# Configure this when you want to ship JS & CSS files from a complete URL instead of the current domain
# ASSET_PREFIX_URL=
# Oauth credentials for Notion Integration
NOTION_OAUTH_CLIENT_ID=
NOTION_OAUTH_CLIENT_SECRET=
# Stripe Billing Variables
STRIPE_SECRET_KEY=
STRIPE_WEBHOOK_SECRET=
@@ -130,13 +127,4 @@ AIRTABLE_CLIENT_ID=
# Enterprise License Key
ENTERPRISE_LICENSE_KEY=
# Automatically assign new users to a specific team and role within that team
# Insert an existing team id or generate a valid CUID for a new one at https://www.getuniqueid.com/cuid (e.g. cjld2cjxh0000qzrmn831i7rn)
# (Role Management is an Enterprise feature)
# DEFAULT_TEAM_ID=
# DEFAULT_TEAM_ROLE=admin
# set to 1 to skip onboarding for new users
# ONBOARDING_DISABLED=1
*/

View File

@@ -4,8 +4,8 @@ on:
# "Scheduled workflows run on the latest commit on the default or base branch."
# — https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows#schedule
schedule:
# This will run the job at 22:00 UTC every day of every month.
- cron: "0 22 * * *"
# This will run the job at 23:00 UTC every day of every month.
- cron: "0 21 * * *"
jobs:
cron-reportUsageToStripe:
env:
@@ -19,5 +19,4 @@ jobs:
curl ${{ env.APP_URL }}/api/cron/report-usage \
-X POST \
-H 'x-api-key: ${{ env.CRON_SECRET }}' \
-H 'Cache-Control: no-cache' \
--fail

View File

@@ -25,7 +25,7 @@ jobs:
- name: create .env
run: cp .env.example .env
- name: Generate Random ENCRYPTION_KEY
- name: Generate Random NEXTAUTH_SECRET
run: |
SECRET=$(openssl rand -hex 32)
echo "ENCRYPTION_KEY=$SECRET" >> $GITHUB_ENV

View File

@@ -1,40 +0,0 @@
name: E2E Tests
on:
workflow_call:
jobs:
build:
name: Run E2E Tests
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
- name: Install Docker Compose
run: sudo apt-get update && sudo apt-get install -y docker-compose
- name: Install dependencies
run: npm install -g pnpm && pnpm install
- name: Build Formricks JS package
run: pnpm build --filter=js
- name: Build Formbricks Image & Run
run: docker-compose up -d
- name: Install Playwright Browsers
run: pnpm exec playwright install --with-deps
- name: Run Playwright tests
run: pnpm test:e2e
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30

View File

@@ -27,13 +27,8 @@ jobs:
uses: ./.github/workflows/build-web.yml
secrets: inherit
e2e-test:
name: Run E2E Tests
uses: ./.github/workflows/playwright.yml
secrets: inherit
required:
needs: [lint, test, build, e2e-test]
needs: [lint, test, build]
if: always()
runs-on: ubuntu-latest
steps:

View File

@@ -6,7 +6,6 @@ name: Docker
# documentation.
on:
workflow_dispatch:
push:
tags:
- "v*"
@@ -16,9 +15,6 @@ env:
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
DATABASE_URL: "postgresql://postgres:postgres@localhost:5432/formbricks?schema=public"
jobs:
build:
@@ -31,16 +27,6 @@ jobs:
id-token: write
steps:
- name: Generate Random NEXTAUTH_SECRET
run: |
SECRET=$(openssl rand -hex 32)
echo "NEXTAUTH_SECRET=$SECRET" >> $GITHUB_ENV
- name: Generate Random ENCRYPTION_KEY
run: |
SECRET=$(openssl rand -hex 32)
echo "ENCRYPTION_KEY=$SECRET" >> $GITHUB_ENV
- name: Checkout repository
uses: actions/checkout@v3
@@ -52,22 +38,17 @@ jobs:
with:
cosign-release: "v2.1.1"
# Add support for more platforms with QEMU (optional)
# https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
# Set up BuildKit Docker container builder to be able to build
# multi-platform images and export cache
# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3 # v3.0.0
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v3 # v3.0.0
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
@@ -77,7 +58,7 @@ jobs:
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5 # v5.0.0
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
@@ -85,11 +66,10 @@ jobs:
# https://github.com/docker/build-push-action
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v5 # v5.0.0
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
with:
context: .
file: ./apps/web/Dockerfile
# platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

View File

@@ -29,11 +29,6 @@ jobs:
- name: create .env
run: cp .env.example .env
- name: Generate Random ENCRYPTION_KEY
run: |
SECRET=$(openssl rand -hex 32)
echo "ENCRYPTION_KEY=$SECRET" >> $GITHUB_ENV
- name: Build formbricks-js dependencies
run: pnpm build --filter=js

8
.gitignore vendored
View File

@@ -44,10 +44,4 @@ packages/database/zod
# nixos stuff
.direnv
Zone.Identifier
# Playwright
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
Zone.Identifier

View File

@@ -1,6 +1 @@
const baseConfig = require("./packages/prettier-config/prettier-preset");
module.exports = {
...baseConfig,
plugins: ["@trivago/prettier-plugin-sort-imports", "prettier-plugin-tailwindcss"],
};
module.exports = require("./packages/prettier-config/prettier-preset");

132
README.md
View File

@@ -1,128 +1,100 @@
<div id="top"></div>
<div id="top"></div>
<p align="center">
<a href="https://formbricks.com">
<img width="120" alt="Open Source Experience Management Solution Qualtrics Alternative Logo" src="https://github.com/formbricks/formbricks/assets/72809645/0086704f-bee7-4d38-9cc8-fa42ee59e004">
</a>
<h3 align="center">Formbricks</h3>
<p align="center">
<a href="https://formbricks.com">
<img width="120" alt="Open Source Privacy First Experience Management Solution Qualtrics Alternative Logo" src="https://github.com/formbricks/formbricks/assets/72809645/0086704f-bee7-4d38-9cc8-fa42ee59e004">
</a>
<h3 align="center">Formbricks</h3>
<p align="center">
Harvest user-insights, build irresistible experiences.
<br />
<a href="https://formbricks.com/">Website</a> | <a href="https://formbricks.com/discord">Join Discord community</a>
</p>
<p align="center">
The Open Source Survey Toolbox
<br />
<a href="https://formbricks.com/">Website</a> | <a href="https://formbricks.com/discord">Join Discord community</a>
</p>
</p>
<p align="center">
<a href="https://github.com/formbricks/formbricks/blob/main/LICENSE"><img src="https://img.shields.io/badge/License-AGPL-purple" alt="License"></a> <a href="https://formbricks.com/discord"><img src="https://img.shields.io/discord/979077669410979880?label=Discord&logo=discord&logoColor=%23fff" alt="Join Formbricks Discord"></a> <a href="https://github.com/formbricks/formbricks/stargazers"><img src="https://img.shields.io/github/stars/formbricks/formbricks?logo=github" alt="Github Stars"></a>
<a href="https://news.ycombinator.com/item?id=32303986"><img src="https://img.shields.io/badge/Hacker%20News-122-%23FF6600" alt="Hacker News"></a>
<a href="[https://www.producthunt.com/products/formbricks](https://www.producthunt.com/posts/formbricks)"><img src="https://img.shields.io/badge/Product%20Hunt-455-orange?logo=producthunt&logoColor=%23fff" alt="Product Hunt"></a>
<a href="https://github.blog/2023-04-12-github-accelerator-our-first-cohort-and-whats-next/"><img src="https://img.shields.io/badge/2023-blue?logo=github&label=Github%20Accelerator" alt="Github Accelerator"></a>
<a href="https://github.com/formbricks/formbricks/issues?q=is:issue+is:open+label:%22%F0%9F%99%8B%F0%9F%8F%BB%E2%80%8D%E2%99%82%EF%B8%8Fhelp+wanted%22"><img src="https://img.shields.io/badge/Help%20Wanted-Contribute-blue"></a>
<p align="center">
<a href="https://github.com/formbricks/formbricks/blob/main/LICENSE"><img src="https://img.shields.io/badge/License-AGPL-purple" alt="License"></a> <a href="https://formbricks.com/discord"><img src="https://img.shields.io/discord/979077669410979880?label=Discord&logo=discord&logoColor=%23fff" alt="Join Formbricks Discord"></a> <a href="https://github.com/formbricks/formbricks/stargazers"><img src="https://img.shields.io/github/stars/formbricks/formbricks?logo=github" alt="Github Stars"></a>
<a href="https://news.ycombinator.com/item?id=32303986"><img src="https://img.shields.io/badge/Hacker%20News-122-%23FF6600" alt="Hacker News"></a>
<a href="[https://www.producthunt.com/products/formbricks](https://www.producthunt.com/posts/formbricks)"><img src="https://img.shields.io/badge/Product%20Hunt-455-orange?logo=producthunt&logoColor=%23fff" alt="Product Hunt"></a>
<a href="https://github.blog/2023-04-12-github-accelerator-our-first-cohort-and-whats-next/"><img src="https://img.shields.io/badge/2023-blue?logo=github&label=Github%20Accelerator" alt="Github Accelerator"></a>
<a href="https://github.com/formbricks/formbricks/issues?q=is:issue+is:open+label:%22%F0%9F%99%8B%F0%9F%8F%BB%E2%80%8D%E2%99%82%EF%B8%8Fhelp+wanted%22"><img src="https://img.shields.io/badge/Help%20Wanted-Contribute-blue"></a>
</p>
<br/>
<div style="background-color:#f8fafc; border-radius:5px;">
<p align="center">
<p align="center">
<i>Trusted by</i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="https://flixbus.com"><img src="https://github.com/formbricks/formbricks/assets/72809645/d6c91d89-7633-4845-ae1e-03bbd2ce0946" height="35px"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="https://github.com/calcom/cal.com/"><img src="https://github.com/formbricks/formbricks/assets/675065/1a8763cf-f47e-4960-90f6-334f6dc12a17#gh-light-mode-only" height="20px"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="https://github.com/CrowdDotDev/crowd.dev"><img src="https://github.com/formbricks/formbricks/assets/675065/59b1a4d4-25e4-4ef3-b0bf-4426446fbfd0#gh-light-mode-only" height="20px"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="https://neverinstall.com/"><img src="https://github.com/formbricks/formbricks/assets/675065/72e5e37b-8ef7-4340-b06e-f1d12a05330f#gh-light-mode-only" height="20px"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="https://clovyr.io/"><img src="https://github.com/formbricks/formbricks/assets/675065/9291c8df-9aac-423a-a430-a9a581240075" height="20px"></a>
<a href="https://github.com/calcom/cal.com/"><img src="https://github.com/formbricks/formbricks/assets/675065/1a8763cf-f47e-4960-90f6-334f6dc12a17#gh-light-mode-only" height="20px"></a><a href="https://github.com/calcom/cal.com/"><img src="https://github.com/formbricks/formbricks/assets/72809645/9a031e8d-538f-4fdc-9338-b77e9a57d6ac#gh-dark-mode-only" height="20px"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="https://github.com/CrowdDotDev/crowd.dev"><img src="https://github.com/formbricks/formbricks/assets/675065/59b1a4d4-25e4-4ef3-b0bf-4426446fbfd0#gh-light-mode-only" height="20px"></a><a href="https://github.com/CrowdDotDev/crowd.dev"><img src="https://github.com/formbricks/formbricks/assets/72809645/4bb4caf7-4b64-44c8-94bd-850606d181c1#gh-dark-mode-only" height="20px"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="https://clovyr.io/"><img src="https://github.com/formbricks/formbricks/assets/675065/9291c8df-9aac-423a-a430-a9a581240075" height="20px"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="https://neverinstall.com/"><img src="https://github.com/formbricks/formbricks/assets/675065/72e5e37b-8ef7-4340-b06e-f1d12a05330f#gh-light-mode-only" height="20px"></a><a href="https://neverinstall.com/"><img src="https://github.com/formbricks/formbricks/assets/72809645/9d9711dc-75e5-4084-b7fa-bbaf621064a8#gh-dark-mode-only" height="20px">
</p>
<div>
<p align="center">
<a href="https://trendshift.io/repositories/2570" target="_blank"><img src="https://trendshift.io/api/badge/repositories/2570" alt="Trendshift Badge for formbricks/formbricks" style="width: 250px; height: 55px;" width="250" height="55"/></a>
<p align="center">
<a href="https://trendshift.io/repositories/2570" target="_blank"><img src="https://trendshift.io/api/badge/repositories/2570" alt="Trendshift Badge for formbricks/formbricks" style="width: 250px; height: 55px;" width="250" height="55"/></a>
</p>
## ✨ About Formbricks
<img width="1527" alt="formbricks-sneak" src="https://github-production-user-asset-6210df.s3.amazonaws.com/675065/249441967-ccb89ea3-82b4-4bf2-8d2c-528721ec313b.png">
<img width="1527" alt="formbricks-sneak" src="https://github-production-user-asset-6210df.s3.amazonaws.com/675065/249441967-ccb89ea3-82b4-4bf2-8d2c-528721ec313b.png">
Formbricks provides a free and open source surveying platform. Gather feedback at every point in the user journey with beautiful in-app, website, link and email surveys. Build on top of Formbricks or leverage prebuilt data analysis capabilities.
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.
**Try it out in the cloud at [formbricks.com](https://app.formbricks.com/auth/signup)**
**Try it out in the cloud at [formbricks.com](https://formbricks.com)**
## 💪 Mission: Empower your team, craft an irresistible experience.
## 💪 Mission: Make customer-centric decisions based on data.
Formbricks is both a free and open source survey platform - and a privacy-first experience management platform. Use in-app, website, link and email surveys to gather user and customer insights at every point of their journey. Leverage Formbricks Insight Platform or build your own. Life's too short for mediocre UX.
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)
- [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>
<a id="features"></a>
### Features
- 📲 Create **conversion-optimized surveys** with our no-code editor with several question types.
- 📲 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, Notion, Zapier, n8n and more**.
- 🔌 Integrate Formbricks with **Slack, Posthog, Zapier, n8n and more**.
- 🔒 All **open source**, transparent and self-hostable.
### Built on Open Source
- 💻 [Typescript](https://www.typescriptlang.org/)
- 🚀 [Next.js](https://nextjs.org/)
- ⚛️ [React](https://reactjs.org/)
- 🎨 [TailwindCSS](https://tailwindcss.com/)
- 📚 [Prisma](https://prisma.io/)
- 🔒 [Auth.js](https://authjs.dev/)
- 🧘‍♂️ [Zod](https://zod.dev/)
<a id="getting-started"></a>
<a id="getting-started"></a>
## 🚀 Getting started
We've got several options depending on your need to help you quickly get started with Formbricks.
<a id="cloud-version"></a>
<a id="cloud-version"></a>
### ☁️ Cloud Version
Formbricks has a hosted cloud offering with a generous free plan to get you up and running as quickly as possible. To get started, please visit [formbricks.com](https://app.formbricks.com/auth/signup).
Formbricks has a hosted cloud offering with a generous free plan to get you up and running as quickly as possible. To get started, please visit [formbricks.com](https://formbricks.com).
<a id="self-hosted-version"></a>
<a id="self-hosted-version"></a>
### 🐳 Self-hosting Formbricks
### 🐳 Self-hosted version
Formbricks is available Open-Source under AGPLv3 license. You can host Formbricks on your own servers using Docker without a subscription.
@@ -142,7 +114,7 @@ You can deploy Formbricks on [Railway](https://railway.app) using the button bel
[![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/new/template/PPDzCd)
<a id="development"></a>
<a id="development"></a>
### 👨‍💻 Development
@@ -151,9 +123,7 @@ You can deploy Formbricks on [Railway](https://railway.app) using the button bel
Here is what you need to be able to run Formbricks:
- [Node.js](https://nodejs.org/en) (Version: >=18.x)
- [Pnpm](https://pnpm.io/)
- [Docker](https://www.docker.com/) - to run PostgreSQL and MailHog
#### Local Setup
@@ -168,7 +138,7 @@ To get started locally, we've got a [guide to help you](https://formbricks.com/d
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/formbricks/formbricks)
<a id="contribution"></a>
<a id="contribution"></a>
## ✍️ Contribution
@@ -177,39 +147,35 @@ We are very happy if you are interested in contributing to Formbricks 🤗
Here are a few options:
- Star this repo.
- Create issues every time you feel something is missing or goes wrong.
- Upvote issues with 👍 reaction so we know what 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.
## All Thanks To Our Contributors
<a href="https://github.com/formbricks/formbricks/graphs/contributors">
<img src="https://contrib.rocks/image?repo=formbricks/formbricks" />
<a href="https://github.com/formbricks/formbricks/graphs/contributors">
<img src="https://contrib.rocks/image?repo=formbricks/formbricks" />
</a>
<a id="contact-us"></a>
<a id="contact-us"></a>
## 📆 Contact us
Let's have a chat about your survey needs and get you started.
<a href="https://cal.com/johannes/onboarding?utm_source=banner&utm_campaign=oss"><img alt="Book us with Cal.com" src="https://cal.com/book-with-cal-dark.svg" /></a>
<a 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>
<a id="license"></a>
## ⚖️ License
Distributed under the AGPLv3 License. See [`LICENSE`](./LICENSE) for more information.
<a id="security"></a>
<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>
<p align="right"><a href="#top">🔼 Back to top</a></p>

View File

@@ -12,8 +12,8 @@
},
"dependencies": {
"@formbricks/js": "workspace:*",
"@heroicons/react": "^2.1.1",
"next": "14.0.4",
"@heroicons/react": "^2.0.18",
"next": "14.0.0",
"react": "18.2.0",
"react-dom": "18.2.0"
},

View File

@@ -1,6 +1,5 @@
import type { AppProps } from "next/app";
import Head from "next/head";
import "../styles/globals.css";
export default function App({ Component, pageProps }: AppProps) {

View File

@@ -1,4 +1,4 @@
import { Head, Html, Main, NextScript } from "next/document";
import { Html, Head, Main, NextScript } from "next/document";
export default function Document() {
return (

View File

@@ -1,10 +1,8 @@
import Image from "next/image";
import { useRouter } from "next/router";
import { useEffect, useState } from "react";
import formbricks from "@formbricks/js";
import Image from "next/image";
import { useEffect, useState } from "react";
import fbsetup from "../../public/fb-setup.png";
import { useRouter } from "next/router";
declare const window: any;
@@ -24,13 +22,11 @@ export default function AppPage({}) {
if (process.env.NEXT_PUBLIC_FORMBRICKS_ENVIRONMENT_ID && process.env.NEXT_PUBLIC_FORMBRICKS_API_HOST) {
const isUserId = window.location.href.includes("userId=true");
const userId = isUserId ? "THIS-IS-A-VERY-LONG-USER-ID-FOR-TESTING" : undefined;
const attributes = isUserId ? { "Init Attribute 1": "eight", "Init Attribute 2": "two" } : undefined;
formbricks.init({
environmentId: process.env.NEXT_PUBLIC_FORMBRICKS_ENVIRONMENT_ID,
apiHost: process.env.NEXT_PUBLIC_FORMBRICKS_API_HOST,
userId,
debug: true,
attributes,
});
window.formbricks = formbricks;
}
@@ -74,7 +70,7 @@ export default function AppPage({}) {
</p>
<Image src={fbsetup} alt="fb setup" className="mt-4 rounded" priority />
<div className="mt-4 flex-col items-start text-sm text-slate-700 sm:flex sm:items-center sm:text-base dark:text-slate-300">
<div className="mt-4 flex-col items-start text-sm text-slate-700 dark:text-slate-300 sm:flex sm:items-center sm:text-base">
<p className="mb-1 sm:mb-0 sm:mr-2">You&apos;re connected with env:</p>
<div className="flex items-center">
<strong className="w-32 truncate sm:w-auto">

View File

@@ -45,17 +45,14 @@ Adds an Actions for a given User by their User ID
curl --location --request POST 'https://app.formbricks.com/api/v1/client/<environment-id>/actions' \
--data-raw '{
"userId": "1",
"name": "new_action_v2",
"properties":{}
"name": "new_action_v2"
}'
```
```json {{ title: 'Example Request Body' }}
{
"userId": "1",
"name": "new_action_v3",
"properties":{}
"name": "new_action_v2"
}
```

View File

@@ -65,7 +65,12 @@ This set of API can be used to
```json {{title:'200 Success'}}
{
"data": {
"id": "clphzz6oo00083zdmc7e0nwzi"
"id": "clp83r8uy000ceyqcbld2ebwj",
"createdAt": "2023-11-21T08:57:23.866Z",
"updatedAt": "2023-11-21T08:57:23.866Z",
"surveyId": "cloqzeuu70000z8khcirufo60",
"responseId": null,
"personId": "cloo25v3e0000z8ptskh030jd"
}
}
```
@@ -76,7 +81,7 @@ This set of API can be used to
"message": "Fields are missing or incorrectly formatted",
"details": {
"surveyId": "Required"
}
}
}
```
</CodeGroup>
@@ -124,7 +129,14 @@ This set of API can be used to
```json {{title:'200 Success'}}
{
"data": {}
"data": {
"id": "clp83r8uy000ceyqcbld2ebwj",
"createdAt": "2023-11-21T08:57:23.866Z",
"updatedAt": "2023-11-21T09:05:27.285Z",
"surveyId": "cloqzeuu70000z8khcirufo60",
"responseId": null,
"personId": "cloo25v3e0000z8ptskh030jd"
}
}
```

View File

@@ -10,15 +10,13 @@ export const metadata = {
Formbricks offers two types of APIs: the **Public Client API** and the **Management API**. Each API serves a different purpose, has different authentication requirements, and provides access to different data and settings.
Checkout the [API Key Setup](/docs/api/management/api-key-setup) - to generate, store, or delete API Keys.
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.
- [Actions API](/docs/api/client/actions) - Create actions for a person
- [Displays API](/docs/api/client/displays) - Mark Survey as Displayed or Responded for a Person
- [People API](/docs/api/client/people) - Create & update people (e.g. attributes)
- [Responses API](/docs/api/client/responses) - Create & update responses for a survey
## Management API
@@ -29,7 +27,7 @@ The Management API provides access to all data and settings that are visible in
API requests made to the Management API are authorized using a personal API key. This key grants the same rights and access as if you were logged in at formbricks.com. It's essential to keep your API key secure and not share it with others.
To generate, store, or delete an API key, follow the instructions provided on the following page [API Key](/docs/api/management/api-key-setup).
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

View File

@@ -26,6 +26,12 @@ This set of API can be used to
Create User with your own User ID
### Mandatory Request Body JSON Keys
<Properties>
<Property name="environmentId" type="string">
Environment to create a person in
</Property>
</Properties>
<Properties>
<Property name="userId" type="string">
User ID which you would like to identify the person with
@@ -42,6 +48,7 @@ This set of API can be used to
'https://app.formbricks.com/api/v1/client/<environment-id>/people' \
-H 'Content-Type: application/json' \
-d '{
"environmentId":"clonzr6vc0009z8md7y06hipl",
"userId":"docs_user"
}'
```
@@ -53,7 +60,15 @@ This set of API can be used to
```json {{title:'200 Success'}}
{
"data": {
"userId": "docs_user"
"status": "success",
"person": {
"id": "clp861gvu0000v7wzr950fqad",
"userId": "docs_user",
"attributes": {},
"environmentId": "clonzr6vc0009z8md7y06hipl",
"createdAt": "2023-11-21T10:01:20.058Z",
"updatedAt": "2023-11-21T10:01:20.058Z"
}
}
}
```
@@ -111,7 +126,16 @@ This set of API can be used to
```json {{title:'200 Success'}}
{
"data": {}
"data": {
"id": "clp868htl0003v7wzmy977m15",
"userId": "new_docs_user",
"attributes": {
"welcome_to": "formbricks"
},
"environmentId": "clonzr6vc0009z8md7y06hipl",
"createdAt": "2023-11-21T10:06:47.865Z",
"updatedAt": "2023-11-21T10:06:47.865Z"
}
}
```

View File

@@ -6,19 +6,15 @@ export const metadata = {
"Unlock the full potential of Formbricks' Responses API. From fetching to updating survey responses, our comprehensive guide helps you integrate and manage survey data efficiently without compromising security. Ideal for client-side interactions.",
};
#### Client API
#### 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.
This set of API can be used to
- [Create Response](#create-response)
- [Update Response](#update-response)
---
## Create Response {{ tag: 'POST', label: '/api/v1/client/<environment-id>/responses' }}
## Create a response {{ tag: 'POST', label: '/api/v1/client/responses' }}
Add a new response to a survey.
@@ -43,8 +39,8 @@ Add a new response to a survey.
### Optional Body Fields
<Properties>
<Property name="userId" type="string" required>
Pre-existing User ID to identify the user sending the response
<Property name="personId" type="string" required>
Internal Formbricks id to identify the user sending the response
</Property>
</Properties>
@@ -53,20 +49,20 @@ Add a new response to a survey.
| field name | required | default | description |
| ---------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| data | yes | - | The response data object (answers to the survey). In this object the key is the questionId, the value the answer of the user to this question. |
| userId | no | - | The person this response is connected to. |
| 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. |
</Col>
<Col sticky>
<CodeGroup title="Request" tag="POST" label="/api/v1/client/<environment-id>/responses">
<CodeGroup title="Request" tag="POST" label="/api/v1/client/responses">
```bash {{ title: 'cURL' }}
curl --location --request POST 'https://app.formbricks.com/api/v1/client/<environment-id>/responses' \
curl --location --request POST 'https://app.formbricks.com/api/v1/client/responses' \
--data-raw '{
"surveyId":"cloqzeuu70000z8khcirufo60",
"userId": "1",
"surveyId":"clfqz1esd0000yzah51trddn8",
"personId": "clfqjny0v000ayzgsycx54a2c",
"finished": true,
"data": {
"clfqjny0v0003yzgscnog1j9i": 10,
@@ -77,8 +73,8 @@ Add a new response to a survey.
```json {{ title: 'Example Request Body' }}
{
"userId": "1",
"surveyId": "cloqzeuu70000z8khcirufo60",
"personId": "clfqjny0v000ayzgsycx54a2c",
"surveyId": "clfqz1esd0000yzah51trddn8",
"finished": true,
"data": {
"clfqjny0v0003yzgscnog1j9i": 10,
@@ -94,7 +90,19 @@ Add a new response to a survey.
```json {{ title: '200 Success' }}
{
"data": {
"id": "clp84xdld0002px36fkgue5ka",
"id": "clisyqeoi000219t52m5gopke",
"surveyId": "clfqz1esd0000yzah51trddn8",
"finished": true,
"person": {
"id": "clfqjny0v000ayzgsycx54a2c",
"attributes": {
"email": "me@johndoe.com"
}
},
"data": {
"clfqjny0v0003yzgscnog1j9i": 10,
"clfqjtn8n0070yzgs6jgx9rog": "I love Formbricks"
}
}
}
```
@@ -116,7 +124,7 @@ Add a new response to a survey.
---
## Update Response {{ tag: 'PUT', label: '/api/v1/client/<environment-id>/responses/<response-id>' }}
## Update a response {{ tag: 'POST', label: '/api/v1/client/responses/<response-id>' }}
Update an existing response in a survey.
@@ -126,9 +134,6 @@ Update an existing response in a survey.
### Mandatory Body Fields
<Properties>
<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>
@@ -144,25 +149,27 @@ Update an existing response in a survey.
</Col>
<Col sticky>
<CodeGroup title="Request" tag="PUT" label="/api/v1/client/<environment-id>/responses/<response-id>">
<CodeGroup title="Request" tag="POST" label="/api/v1/client/responses/<response-id>">
```bash {{ title: 'cURL' }}
curl --location --request PUT 'https://app.formbricks.com/api/v1/client/<environment-id>/responses/<response-id>' \
curl --location --request POST 'https://app.formbricks.com/api/v1/client/responses/<response-id>' \
--data-raw '{
"finished":false,
"data": {
"clfqjny0v0003yzgscnog1j9i": 10,
"clfqjtn8n0070yzgs6jgx9rog": "I love Formbricks"
"personId": "clfqjny0v000ayzgsycx54a2c",
"surveyId": "clfqz1esd0000yzah51trddn8",
"finished": true,
"data": {
"clggpvpvu0009n40g8ikawby8": 5,
}
}'
```
```json {{ title: 'Example Request Body' }}
{
"finished":false,
"data": {
"clfqjny0v0003yzgscnog1j9i": 10,
"clfqjtn8n0070yzgs6jgx9rog": "I love Formbricks"
"personId": "clfqjny0v000ayzgsycx54a2c",
"surveyId": "clfqz1esd0000yzah51trddn8",
"finished": true,
"data": {
"clggpvpvu0009n40g8ikawby8": 5,
}
}
```
@@ -173,7 +180,22 @@ Update an existing response in a survey.
```json {{ title: '200 Success' }}
{
"data": {}
"data": {
"id": "clisyqeoi000219t52m5gopke",
"surveyId": "clfqz1esd0000yzah51trddn8",
"finished": true,
"person": {
"id": "clfqjny0v000ayzgsycx54a2c",
"attributes": {
"email": "me@johndoe.com"
}
},
"data": {
"clfqjny0v0003yzgscnog1j9i": 10,
"clfqjtn8n0070yzgs6jgx9rog": "I love Formbricks",
"clggpvpvu0009n40g8ikawby8": 5
}
}
}
```

View File

@@ -1,6 +1,10 @@
import { Fence } from "@/components/shared/Fence";
import {generateManagementApiMetadata} from "@/lib/utils"
export const metadata = generateManagementApiMetadata("Action Class",["Fetch","Create","Delete"])
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

View File

@@ -1,7 +1,10 @@
import { Fence } from "@/components/shared/Fence";
import {generateManagementApiMetadata} from "@/lib/utils"
export const metadata = generateManagementApiMetadata("Attribute Class",["Fetch","Create","Delete"])
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

View File

@@ -1,9 +1,9 @@
import { Fence } from "@/components/shared/Fence";
export const metadata = {
title: "Formbricks Me API: Fetch your environment details",
title: "Formbricks People API: Fetch or Create Person Overview",
description:
"Dive into Formbricks' Me API within the Public Client API suite. Seamlessly fetch your own current environment details.",
"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

View File

@@ -1,8 +1,10 @@
import { Fence } from "@/components/shared/Fence";
import {generateManagementApiMetadata} from "@/lib/utils"
export const metadata = generateManagementApiMetadata("People",["Fetch","Delete"])
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

View File

@@ -1,7 +1,10 @@
import { Fence } from "@/components/shared/Fence";
import {generateManagementApiMetadata} from "@/lib/utils"
export const metadata = generateManagementApiMetadata("Responses",["Fetch","Delete"])
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

View File

@@ -1,7 +1,10 @@
import { Fence } from "@/components/shared/Fence";
import {generateManagementApiMetadata} from "@/lib/utils"
export const metadata = generateManagementApiMetadata("Surveys",["Fetch","Create","Update","Delete"])
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

View File

@@ -1,6 +1,8 @@
import {generateManagementApiMetadata} from "@/lib/utils"
export const metadata = generateManagementApiMetadata("Webhook",["Fetch","Create","Delete"])
export const metadata = {
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

View File

@@ -10,31 +10,9 @@ export const metadata = {
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 during Initialization
It's recommended to set custom user attributes directly during the initialization of Formbricks for better user identification.
<Col>
<CodeGroup title="Set custom attributes during initialization">
```javascript
formbricks.init({
environmentId: "<environment-id>",
apiHost: "<api-host>",
userId: "<user_id>",
attributes: {
plan: "free",
},
});
```
</CodeGroup>
</Col>
## Setting independently
You can use the setAttribute function to set any custom attribute for the user (e.g. name, plan, etc.) anywhere in the user journey. Formbricks maintains a state of the current user inside the browser and makes sure attributes aren't sent to the backend twice.
## 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">

View File

@@ -29,29 +29,6 @@ formbricks.init({
</CodeGroup>
</Col>
## Enhanced Initialization with User Attributes
In addition to setting the `userId`, Formbricks allows you to set user attributes right at the initialization. This ensures that your user data is seamlessly integrated from the start. Here's how you can include user attributes in the `init()` function:
<Col>
<CodeGroup title="Enhanced Initialization with User Attributes">
```javascript
formbricks.init({
environmentId: "<environment-id>",
apiHost: "<api-host>",
userId: "<user_id>",
attributes: {
// your custom attributes
Plan: "premium",
},
});
```
</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:

View File

@@ -40,7 +40,7 @@ To get this running, you'll need a bit of time. Here are the steps we're going t
3. Connect to API
4. Test
## 1. Setting up Formbricks Cloud
### 1. Setting up Formbricks Cloud
1. To get started, create an account for the [Formbricks Cloud](https://app.formbricks.com/auth/signup).
@@ -74,7 +74,7 @@ To get this running, you'll need a bit of time. Here are the steps we're going t
5. In the same way, you can change the Internal Question ID of the _Please elaborate_ question to **“additionalFeedback”** and the one of the _Page URL_ question to **“pageUrl”**.
<Note>
Answers need to be identical If you want different answers than “Yes 👍” and “No 👎” you need to update the
## Answers need to be identical If you want different answers than “Yes 👍” and “No 👎” you need to update the
choices accordingly. They have to be identical to the frontend we're building in the next step.
</Note>
@@ -108,10 +108,10 @@ To get this running, you'll need a bit of time. Here are the steps we're going t
**Youre all setup in Formbricks Cloud for now 👍**
## 2. Build the frontend
### 2. Build the frontend
<Note>
Your frontend might work differently Your frontend likely looks and works differently. This is an example
## Your frontend might work differently Your frontend likely looks and works differently. This is an example
specific to our tech stack. We want to illustrate what you should consider building yours 😊
</Note>
@@ -311,7 +311,7 @@ return (
</Col>
## 3. Connecting to the Formbricks API
The last step is to hook up your sparkling new frontend to the Formbricks API. To do so, we followed the “[Create Response](/docs/api/client/responses#create-a-response)” and “[Update Response](/docs/api/client/responses#update-a-response)” pages in our docs.
The last step is to hook up your sparkling new frontend to the Formbricks API. To do so, we followed the “[Create Response](/docs/client-api/create-response)” and “[Update Response](/docs/client-api/update-response)” pages in our docs.
Here is the code for the `handleFeedbackSubmit` function with comments:
<Col>

View File

@@ -1,22 +1,21 @@
import Image from "next/image";
import GitpodPorts from "./gitpod/ports.webp";
import GitpodAuth from "./gitpod/auth.webp";
import GitpodNewWorkspace from "./gitpod/new-workspace.webp";
import GitpodPorts from "./gitpod/ports.webp";
import GitpodPreparing from "./gitpod/preparing.webp";
import GitpodRunning from "./gitpod/running.webp";
import GithubCodespaceEnvFile from "./github-codespaces/env.webp";
import GithubCodespaceLoading from "./github-codespaces/loading.webp";
import GithubCodespaceNew from "./github-codespaces/new.webp";
import GithubCodespacePorts from "./github-codespaces/ports.webp";
import GithubCodespaceRun from "./github-codespaces/run.webp";
import GithubCodespaceLoading from "./github-codespaces/loading.webp";
import GithubCodespaceEnvFile from "./github-codespaces/env.webp";
import GithubCodespaceTerminal from "./github-codespaces/terminal.webp";
import GithubCodespaceRun from "./github-codespaces/run.webp";
import GithubCodespacePorts from "./github-codespaces/ports.webp";
export const metadata = {
title: "Formbricks Development Setup: Complete Guide to Local Environment Configuration for Dev",
description:
"Step-by-step guide to setting up a development environment for Formbricks. We officially support Gitpod and Github Codespaces for quick setup. Our advanced users can also setup Formbricks locally on their machine.",
"Step-by-step guide to setting up a development environment for Formbricks. We officially support Gitpod and Github Codespaces for quick setup.",
};
#### Contributing
@@ -26,29 +25,28 @@ export const metadata = {
We currently officially support the below methods to set up your development environment for Formbricks.
<Note>
Both the below cloud IDEs have a **generous free tier** to explore and develop! But make sure to not overuse
the machines as Formbricks will not be responsible for any charges incurred.
Both the below cloud IDEs have a **generous free tier** to explore and develop! But make sure to
not overuse the machines as Formbricks will not be responsible for any charges incurred.
</Note>
### [GitPod](#gitpod)
This will open a fully configured workspace in your browser with all the necessary dependencies already installed. Click the button below to open this project in Gitpod. For a detailed guide, visit the [Gitpod Setup Guide](#gitpod-guide) section below.
This will open a fully configured workspace in your browser with all the necessary dependencies already installed. Click the button below to open this project in Gitpod:
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://Github.com/formbricks/formbricks)
### [Github Codespaces](#Github-codespaces)
For a detailed guide, visit the [Gitpod Setup Guide](#gitpod-guide) section below.
This will open a Github VSCode Interface on the cloud for you. This setup will have the Formbricks codebase and all the dependencies installed. Click the button below to configure your instance and open the project in Github Codespaces. For a detailed guide, visit the [Github Codespaces Setup Guide](#github-codespaces-guide) section below.
### [Github Codespaces](#Github-codespaces)
This will open a Github VSCode Interface on the cloud for you. This setup will have the Formbricks codebase and all the dependencies installed. Click the button below to configure your instance and open the project in Github Codespaces:
[![Open in Github Codespaces](https://img.shields.io/badge/Open%20in-Github%20Codespaces-blue?logo=Github)](https://Github.com/codespaces/new?machine=standardLinux32gb&repo=500289888&ref=main&devcontainer_path=.devcontainer%2Fdevcontainer.json&location=EastUs2)
### [Local Machine](#local-machine-setup)
This will install the Formbricks codebase and all the dependencies on your local machine. Note that this method is recommended **only for advanced users**. If you're an advanced user, access the steps for [Local Machine Setup here](#local-machine-setup).
For a detailed guide, visit the [Github Codespaces Setup Guide](#github-codespaces-guide) section below.
<Note>
For a smooth experience, we suggest the above cloud IDE methods. Assistance with setup issues on your local
machine may be limited due to varying factors like OS and permissions.
For a smooth experience, we suggest the above recommended methods.
Assistance with setup issues on your local machine may be limited due to varying factors like OS and permissions.
</Note>
## Gitpod Guide
@@ -56,16 +54,16 @@ This will install the Formbricks codebase and all the dependencies on your local
**Building custom image for the workspace:**
- This includes : Installing `yq` and `turbo` globally before the workspace starts. This is accomplished within the `.gitpod.Dockerfile` along with starting upon a base custom image building on [workspace-full](https://hub.docker.com/r/gitpod/workspace-full/dockerfile).
**Initialization of Formbricks:**
**Initialization of Formbricks:**
- During the prebuilds phase, we initialize Formbricks by performing the following tasks:
1. Setting up environment variables.
2. Installing monorepo dependencies.
3. Installing Docker images by extracting them from the `packages/database/docker-compose.yml` file.
4. Building the @formbricks/js component.
- When the workspace starts:
1. Wait for the web and demo apps to launch on Gitpod. This automatically opens the `apps/demo/.env` file. Utilize dynamic localhost URLs (e.g., `localhost:3000` for signup and `localhost:8025` for email confirmation) to configure `NEXT_PUBLIC_FORMBRICKS_ENVIRONMENT_ID`. After creating your account and finding the `ID` in the URL at `localhost:3000`, replace `YOUR_ENVIRONMENT_ID` in the `.env` file located in `app/demo`.
1. Wait for the web and demo apps to launch on Gitpod. This automatically opens the `apps/demo/.env` file. Utilize dynamic localhost URLs (e.g., `localhost:3000` for signup and `localhost:8025` for email confirmation) to configure `NEXT_PUBLIC_FORMBRICKS_ENVIRONMENT_ID`. After creating your account and finding the `ID` in the URL at `localhost:3000`, replace `YOUR_ENVIRONMENT_ID` in the `.env` file located in `app/demo`.
**Web Component Initialization:**
**Web Component Initialization:**
- we initialize the @formbricks/web component during prebuilds. This involves:
1. Installing build dependencies for the `@formbricks/web#go` task from turbo.json in prebuilds to save time.
2. Starting PostgreSQL and Mailhog containers for running migrations in prebuilds.
@@ -75,131 +73,95 @@ This will install the Formbricks codebase and all the dependencies on your local
2. Replacing `NEXT_PUBLIC_WEBAPP_URL` and `NEXTAUTH_URL` to take in Gitpod URL's ports when running on VSCode browser.
3. Starting the `@formbricks/web` dev environment.
**Demo Component Initialization:**
**Demo Component Initialization:**
- Similar to the web component, the demo component is also initialized during prebuilds. This includes:
1. Installing build dependencies for the `formbricks/demo#go` task from turbo.json in prebuilds to save time.
2. Caching hits and replaying builds from the `@formbricks/js` component.
- When the workspace starts:
- When the workspace starts:
1. Initializing environment variables.
2. Replaces `NEXT_PUBLIC_FORMBRICKS_API_HOST` to take in Gitpod URL's ports when running on VSCode browser.
3. Starting the `@formbricks/demo` dev environment.
**Github Prebuilds Configuration:**
**Github Prebuilds Configuration:**
- This configures Github Prebuilds for the master branch, pull requests, and adding comments. This helps automate the prebuild process for the specified branches and actions.
**VSCode Extensions:**
**VSCode Extensions:**
- This includes a list of VSCode extensions that are added to the configuration when using Gitpod. These extensions can enhance the development experience within Gitpod.
### 1. Browser Redirection
After clicking the one-click setup button, Gitpod will open a new tab or window. Please ensure that your browser allows redirection to successfully access the services:
### 2. Authorizing in Gitpod
<Image src={GitpodAuth} alt="Gitpod Auth Page" quality="100" className="max-w-full rounded-lg sm:max-w-3xl" />-
This is the Gitpod Authentication Page. It appears when you click the "Open in GitPod" button and Gitpod needs
to authenticate your access to the workspace. Click on 'Continue With Github' to authorize your GitPod session.
<Image src={GitpodAuth} alt="Gitpod Auth Page" quality="100" className="rounded-lg max-w-full sm:max-w-3xl" />
- This is the Gitpod Authentication Page. It appears when you click the "Open in GitPod" button and Gitpod needs to authenticate your access to the workspace. Click on 'Continue With Github' to authorize your GitPod session.
### 3. Creating a New Workspace
<Image src={GitpodNewWorkspace} alt="Gitpod New workspace Page" quality="100" className="rounded-lg max-w-full sm:max-w-3xl" />
- After authentication, Gitpod asks to create a new workspace for you. This page displays the configurations of your workspace.
- You can use either choose either VS Code Browser or VS Code Desktop editor with the 'Standard Class' for your workspace class.
- If you opt for the VS Code Desktop, follow the following steps
1. Gitpod will prompt you to grant access to the VSCode app. Once approved, install the GitPod extension from the VSCode Marketplace and follow the prompts to authorize the integration.
2. Change the `WEBAPP_URL` and the `NEXTAUTH_URL` to `https://localhost:3000`
<Image
src={GitpodNewWorkspace}
alt="Gitpod New workspace Page"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
/>
- After authentication, Gitpod asks to create a new workspace for you. This page displays the configurations of
your workspace. - You can use either choose either VS Code Browser or VS Code Desktop editor with the 'Standard
Class' for your workspace class. - If you opt for the VS Code Desktop, follow the following steps 1. Gitpod will
prompt you to grant access to the VSCode app. Once approved, install the GitPod extension from the VSCode Marketplace
and follow the prompts to authorize the integration. 2. Change the `WEBAPP_URL` and the `NEXTAUTH_URL` to `https://localhost:3000`
### 4. Gitpod preparing the created Workspace
<Image
src={GitpodPreparing}
alt="Gitpod Preparing workspace Page"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
/>
- Gitpod is preparing your workspace with all the necessary dependencies and configurations. You will see this
page while Gitpod sets up your development environment.
<Image src={GitpodPreparing} alt="Gitpod Preparing workspace Page" quality="100" className="rounded-lg max-w-full sm:max-w-3xl" />
- Gitpod is preparing your workspace with all the necessary dependencies and configurations. You will see this page while Gitpod sets up your development environment.
### 5. Gitpod running the Workspace
<Image
src={GitpodRunning}
alt="Gitpod Running Workspace Page"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
/>
- Once the workspace is fully prepared, voila, it enters the running state. You can start working on your project
in this environment.
<Image src={GitpodRunning} alt="Gitpod Running Workspace Page" quality="100" className="rounded-lg max-w-full sm:max-w-3xl" />
- Once the workspace is fully prepared, voila, it enters the running state. You can start working on your project in this environment.
### Ports and Services
Here are the ports and corresponding URLs for the services within your Gitpod environment:
- **Port 3000**:
- **Service**: Demo App
- **Description**: This port hosts the demo application of your project. You can access and interact with your application's demo by navigating to this port.
- **Service**: Demo App
- **Description**: This port hosts the demo application of your project. You can access and interact with your application's demo by navigating to this port.
- **Port 3001**:
- **Service**: Formbricks website
- **Description**: This port hosts the [Formbricks](https://formbricks.com) website, which contains documents, pricing, blogs, best practices, and concierge service.
- **Service**: Formbricks website
- **Description**: This port hosts the [Formbricks](https://formbricks.com) website, which contains documents, pricing, blogs, best practices, and concierge service.
- **Port 3002**:
- **Service**: Formbricks In-product Survey Demo App
- **Description**: This app helps you test your in-app surveys. You can create and test user actions, create and update user attributes, etc.
- **Service**: Formbricks In-product Survey Demo App
- **Description**: This app helps you test your in-app surveys. You can create and test user actions, create and update user attributes, etc.
- **Port 5432**:
- **Service**: PostgreSQL Database Server
- **Description**: The PostgreSQL DB is hosted on this port.
- **Service**: PostgreSQL Database Server
- **Description**: The PostgreSQL DB is hosted on this port.
- **Port 1025**:
- **Service**: SMPT server
- **Description**: SMTP Server for sending and receiving email messages. This server is responsible for handling email communication.
- **Service**: SMPT server
- **Description**: SMTP Server for sending and receiving email messages. This server is responsible for handling email communication.
- **Port 8025**:
- **Service**: Mailhog
- **Service**: Mailhog
### Accessing port URLs
1. **Direct URL Composition**:
- You can access the dedicated port URL by pre-pending the port number to the workspace URL.
- For example, if you want to access port 3000, you can use the URL format: `3000-yourworkspace.ws-eu45.gitpod.io`.
1. **Direct URL Composition**:
2. **Using [gp CLI](https://www.gitpod.io/docs/references/gitpod-cli)**:
- Gitpod provides a convenient command, `gp url`, to quickly retrieve the URL for a specific port.
- Simply use the command followed by the desired port number. For example, to get the URL for port 3000, run: `gp url 3000`.
- You can access the dedicated port URL by pre-pending the port number to the workspace URL.
- For example, if you want to access port 3000, you can use the URL format: `3000-yourworkspace.ws-eu45.gitpod.io`.
3. **Listing All Open Port URLs**:
- If you prefer to see a list of all open port URLs at once, you can use the `gp ports list` command.
- Running this command will display a list of ports along with their corresponding URLs.
2. **Using [gp CLI](https://www.gitpod.io/docs/references/gitpod-cli)**:
4. **Viewing All Ports in Panel**:
- Gitpod also offers a user-friendly 'Ports' tab in the Gitpod panel.
- Click on the 'Ports' tab to view a list of all open ports and their respective URLs.
- Gitpod provides a convenient command, `gp url`, to quickly retrieve the URL for a specific port.
- Simply use the command followed by the desired port number. For example, to get the URL for port 3000, run: `gp url 3000`.
<Image src={GitpodPorts} alt="Gitpod Ports tab" quality="100" className="rounded-lg max-w-full sm:max-w-3xl" />
3. **Listing All Open Port URLs**:
- If you prefer to see a list of all open port URLs at once, you can use the `gp ports list` command.
- Running this command will display a list of ports along with their corresponding URLs.
4. **Viewing All Ports in Panel**:
- Gitpod also offers a user-friendly 'Ports' tab in the Gitpod panel.
- Click on the 'Ports' tab to view a list of all open ports and their respective URLs.
{" "}
<Image
src={GitpodPorts}
alt="Gitpod Ports tab"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
/>
These URLs and port numbers represent various services and endpoints within your Gitpod environment. You can access and interact with these services by the Port URL for the respective service.
These URLs and port numbers represent various services and endpoints within your Gitpod environment. You can access and interact with these services by the Port URL for the respective service.
---
@@ -207,41 +169,21 @@ These URLs and port numbers represent various services and endpoints within your
1. After clicking the one-click setup button, you will be redirected to the Github Codespaces page. Review the configuration and click on the 'Create Codespace' button to create a new Codespace.
<Image
src={GithubCodespaceNew}
alt="New Github Codespace"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
/>
<Image src={GithubCodespaceNew} alt="New Github Codespace" quality="100" className="rounded-lg max-w-full sm:max-w-3xl" />
2. This will start loading the Codespace. Keep in mind this might take a few minutes to complete depending on your internet connection and the instance availability.
<Image
src={GithubCodespaceLoading}
alt="Loading Github Codespace"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
/>
<Image src={GithubCodespaceLoading} alt="Loading Github Codespace" quality="100" className="rounded-lg max-w-full sm:max-w-3xl" />
3. Once the Codespace is loaded, you will be redirected to the VSCode editor. You can start working on your project in this environment.
4. Make the changes you want to, and now, to run the app, we first need to configure the .env file. Copy the .env.example and edit the variables as mentioned in the file itself.
<Image
src={GithubCodespaceEnvFile}
alt="Github Codespace Env File"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
/>
<Image src={GithubCodespaceEnvFile} alt="Github Codespace Env File" quality="100" className="rounded-lg max-w-full sm:max-w-3xl" />
5. Once you have configured the .env, it's now time to run the app and see the changes. Lets open the terminal first
<Image
src={GithubCodespaceTerminal}
alt="Github Codespace Open Terminal"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
/>
<Image src={GithubCodespaceTerminal} alt="Github Codespace Open Terminal" quality="100" className="rounded-lg max-w-full sm:max-w-3xl" />
6. Now, run the following command to run the app
@@ -255,12 +197,7 @@ pnpm dev
</CodeGroup>
</Col>
<Image
src={GithubCodespaceRun}
alt="Run on Github Codespace"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
/>
<Image src={GithubCodespaceRun} alt="Run on Github Codespace" quality="100" className="rounded-lg max-w-full sm:max-w-3xl" />
7. Monitor the logs in the terminal and once you see the following, you are good to go!
@@ -273,7 +210,7 @@ pnpm dev
@formbricks/web:dev: - Environments: .env
@formbricks/web:dev: - Experiments (use at your own risk):
@formbricks/web:dev: · serverActions
@formbricks/web:dev:
@formbricks/web:dev:
@formbricks/web:dev: ✓ Ready in 9.4s
```
@@ -282,123 +219,10 @@ pnpm dev
8. Right next to the Terminal, you will see a **Ports** tab, click on it to see the ports and their respective URLs. Now access the Forwarded Address for port 3000 and you should be able to visit your Formbricks App!
<Image
src={GithubCodespacePorts}
alt="Github Codespace Ports"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
/>
<Image src={GithubCodespacePorts} alt="Github Codespace Ports" quality="100" className="rounded-lg max-w-full sm:max-w-3xl" />
Now make the changes you want to and see them live in action!
---
## Local Machine Setup
<Note>
The below only works for **Mac**, **Linux** & **WSL2** on Windows (not on pure Windows)!
This method is recommended **only for advanced users** & we won't be able to provide official support for this.
</Note>
To get the project running locally on your machine you need to have the following development tools installed:
- Node.JS (we recommend v20)
- [pnpm](https://pnpm.io/)
- [Docker](https://www.docker.com/) (to run PostgreSQL / MailHog)
1. Clone the project & move into the directory:
<Col>
<CodeGroup title="Git clone Formbricks monorepo">
```bash
git clone https://github.com/formbricks/formbricks && cd formbricks
```
</CodeGroup>
</Col>
2. Install Node.JS packages via pnpm. Don't have pnpm? Get it [here](https://pnpm.io/installation)
<Col>
<CodeGroup title="Install dependencies via pnpm">
```bash
pnpm install
```
</CodeGroup>
</Col>
3. Create a `.env` file based on `.env.example`. It's already preset to work with the local development setup but you can also change values if needed.
<Col>
<CodeGroup title="Define environment variables">
```bash
cp .env.example .env
```
</CodeGroup>
</Col>
4. Generate & set some secret values mandatory for the ENCRYPTION_KEY & NEXTAUTH_SECRET in the .env file. You can use the following command to generate the random string of required length:
<Col>
<CodeGroup title="Set value of ENCRYPTION_KEY">
```bash
sed -i '/^ENCRYPTION_KEY=/c\ENCRYPTION_KEY='$(openssl rand -hex 32) .env
sed -i '/^NEXTAUTH_SECRET=/c\NEXTAUTH_SECRET='$(openssl rand -hex 32) .env
```
</CodeGroup>
</Col>
5. Make sure you have [`Docker`](https://docs.docker.com/compose/) & [`docker-compose`](https://docs.docker.com/compose/) installed and running on your machine. Then run the following command to start the Formbricks dev setup:
<Col>
<CodeGroup title="Start Formbricks Dev Setup">
```bash
pnpm go
```
</CodeGroup>
</Col>
This starts the Formbricks main app (plus all its dependencies) as well as the following services using Docker:
- a `postgres` container for hosting your database,
- a `mailhog` container that acts as a mock SMTP server and shows received mails in a web UI (forwarded to your host's `localhost:8025`)
- Demo App at [http://localhost:3002](http://localhost:3002)
- Landing Page at [http://localhost:3001](http://localhost:3001)
**You can now access the Formbricks app on [http://localhost:3000](http://localhost:3000)**. You will be automatically redirected to the login. To use your local installation of formbricks, create a new account.
{" "}
<Note>
A fresh setup does not have a default account. Please create a new account and proceed accordingly.
</Note>
For viewing the emails sent by the system, you can access mailhog at [http://localhost:8025](http://localhost:8025)
### Build
To build all apps and packages and check for build errors, run the following command:
<Col>
<CodeGroup title="Build Formbricks stack">
```bash
pnpm build
```
</CodeGroup>
</Col>
---
Still cant figure it out? Join our [Discord](https://discord.com/invite/3YFcABF2Ts)!
Still cant figure it out? Join our [Discord](https://discord.com/invite/3YFcABF2Ts)!

View File

@@ -45,7 +45,7 @@ All you need to do is copy a `<script>` tag to your HTML head, and thats abou
```html {{ title: 'index.html' }}
<!-- START Formbricks Surveys -->
<script type="text/javascript">
!function(){var t=document.createElement("script");t.type="text/javascript",t.async=!0,t.src="https://unpkg.com/@formbricks/js@^1.4.0/dist/index.umd.js";var e=document.getElementsByTagName("script")[0];e.parentNode.insertBefore(t,e),setTimeout(function(){window.formbricks.init({environmentId: "<your-environment-id>", apiHost: "<api-host>"})},500)}();
!function(){var t=document.createElement("script");t.type="text/javascript",t.async=!0,t.src="https://unpkg.com/@formbricks/js@^1.2.0/dist/index.umd.js";var e=document.getElementsByTagName("script")[0];e.parentNode.insertBefore(t,e),setTimeout(function(){window.formbricks.init({environmentId: "<your-environment-id>", apiHost: "<api-host>"})},500)}();
</script>
<!-- END Formbricks Surveys -->
```

View File

@@ -10,9 +10,8 @@ import DeleteConnection from "./delete-connection.webp";
import Image from "next/image";
export const metadata = {
title: "Google Sheets",
description:
"The Google Sheets integration allows you to automatically send responses to a Google Sheet of your choice.",
title: "n8n Setup",
description: "Wire up Formbricks with n8n and 350+ other apps",
};
#### Integrations
@@ -63,7 +62,7 @@ Before the next step, make sure that you have a Formbricks Survey with at least
</Note>
5. Now click on the "Link New Sheet" button to link a new Google Sheet with Formbricks and a modal will open up.
6. Now click on the "Link New Sheet" button to link a new Google Sheet with Formbricks and a modal will open up.
<Image
src={LinkSurveyWithSheet}
@@ -72,16 +71,17 @@ Before the next step, make sure that you have a Formbricks Survey with at least
className="max-w-full rounded-lg sm:max-w-3xl"
/>
6. Select the Google Sheet you want to link with Formbricks and the Survey. On doing so, you will be asked with what questions' responses you want to feed in the Google Sheet. Select the questions and click on the "Link Sheet" button.
7. Select the Google Sheet you want to link with Formbricks and the Survey. On doing so, you will be asked with what questions' responses you want to feed in the Google Sheet. Select the questions and click on the "Link Sheet" button.
<Image
src={LinkWithQuestions}
alt="Select question to link with Google Sheet"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
/>
7. On submitting, the modal will close and you will see the linked Google Sheet in the list of linked Google Sheets.
8. On submitting, the modal will close and you will see the linked Google Sheet in the list of linked Google Sheets.
<Image
src={ListLinkedSurveys}

View File

@@ -96,7 +96,7 @@ Click "Create a webhook":
className="rounded-lg max-w-full sm:max-w-3xl"
/>
Enter the Formbricks API key. Learn how to get one from the [API Key tutorial](/docs/api/management/api-key-setup).
Enter the Formbricks API key. Learn how to get one from the [API Key tutorial](/docs/api/api-key-setup).
<Image src={EnterApiKey} alt="Enter API Key" quality="100" className="rounded-lg max-w-full sm:max-w-3xl" />

View File

@@ -71,7 +71,7 @@ Click on Create New Credentail button to add your host and API Key
<Image src={AddApiKey} alt="Add host and api key" quality="100" className="rounded-lg max-w-full sm:max-w-3xl" />
Now you need an API key. Please refer to the [API Key Setup](/docs/api/management/api-key-setup) page to learn how to create one.
Now you need an API key. Please refer to the [API Key Setup](/docs/api/api-key-setup) page to learn how to create one.
Once you copied it in the API Key field, hit Save button to test the connection and save the credentials.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 653 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 498 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 386 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 836 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 384 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 462 KiB

View File

@@ -1,126 +0,0 @@
import IntegrationsTab from "./images/integrations-tab.png";
import ConnectWithNotion from "./images/connect-with-notion.png";
import NotionConnected from "./images/notion-connected.png";
import LinkSurveyWithDatabase from "./images/link-survey-with-database.png";
import LinkWithDatabases from "./images/link-with-databases.png";
import ListLinkedDatabases from "./images/list-linked-databases.png";
import DeleteConnection from "./images/delete-connection.png";
import Image from "next/image";
export const metadata = {
title: "Notion",
description:
"The notion integration allows you to automatically send responses to a Notion database of your choice.",
};
#### Integrations
# Notion
The notion integration allows you to automatically send responses to a Notion database of your choice.
<Note>
This feature is enabled by default in Formbricks Cloud but needs to be self-configured when running a
self-hosted version of Formbricks.
</Note>
## Formbricks Cloud
1. Go to the Integrations tab in your [Formbricks Cloud dashboard](https://app.formbricks.com/) and click on the "Connect" button under Notion integration.
<Image
src={IntegrationsTab}
alt="Formbricks Integrations Tab"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
/>
2. Now click on the "Connect with Notion" button to authenticate yourself with Notion.
<Image
src={ConnectWithNotion}
alt="Connect Formbricks with your Notion account"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
/>
3. You will now be taken to the Notion OAuth page where you can select the Notion account you want to use for the integration
4. Once you have selected the account and databases and completed the authentication and authorization process, you will be taken back to Formbricks Cloud and see the connected status as below:
<Image
src={NotionConnected}
alt="Formbricks is now connected with Notion"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
/>
<Note>
Before the next step, make sure that you have a Formbricks Survey with at least one question and a Notion
database in the Notion account you integrated.
</Note>
5. Now click on the "Link New Database" button to link a new Notion database with Formbricks and a modal will open up.
<Image
src={LinkSurveyWithDatabase}
alt="Link Formbricks with a Notion database"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
/>
6. Select the Notion database you want to link with Formbricks and the Survey. On doing so, you will be asked to map formbricks' survey questions with selected databases' column. Complete the mapping and click on the "Link Database" button.
<Image
src={LinkWithDatabases}
alt="Question to notion database column mapping"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
/>
7. On submitting, the modal will close and you will see the linked Notion database in the list of linked Notion databases.
<Image
src={ListLinkedDatabases}
alt="List of linked notion databases"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
/>
Congratulations! You have successfully linked a Notion database with Formbricks. Now whenever a response is submitted for the linked Survey, it will be automatically added to the linked Notion database.
## Setup in self-hosted Formbricks
Enabling the Notion Integration in a self-hosted environment requires a setup using Notion account and changing the environment variables of your Formbricks instance.
1. Sign up for a [Notion](https://www.notion.so/) account, if you don't have one already.
2. Go to the [my integrations](https://www.notion.so/my-integrations) page and click on **New integration**.
3. Fill up the basic information like **Name**, **Logo** and click on **Submit**.
4. Now, click on **Distribution** tab on the sidebar. A text will appear which will ask you to make the integration public. Click on that toggle button. A form will appear below the text.
5. Now provide it the details such as requested. Under **Redirect URIs** field:
- If you are running formbricks locally, you can enter `http://localhost:3000/api/v1/integrations/notion/callback`.
- Or, you can enter `https://<your-public-facing-url>/api/v1/integrations/notion/callback`
6. Once you've filled all the necessary details, click on **Submit**.
7. A screen will appear which will have **Client ID**, **Client secret** and **Authorization URL**. Copy them and set them as the environment variables in your Formbricks instance as:
- `NOTION_OAUTH_CLIENT_ID` - OAuth Client ID
- `NOTION_OAUTH_CLIENT_SECRET` - OAuth Client Secret
Voila! You have successfully enabled the Notion integration in your self-hosted Formbricks instance. Now you can follow the steps mentioned in the [Formbricks Cloud](#formbricks-cloud) section to link a Notion database with Formbricks.
## Remove Integration with Notion Account
To remove the integration with Notion Account,
1. Visit the Integrations tab in your Formbricks Cloud dashboard.
2. Select "Manage" button in the Notion card.
3. Click on the "Connected with `<your-workspace-name-here`> Workspace" just before the "Link new Database" button.
4. It will now ask for a confirmation to remove the integration. Click on the "Delete" button to remove the integration. You can always come back and connect again with the same Notion Account.
<Image
src={DeleteConnection}
alt="Delete Notion Integration with Formbricks"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
/>
Still struggling or something not working as expected? [Join our Discord!](https://formbricks.com/discord) and we'd be glad to assist you!

View File

@@ -94,7 +94,7 @@ Now, you have to connect Zapier with Formbricks via an API Key:
className="rounded-lg max-w-full sm:max-w-3xl"
/>
Now you need an API key. Please refer to the [API Key Setup](/docs/api/management/api-key-setup) page to learn how to create one.
Now you need an API key. Please refer to the [API Key Setup](/docs/api/api-key-setup) page to learn how to create one.
Once you copied it in the newly opened Zapier window, you will be connected:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

View File

@@ -1,11 +1,3 @@
import Image from "next/image";
import FormBuilder from "./form-builder.webp";
import Targeting from "./targeting.webp";
import Trigger from "./trigger.webp";
import integrations from "./integrations.webp";
import Analytics from "./analytics.webp";
export const metadata = {
title: "Inside Look: Formbricks In-Product Micro-Surveys",
description:
@@ -29,49 +21,14 @@ Formbricks is a powerful platform designed to help you create and manage in-prod
The Form Builder is where you create and customize your micro-surveys. With its intuitive drag-and-drop interface, you can easily add different question types, set response options, and apply your branding to the survey forms. The Form Builder allows you to preview your survey in real-time, ensuring it looks and feels perfect for your users.
<Image
src={FormBuilder}
alt="Create & Customize Surveys No Code with Formbricks"
quality="100"
className="rounded-lg max-w-full sm:max-w-3xl"
/>
## Targeting & Triggers
Formbricks offers fine-grained user targeting and event-based triggers to help you display your surveys to the most relevant audience. Using the platform, you can define user segments based on attributes and behaviors, and set up triggers to show your surveys at specific moments within your product. This ensures that you're capturing the most accurate and valuable feedback possible.
<Image
src={Targeting}
alt="Targeting & Triggers with Formbricks"
quality="100"
className="rounded-lg w-full sm:max-w-3xl"
/>
<Image
src={Trigger}
alt="Targeting & Triggers with Formbricks"
quality="100"
className="rounded-lg max-w-full sm:max-w-3xl"
/>
## Integration
Integrating Formbricks into your web or mobile application is a breeze. With SDKs for popular web frameworks like React, and an HTML snippet for non-framework based websites, you can quickly add Formbricks to your project. The provided code snippets make it easy to initialize the Formbricks widget and configure it to communicate with your backend.
<Image
src={integrations}
alt="Integrations with Formbricks"
quality="100"
className="rounded-lg max-w-full sm:max-w-3xl"
/>
## Analytics & Insights
Formbricks provides powerful analytics and insights to help you understand user responses and make data-driven decisions. The platform aggregates survey results and presents them in an easy-to-understand format, enabling you to identify trends, spot issues, and uncover opportunities for improvement. With Formbricks, you're always one step ahead in understanding your users and optimizing your product experience.
<Image
src={Analytics}
alt="Analytics & Insights with Formbricks"
quality="100"
className="rounded-lg max-w-full sm:max-w-3xl"
/>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

View File

@@ -1,4 +1,5 @@
import { GettingStarted } from "@/components/docs/GettingStarted";
import BestPractices from "@/components/docs/BestPractices";
import { HeroPattern } from "@/components/docs/HeroPattern";
import { Button } from "@/components/docs/Button";
@@ -8,7 +9,10 @@ export const metadata = {
"Enhance your product with Formbricks the leading open-source solution for in-product micro-surveys. Dive deep into user research, amplify product-market fit, and uncover the 'why' behind your analytics.",
};
export const sections = [];
export const sections = [
{ title: "Getting Started", id: "getting-started" },
{ title: "Best Practices", id: "best-practices" },
];
<HeroPattern />
@@ -16,7 +20,7 @@ export const sections = [];
Welcome to Formbricks, your go-to solution for in-product micro-surveys that will supercharge your product experience! 🚀 {{ className: 'lead' }}
<div className="mb-16 mt-6 flex gap-3" id="why-formbricks">
<div className="mb-16 mt-6 flex gap-3">
<Button href="/docs/getting-started/quickstart-in-app-survey" arrow="right" children="Quickstart" />
</div>

View File

@@ -1,7 +1,9 @@
import glob from "fast-glob";
import { Providers } from "@/app/providers";
import { Layout } from "@/components/docs/Layout";
import { type Section } from "@/components/docs/SectionProvider";
import glob from "fast-glob";
import { type Metadata } from "next";
export const metadata: Metadata = {

View File

@@ -3,14 +3,14 @@ import Image from "next/image";
import PeopleView from "./people-view.webp";
export const metadata = {
title: "Effective Identify Users in Formbricks Link Surveys",
title: "Effective User Identification in Formbricks Link Surveys",
description:
"Discover how to seamlessly connect responses from Formbricks link surveys to existing users in your database. Learn the intricacies of the userId URL parameter to enhance user tracking, profiling, and segmentation, ensuring more personalized interactions and data-driven decisions.",
};
#### Link Surveys
# Identify Users in Link Surveys
# User Identification in Link Surveys
Identifying users in link features lets you connect responses from link surveys with existing users in your Formbricks database.

View File

@@ -6,7 +6,7 @@ export const metadata = {
#### Self-Hosting
# Advanced Setup
# Running Formbricks with Docker
Quickly set up and start using Formbricks without getting into the technicalities of the build process. You'll be using an image that we've already built for you. The pre-built image is ready-to-run, and it only requires minimal configuration on your part. This approach is perfect for getting a functional instance of Formbricks up and running with minimal hassle. It's as easy as downloading the Docker image and firing up the container.
@@ -242,10 +242,8 @@ These variables can be provided at the runtime i.e. in your docker-compose file.
| TELEMETRY_DISABLED | Disables telemetry if set to `1`. | optional | |
| INSTANCE_ID | Instance ID for Formbricks Cloud to be sent to Telemetry. | optional | |
| INTERNAL_SECRET | Internal Secret (Currently we overwrite the value with a random value). | optional | |
| IS_FORMBRICKS_CLOUD | Uses Formbricks Cloud if set to `1` | optional | |
| DEFAULT_BRAND_COLOR | Default brand color for your app (Can be overwritten from the UI as well). | optional | `#64748b` |
| DEFAULT_TEAM_ID | Automatically assign new users to a specific team when joining | optional | |
| DEFAULT_TEAM_ROLE | Role of the user in the default team. | optional | `admin` |
| ONBOARDING_DISABLED | Disables onboarding for new users if set to `1` | optional | |
## Build-time Variables

View File

@@ -1,13 +1,9 @@
export const metadata = {
title: "Configure Formbricks with External auth providers",
title: "External auth providers",
description:
"Set up and integrate multiple external authentication providers with Formbricks. Our step-by-step guide covers Google OAuth and more, ensuring a seamless login experience for your users.",
};
#### Self-Hosting
# Configure
## Google OAuth Authentication
Integrating Google OAuth with your Formbricks instance allows users to log in using their Google credentials, ensuring a secure and streamlined user experience. This guide will walk you through the process of setting up Google OAuth for your Formbricks instance.
@@ -39,24 +35,17 @@ Integrating Google OAuth with your Formbricks instance allows users to log in us
- Select the application type **Web application** for your project and enter any additional information required.
- Ensure to specify authorized JavaScript origins and authorized redirect URIs.
<Col>
<CodeGroup title="Configuration URLs">
``` {{ title: 'Redirect & Origin URLs' }}
```
Authorized JavaScript origins: {WEBAPP_URL}
Authorized redirect URIs: {WEBAPP_URL}/api/auth/callback/google
```
</CodeGroup>
</Col>
5. **Update Environment Variables in Docker**:
- To integrate the Google OAuth, you have two options: either update the environment variables in the docker-compose file or directly add them to the running container.
- In your Docker setup directory, open the `.env` file, and add or update the following lines with the `Client ID` and `Client Secret` obtained from Google Cloud Platform:
- Alternatively, you can add the environment variables directly to the running container using the following commands (replace `container_id` with your actual Docker container ID):
<Col>
<CodeGroup title="Set env vars">
```sh {{ title: 'Shell commands' }}
```
docker exec -it container_id /bin/bash
export GOOGLE_AUTH_ENABLED=1
export GOOGLE_CLIENT_ID=your-client-id-here
@@ -64,15 +53,12 @@ export GOOGLE_CLIENT_SECRET=your-client-secret-here
exit
```
```sh {{ title: 'env file' }}
```
GOOGLE_AUTH_ENABLED=1
GOOGLE_CLIENT_ID=your-client-id-here
GOOGLE_CLIENT_SECRET=your-client-secret-here
```
</CodeGroup>
</Col>
6. **Restart Your Formbricks Instance**:
- **Note:** Restarting your Docker containers may cause a brief period of downtime. Plan accordingly.
- Once the environment variables have been updated, it's crucial to restart your Docker containers to apply the changes. This ensures that your Formbricks instance can utilize the new Google OAuth configuration for user authentication. Here's how you can do it:

View File

@@ -18,6 +18,7 @@ Formbricks v1.2 ships a lot of features targeting our Link Surveys. We have also
| -------------------- | -------- | ------------------------------ | ----------------------------------------------------------- |
| ENCRYPTION_KEY | true | `openssl rand -hex 32` | Needed for 2 Factor Authentication |
| SHORT_URL_BASE | false | `<your-short-base-url>` | Needed if you want to enable shorter links for Link Surveys |
| ASSET_PREFIX_URL | false | `<your-asset-hosted-base-url>` | Needed if you have a separate URL for hosted assets |
### Deprecated / Removed Environment Variables

View File

@@ -6,7 +6,7 @@ export const metadata = {
#### Self-Hosting
# One-Click Setup
# Deploying Formbricks to Production
If you want to quickly set up a production instance of Formbricks on a server running Ubuntu, we've got you covered! This method utilizes a convenient shell script that takes care of everything, including Docker, Postgres DB, and SSL certificate configuration. The shell script will automatically install all the required dependencies and configure your server, making the process a breeze.
@@ -29,7 +29,7 @@ Copy and paste the following command into your terminal:
<CodeGroup title="Single Command to deploy Formbricks">
```bash
curl -fsSL https://raw.githubusercontent.com/formbricks/formbricks/main/docker/production.sh -o formbricks.sh && chmod +x formbricks.sh && ./formbricks.sh install
/bin/sh -c "$(curl -fsSL https://raw.githubusercontent.com/formbricks/formbricks/main/docker/production.sh)"
```
</CodeGroup>
@@ -154,69 +154,6 @@ my.hosted.url.com
</CodeGroup>
</Col>
## Update Formbricks
To update Formbricks, simply run the following command:
<Col>
<CodeGroup title="Update Formbricks">
```bash
./formbricks.sh update
```
</CodeGroup>
</Col>
The script will automatically pull the latest version of Formbricks from GitHub Container Registry and restart the containers.
## Stop Formbricks Instance
To stop Formbricks, simply run the following command:
<Col>
<CodeGroup title="Stop Formbricks">
```bash
./formbricks.sh stop
```
</CodeGroup>
</Col>
The script will automatically stop all the Formbricks related containers and brings the entire stack down.
## Restart Formbricks Instance
To restart Formbricks, simply run the following command:
<Col>
<CodeGroup title="Restart Formbricks">
```bash
./formbricks.sh restart
```
</CodeGroup>
</Col>
The script will automatically restart all the Formbricks related containers and brings the entire stack up with the previous configuration.
## Uninstall Formbricks
To uninstall Formbricks, simply run the following command, but keep in mind that this will delete all your data!
<Col>
<CodeGroup title="Uninstall Formbricks">
```bash
./formbricks.sh uninstall
```
</CodeGroup>
</Col>
The script will automatically stop all the Formbricks related containers, remove the Formbricks directory, and delete the Docker network.
## Debugging
If you encounter any issues, you can check the logs of the container with:
@@ -231,7 +168,6 @@ cd formbricks && docker compose logs -f
</Col>
You can close the logs again with `CTRL + C`.
## Troubleshooting
If you encounter any issues, consider the following steps:

View File

@@ -1,7 +1,7 @@
"use client";
import { ThemeProvider, useTheme } from "next-themes";
import { useEffect } from "react";
import { ThemeProvider, useTheme } from "next-themes";
function ThemeWatcher() {
let { resolvedTheme, setTheme } = useTheme();

View File

@@ -1,14 +1,14 @@
"use client";
import Link from "next/link";
import { type MotionValue, motion, useMotionTemplate, useMotionValue } from "framer-motion";
import { GridPattern } from "./GridPattern";
import { Heading } from "./Heading";
import { ChatBubbleIcon } from "@/components/docs/icons/ChatBubbleIcon";
import { EnvelopeIcon } from "@/components/docs/icons/EnvelopeIcon";
import { UserIcon } from "@/components/docs/icons/UserIcon";
import { UsersIcon } from "@/components/docs/icons/UsersIcon";
import { type MotionValue, motion, useMotionTemplate, useMotionValue } from "framer-motion";
import Link from "next/link";
import { GridPattern } from "./GridPattern";
import { Heading } from "./Heading";
interface BestPractice {
href: string;
@@ -73,7 +73,7 @@ const bestPractices: Array<BestPractice> = [
function BestPracticeIcon({ icon: Icon }: { icon: BestPractice["icon"] }) {
return (
<div className="dark:bg-white/7.5 flex h-7 w-7 items-center justify-center rounded-full bg-slate-900/5 ring-1 ring-slate-900/25 backdrop-blur-[2px] transition duration-300 group-hover:bg-white/50 group-hover:ring-slate-900/25 dark:ring-white/15 dark:group-hover:bg-emerald-300/10 dark:group-hover:ring-emerald-400">
<div className="dark:bg-white/7.5 dark:ring-white/15 flex h-7 w-7 items-center justify-center rounded-full bg-slate-900/5 ring-1 ring-slate-900/25 backdrop-blur-[2px] transition duration-300 group-hover:bg-white/50 group-hover:ring-slate-900/25 dark:group-hover:bg-emerald-300/10 dark:group-hover:ring-emerald-400">
<Icon className="h-5 w-5 fill-slate-700/10 stroke-slate-700 transition-colors duration-300 group-hover:stroke-slate-900 dark:fill-white/10 dark:stroke-slate-400 dark:group-hover:fill-emerald-300/10 dark:group-hover:stroke-emerald-400" />
</div>
);
@@ -157,7 +157,7 @@ export default function BestPractices() {
<Heading level={2} id="resources">
Best Practices
</Heading>
<div className="not-prose mt-4 grid grid-cols-1 gap-8 border-t border-slate-900/5 pt-10 sm:grid-cols-2 xl:grid-cols-4 dark:border-white/5">
<div className="not-prose mt-4 grid grid-cols-1 gap-8 border-t border-slate-900/5 pt-10 dark:border-white/5 sm:grid-cols-2 xl:grid-cols-4">
{bestPractices.map((resource) => (
<BestPractice key={resource.href} resource={resource} />
))}

View File

@@ -1,5 +1,5 @@
import clsx from "clsx";
import Link from "next/link";
import clsx from "clsx";
function ArrowIcon(props: React.ComponentPropsWithoutRef<"svg">) {
return (

View File

@@ -1,11 +1,12 @@
"use client";
import { Tag } from "@/components/docs/Tag";
import { Children, createContext, isValidElement, useContext, useEffect, useRef, useState } from "react";
import { Tab } from "@headlessui/react";
import clsx from "clsx";
import { Children, createContext, isValidElement, useContext, useEffect, useRef, useState } from "react";
import { create } from "zustand";
import { Tag } from "@/components/docs/Tag";
const languageNames: Record<string, string> = {
js: "JavaScript",
ts: "TypeScript",

View File

@@ -1,9 +1,8 @@
"use client";
import { useState } from "react";
import { Button } from "@formbricks/ui/Button";
import { Popover, PopoverContent, PopoverTrigger } from "@formbricks/ui/Popover";
import { useState } from "react";
export const DocsFeedback: React.FC = () => {
const [isOpen, setIsOpen] = useState(false);

View File

@@ -1,9 +1,8 @@
"use client";
import { Transition } from "@headlessui/react";
import { forwardRef, Fragment, useState } from "react";
import { usePathname } from "next/navigation";
import { Fragment, forwardRef, useState } from "react";
import { Transition } from "@headlessui/react";
import { handleFeedbackSubmit } from "../../lib/handleFeedbackSubmit";
function CheckIcon(props: React.ComponentPropsWithoutRef<"svg">) {

View File

@@ -2,8 +2,7 @@
import Link from "next/link";
import { usePathname } from "next/navigation";
import { FaDiscord, FaGithub, FaXTwitter } from "react-icons/fa6";
import { FaGithub, FaXTwitter, FaDiscord } from "react-icons/fa6";
import { Button } from "./Button";
import { navigation } from "./Navigation";
@@ -89,7 +88,7 @@ function SmallPrint() {
const currentYear = new Date().getFullYear();
return (
<div className="flex flex-col items-center justify-between gap-5 border-t border-slate-900/5 pt-8 sm:flex-row dark:border-white/5">
<div className="flex flex-col items-center justify-between gap-5 border-t border-slate-900/5 pt-8 dark:border-white/5 sm:flex-row">
<p className="text-xs text-slate-600 dark:text-slate-400">
Formbricks GmbH &copy; {currentYear}. All rights reserved.
</p>

View File

@@ -31,7 +31,7 @@ export function GettingStarted() {
<Heading level={2} id="getting-started">
Quick Resources
</Heading>
<div className="not-prose mt-4 grid grid-cols-1 gap-8 border-t border-slate-900/5 pt-10 sm:grid-cols-2 xl:grid-cols-4 dark:border-white/5">
<div className="not-prose mt-4 grid grid-cols-1 gap-8 border-t border-slate-900/5 pt-10 dark:border-white/5 sm:grid-cols-2 xl:grid-cols-4">
{gettingStarted.map((guide) => (
<div key={guide.href}>
<h3 className="text-sm font-semibold text-slate-900 dark:text-white">{guide.name}</h3>

View File

@@ -1,11 +1,11 @@
"use client";
import { FooterLogo } from "@/components/shared/Logo";
import clsx from "clsx";
import { motion, useScroll, useTransform } from "framer-motion";
import Link from "next/link";
import { forwardRef } from "react";
import { FooterLogo } from "@/components/shared/Logo";
import { Button } from "./Button";
import { MobileNavigation, useIsInsideMobileNavigation, useMobileNavigationStore } from "./MobileNavigation";
import { MobileSearch, Search } from "./Search";
@@ -40,7 +40,7 @@ export const Header = forwardRef<React.ElementRef<"div">, { className?: string }
className={clsx(
className,
"fixed inset-x-0 top-0 z-50 flex h-20 items-center justify-between gap-12 px-4 transition sm:px-6 lg:left-72 lg:z-30 lg:px-8 xl:left-80",
!isInsideMobileNavigation && "backdrop-blur-sm lg:left-72 xl:left-80 dark:backdrop-blur",
!isInsideMobileNavigation && "backdrop-blur-sm dark:backdrop-blur lg:left-72 xl:left-80",
isInsideMobileNavigation
? "bg-white dark:bg-slate-900"
: "bg-white/[var(--bg-opacity-light)] dark:bg-slate-900/[var(--bg-opacity-dark)]"
@@ -73,7 +73,7 @@ export const Header = forwardRef<React.ElementRef<"div">, { className?: string }
<TopLevelNavItem href="https://formbricks.com/discord">Join our Discord</TopLevelNavItem>
</ul>
</nav>
<div className="hidden md:block md:h-5 md:w-px md:bg-slate-900/10 md:dark:bg-white/15" />
<div className="md:dark:bg-white/15 hidden md:block md:h-5 md:w-px md:bg-slate-900/10" />
<div className="flex gap-4">
<MobileSearch />
<ThemeToggle />

View File

@@ -1,13 +1,13 @@
"use client";
import { remToPx } from "@/lib/remToPx";
import { useInView } from "framer-motion";
import Link from "next/link";
import { usePathname } from "next/navigation";
import { useEffect, useRef } from "react";
import { remToPx } from "@/lib/remToPx";
import { useSectionStore } from "./SectionProvider";
import { Tag } from "./Tag";
import { usePathname } from "next/navigation";
function AnchorIcon(props: React.ComponentPropsWithoutRef<"svg">) {
return (

View File

@@ -1,14 +1,14 @@
"use client";
import { Navigation } from "@/components/docs/Navigation";
import { FooterLogo } from "@/components/shared/Logo";
import { motion } from "framer-motion";
import Link from "next/link";
import { usePathname } from "next/navigation";
import { motion } from "framer-motion";
import { Footer } from "./Footer";
import { Header } from "./Header";
import { type Section, SectionProvider } from "./SectionProvider";
import { FooterLogo } from "@/components/shared/Logo";
import { Navigation } from "@/components/docs/Navigation";
export function Layout({
children,
@@ -25,7 +25,7 @@ export function Layout({
<motion.header
layoutScroll
className="contents lg:pointer-events-none lg:fixed lg:inset-0 lg:z-40 lg:flex">
<div className="contents lg:pointer-events-auto lg:block lg:w-72 lg:overflow-y-auto lg:border-r lg:border-slate-900/10 lg:px-6 lg:pb-8 lg:pt-4 xl:w-80 lg:dark:border-white/10">
<div className="contents lg:pointer-events-auto lg:block lg:w-72 lg:overflow-y-auto lg:border-r lg:border-slate-900/10 lg:px-6 lg:pb-8 lg:pt-4 lg:dark:border-white/10 xl:w-80">
<div className="hidden lg:flex">
<Link href="/" aria-label="Home">
<FooterLogo className="h-8" />

View File

@@ -1,9 +1,9 @@
import Image from "next/image";
import logoHtml from "@/images/logos/html5.svg";
import logoNextjs from "@/images/logos/nextjs.svg";
import logoReactJs from "@/images/logos/reactjs.svg";
import logoVueJs from "@/images/logos/vuejs.svg";
import Image from "next/image";
import { Button } from "./Button";
const libraries = [
@@ -37,7 +37,7 @@ const libraries = [
export function Libraries() {
return (
<div className="my-16 xl:max-w-none">
<div className="not-prose mt-4 grid grid-cols-1 gap-x-6 gap-y-10 border-slate-900/5 sm:grid-cols-2 xl:max-w-none xl:grid-cols-3 dark:border-white/5">
<div className="not-prose mt-4 grid grid-cols-1 gap-x-6 gap-y-10 border-slate-900/5 dark:border-white/5 sm:grid-cols-2 xl:max-w-none xl:grid-cols-3">
{libraries.map((library) => (
<a
key={library.name}

View File

@@ -1,12 +1,12 @@
"use client";
import { Header } from "@/components/docs/Header";
import { createContext, Fragment, Suspense, useContext, useEffect, useRef } from "react";
import { usePathname, useSearchParams } from "next/navigation";
import { Dialog, Transition } from "@headlessui/react";
import { motion } from "framer-motion";
import { usePathname, useSearchParams } from "next/navigation";
import { Fragment, Suspense, createContext, useContext, useEffect, useRef } from "react";
import { create } from "zustand";
import { Header } from "@/components/docs/Header";
import { Navigation } from "./Navigation";
function MenuIcon(props: React.ComponentPropsWithoutRef<"svg">) {
@@ -90,7 +90,7 @@ function MobileNavigationDialog({ isOpen, close }: { isOpen: boolean; close: ()
leaveTo="-translate-x-full">
<motion.div
layoutScroll
className="ring-slate-900/7.5 fixed bottom-0 left-0 top-14 w-full overflow-y-auto bg-white px-4 pb-4 pt-6 shadow-lg shadow-slate-900/10 ring-1 min-[416px]:max-w-sm sm:px-6 sm:pb-10 dark:bg-slate-900 dark:ring-slate-800">
className="ring-slate-900/7.5 fixed bottom-0 left-0 top-14 w-full overflow-y-auto bg-white px-4 pb-4 pt-6 shadow-lg shadow-slate-900/10 ring-1 dark:bg-slate-900 dark:ring-slate-800 min-[416px]:max-w-sm sm:px-6 sm:pb-10">
<Navigation />
</motion.div>
</Transition.Child>

View File

@@ -1,12 +1,12 @@
"use client";
import { remToPx } from "@/lib/remToPx";
import clsx from "clsx";
import { AnimatePresence, motion, useIsPresent } from "framer-motion";
import Link from "next/link";
import { usePathname } from "next/navigation";
import { useRef } from "react";
import { remToPx } from "@/lib/remToPx";
import { Button } from "./Button";
import { useIsInsideMobileNavigation } from "./MobileNavigation";
import { useSectionStore } from "./SectionProvider";
@@ -212,14 +212,6 @@ export const navigation: Array<NavGroup> = [
{ title: "Code Actions", href: "/docs/actions/code" },
],
},
{
title: "Link Surveys",
links: [
{ title: "Data Prefilling", href: "/docs/link-surveys/data-prefilling" },
{ title: "Identify Users", href: "/docs/link-surveys/user-identification" },
{ title: "Single Use Links", href: "/docs/link-surveys/single-use-links" },
],
},
{
title: "Best Practices",
links: [
@@ -237,20 +229,27 @@ export const navigation: Array<NavGroup> = [
links: [
{ title: "Airtable", href: "/docs/integrations/airtable" },
{ title: "Google Sheets", href: "/docs/integrations/google-sheets" },
{ title: "Notion", href: "/docs/integrations/notion" },
{ title: "Make.com", href: "/docs/integrations/make" },
{ title: "n8n", href: "/docs/integrations/n8n" },
{ title: "Zapier", href: "/docs/integrations/zapier" },
],
},
{
title: "Link Surveys",
links: [
{ title: "Data Prefilling", href: "/docs/link-surveys/data-prefilling" },
{ title: "User Identification", href: "/docs/link-surveys/user-identification" },
{ title: "Single Use Links", href: "/docs/link-surveys/single-use-links" },
],
},
{
title: "Self-hosting",
links: [
{ title: "Introduction", href: "/docs/self-hosting/deployment" },
{ title: "One-Click Setup", href: "/docs/self-hosting/production" },
{ title: "Advanced Setup", href: "/docs/self-hosting/docker" },
{ title: "Configure", href: "/docs/self-hosting/external-auth-providers" },
{ title: "Deployment", href: "/docs/self-hosting/deployment" },
{ title: "Production", href: "/docs/self-hosting/production" },
{ title: "Docker", href: "/docs/self-hosting/docker" },
{ title: "Migration Guide", href: "/docs/self-hosting/migration-guide" },
{ title: "External auth providers", href: "/docs/self-hosting/external-auth-providers" },
],
},
{

View File

@@ -1,18 +1,19 @@
"use client";
import { navigation } from "@/components/docs/Navigation";
import { type Result } from "@/mdx/search.mjs";
import { forwardRef, Fragment, Suspense, useCallback, useEffect, useId, useRef, useState } from "react";
import Highlighter from "react-highlight-words";
import { usePathname, useRouter, useSearchParams } from "next/navigation";
import {
type AutocompleteApi,
type AutocompleteCollection,
type AutocompleteState,
createAutocomplete,
type AutocompleteState,
type AutocompleteCollection,
} from "@algolia/autocomplete-core";
import { Dialog, Transition } from "@headlessui/react";
import clsx from "clsx";
import { usePathname, useRouter, useSearchParams } from "next/navigation";
import { Fragment, Suspense, forwardRef, useCallback, useEffect, useId, useRef, useState } from "react";
import Highlighter from "react-highlight-words";
import { type Result } from "@/mdx/search.mjs";
import { navigation } from "@/components/docs/Navigation";
type EmptyObject = Record<string, never>;
@@ -243,7 +244,7 @@ const SearchInput = forwardRef<
<input
ref={inputRef}
className={clsx(
"flex-auto appearance-none bg-transparent pl-10 text-slate-900 outline-none placeholder:text-slate-500 focus:w-full focus:flex-none sm:text-sm dark:text-white [&::-webkit-search-cancel-button]:hidden [&::-webkit-search-decoration]:hidden [&::-webkit-search-results-button]:hidden [&::-webkit-search-results-decoration]:hidden",
"flex-auto appearance-none bg-transparent pl-10 text-slate-900 outline-none placeholder:text-slate-500 focus:w-full focus:flex-none dark:text-white sm:text-sm [&::-webkit-search-cancel-button]:hidden [&::-webkit-search-decoration]:hidden [&::-webkit-search-results-button]:hidden [&::-webkit-search-results-decoration]:hidden",
autocompleteState.status === "stalled" ? "pr-11" : "pr-4"
)}
{...inputProps}
@@ -336,7 +337,7 @@ function SearchDialog({
leave="ease-in duration-200"
leaveFrom="opacity-100 scale-100"
leaveTo="opacity-0 scale-95">
<Dialog.Panel className="ring-slate-900/7.5 mx-auto transform-gpu overflow-hidden rounded-lg bg-slate-50 shadow-xl ring-1 sm:max-w-xl dark:bg-slate-900 dark:ring-slate-800">
<Dialog.Panel className="ring-slate-900/7.5 mx-auto transform-gpu overflow-hidden rounded-lg bg-slate-50 shadow-xl ring-1 dark:bg-slate-900 dark:ring-slate-800 sm:max-w-xl">
<div {...autocomplete.getRootProps({})}>
<form
ref={formRef}
@@ -409,7 +410,7 @@ export function Search() {
<div className="hidden lg:block lg:max-w-md lg:flex-auto">
<button
type="button"
className="ui-not-focus-visible:outline-none hidden h-8 w-full items-center gap-2 rounded-full bg-white pl-2 pr-3 text-sm text-slate-500 ring-1 ring-slate-900/10 transition hover:ring-slate-900/20 lg:flex dark:bg-white/5 dark:text-slate-400 dark:ring-inset dark:ring-white/10 dark:hover:ring-white/20"
className="ui-not-focus-visible:outline-none hidden h-8 w-full items-center gap-2 rounded-full bg-white pl-2 pr-3 text-sm text-slate-500 ring-1 ring-slate-900/10 transition hover:ring-slate-900/20 dark:bg-white/5 dark:text-slate-400 dark:ring-inset dark:ring-white/10 dark:hover:ring-white/20 lg:flex"
{...buttonProps}>
<SearchIcon className="h-5 w-5 stroke-current" />
Find something...
@@ -432,7 +433,7 @@ export function MobileSearch() {
<div className="contents lg:hidden">
<button
type="button"
className="ui-not-focus-visible:outline-none flex h-6 w-6 items-center justify-center rounded-md transition hover:bg-slate-900/5 lg:hidden dark:hover:bg-white/5"
className="ui-not-focus-visible:outline-none flex h-6 w-6 items-center justify-center rounded-md transition hover:bg-slate-900/5 dark:hover:bg-white/5 lg:hidden"
aria-label="Find something..."
{...buttonProps}>
<SearchIcon className="h-5 w-5 stroke-slate-900 dark:stroke-white" />

View File

@@ -1,9 +1,10 @@
"use client";
import { remToPx } from "@/lib/remToPx";
import { createContext, useContext, useEffect, useLayoutEffect, useState } from "react";
import { type StoreApi, createStore, useStore } from "zustand";
import { remToPx } from "@/lib/remToPx";
export interface Section {
id: string;
title: string;

View File

@@ -1,7 +1,7 @@
"use client";
import { useTheme } from "next-themes";
import { useEffect, useState } from "react";
import { useTheme } from "next-themes";
function SunIcon(props: React.ComponentPropsWithoutRef<"svg">) {
return (

View File

@@ -1,5 +1,4 @@
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "@formbricks/ui/Accordion";
import FaqJsonLdComponent from "./faQJsonLD";
const FAQ_DATA = [
@@ -46,15 +45,6 @@ const FAQ_DATA = [
</>
),
},
{
question: "How can I change Button texts in my survey?",
answer: () => (
<>
For the question that you want to change the button text, click on the <b>Show Advanced Settings</b>{" "}
toggle and change the button label in the <b>Button Text</b> field.
</>
),
},
];
export const faqJsonLdData = FAQ_DATA.map((faq) => ({

View File

@@ -1,7 +1,7 @@
import { Feedback } from "@/components/docs/Feedback";
import clsx from "clsx";
import Link from "next/link";
import clsx from "clsx";
import { Feedback } from "@/components/docs/Feedback";
import { Heading } from "./Heading";
import { Prose } from "./Prose";

View File

@@ -1,8 +1,7 @@
import { PlusIcon, TrashIcon } from "@heroicons/react/24/solid";
import { useState } from "react";
import { Button } from "@formbricks/ui/Button";
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@formbricks/ui/Select";
import { PlusIcon, TrashIcon } from "@heroicons/react/24/solid";
import { useState } from "react";
const DummyUI: React.FC = () => {
const actionClasses = [

View File

@@ -1,11 +1,10 @@
import { CursorArrowRaysIcon } from "@heroicons/react/24/solid";
import { Button } from "@formbricks/ui/Button";
import { Input } from "@formbricks/ui/Input";
import { Label } from "@formbricks/ui/Label";
import { Modal } from "@formbricks/ui/Modal";
import { RadioGroup, RadioGroupItem } from "@formbricks/ui/RadioGroup";
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@formbricks/ui/Select";
import { Button } from "@formbricks/ui/Button";
import { Label } from "@formbricks/ui/Label";
import { Input } from "@formbricks/ui/Input";
import { RadioGroup, RadioGroupItem } from "@formbricks/ui/RadioGroup";
import { CursorArrowRaysIcon } from "@heroicons/react/24/solid";
import { Modal } from "@formbricks/ui/Modal";
interface EventDetailModalProps {
open: boolean;
@@ -55,7 +54,7 @@ export const AddNoCodeEventModalDummy: React.FC<EventDetailModalProps> = ({ open
Inner Text
</Label>
</div>
<div className="hidden items-center space-x-2 rounded-lg bg-slate-50 p-3 md:flex dark:bg-slate-600">
<div className="hidden items-center space-x-2 rounded-lg bg-slate-50 p-3 dark:bg-slate-600 md:flex">
<RadioGroupItem disabled value="cssSelector" id="cssSelector" className="bg-slate-50" />
<Label
htmlFor="cssSelector"
@@ -80,7 +79,7 @@ export const AddNoCodeEventModalDummy: React.FC<EventDetailModalProps> = ({ open
<Label>URL</Label>
<Select defaultValue="endsWith">
<SelectTrigger
className="w-[110px] md:w-[180px] dark:text-slate-200"
className="w-[110px] dark:text-slate-200 md:w-[180px]"
onClick={(e) => e.preventDefault()}
disabled>
<SelectValue placeholder="Select match type" />

View File

@@ -1,5 +1,4 @@
import { TSurveyCTAQuestion } from "@formbricks/types/surveys";
import Headline from "./Headline";
import HtmlBody from "./HtmlBody";

View File

@@ -1,11 +1,8 @@
"use client";
import React, { useEffect, useState } from "react";
import { TTemplate } from "@formbricks/types/templates";
import PreviewSurvey from "./PreviewSurvey";
import { findTemplateByName } from "./templates";
import { TTemplate } from "@formbricks/types/templates";
interface DemoPreviewProps {
template: string;

View File

@@ -1,7 +1,5 @@
import { useEffect, useState } from "react";
import { TTemplate } from "@formbricks/types/templates";
import { useEffect, useState } from "react";
import PreviewSurvey from "./PreviewSurvey";
import TemplateList from "./TemplateList";
import { templates } from "./templates";
@@ -27,7 +25,7 @@ export default function SurveyTemplatesPage({}) {
setActiveTemplate(template);
}}
/>
<aside className="group relative h-full flex-1 flex-shrink-0 overflow-hidden rounded-r-lg bg-slate-200 shadow-inner md:flex md:flex-col dark:bg-slate-700">
<aside className="group relative h-full flex-1 flex-shrink-0 overflow-hidden rounded-r-lg bg-slate-200 shadow-inner dark:bg-slate-700 md:flex md:flex-col">
{activeTemplate && (
<PreviewSurvey
activeQuestionId={activeQuestionId}

View File

@@ -1,5 +1,4 @@
import { ReactNode, useEffect, useState } from "react";
import { cn } from "@formbricks/lib/cn";
export default function Modal({
@@ -22,7 +21,7 @@ export default function Modal({
<div
className={cn(
show ? "translate-x-0 opacity-100" : "translate-x-28 opacity-0",
"pointer-events-auto w-full max-w-sm overflow-hidden rounded-lg bg-white px-4 py-6 shadow-lg ring-1 ring-black ring-opacity-5 transition-all duration-500 ease-in-out sm:p-6 dark:bg-slate-900"
"pointer-events-auto w-full max-w-sm overflow-hidden rounded-lg bg-white px-4 py-6 shadow-lg ring-1 ring-black ring-opacity-5 transition-all duration-500 ease-in-out dark:bg-slate-900 sm:p-6"
)}>
{children}
</div>

View File

@@ -1,8 +1,6 @@
import { useEffect, useState } from "react";
import { useState, useEffect } from "react";
import { cn } from "@formbricks/lib/cn";
import { TSurveyMultipleChoiceMultiQuestion } from "@formbricks/types/surveys";
import Headline from "./Headline";
import Subheader from "./Subheader";

View File

@@ -1,8 +1,6 @@
import { useState } from "react";
import { cn } from "@formbricks/lib/cn";
import { TSurveyMultipleChoiceSingleQuestion } from "@formbricks/types/surveys";
import { useState } from "react";
import Headline from "./Headline";
import Subheader from "./Subheader";

View File

@@ -1,8 +1,6 @@
import { useState } from "react";
import { cn } from "@formbricks/lib/cn";
import { TSurveyNPSQuestion } from "@formbricks/types/surveys";
import Headline from "./Headline";
import Subheader from "./Subheader";

View File

@@ -1,7 +1,5 @@
import { useState } from "react";
import { TSurveyOpenTextQuestion } from "@formbricks/types/surveys";
import { useState } from "react";
import Headline from "./Headline";
import Subheader from "./Subheader";
@@ -42,7 +40,7 @@ export default function OpenTextQuestion({
onChange={(e) => setValue(e.target.value)}
placeholder={question.placeholder}
required={question.required}
className="block w-full rounded-md border border-slate-100 bg-slate-50 p-2 shadow-sm focus:border-slate-500 focus:ring-0 sm:text-sm dark:border-slate-500 dark:bg-slate-700 dark:text-white"></textarea>
className="block w-full rounded-md border border-slate-100 bg-slate-50 p-2 shadow-sm focus:border-slate-500 focus:ring-0 dark:border-slate-500 dark:bg-slate-700 dark:text-white sm:text-sm"></textarea>
</div>
<div className="mt-4 flex w-full justify-between">
<div></div>

View File

@@ -1,9 +1,7 @@
import { useState } from "react";
import { TSurvey, TSurveyQuestion } from "@formbricks/types/surveys";
import Modal from "./Modal";
import QuestionConditional from "./QuestionConditional";
import { TSurveyQuestion, TSurvey } from "@formbricks/types/surveys";
import ThankYouCard from "./ThankYouCard";
interface PreviewSurveyProps {

View File

@@ -1,10 +1,9 @@
import { TSurveyQuestion, TSurveyQuestionType } from "@formbricks/types/surveys";
import CTAQuestion from "./CTAQuestion";
import MultipleChoiceMultiQuestion from "./MultipleChoiceMultiQuestion";
import MultipleChoiceSingleQuestion from "./MultipleChoiceSingleQuestion";
import NPSQuestion from "./NPSQuestion";
import OpenTextQuestion from "./OpenTextQuestion";
import MultipleChoiceSingleQuestion from "./MultipleChoiceSingleQuestion";
import MultipleChoiceMultiQuestion from "./MultipleChoiceMultiQuestion";
import NPSQuestion from "./NPSQuestion";
import CTAQuestion from "./CTAQuestion";
import RatingQuestion from "./RatingQuestion";
interface QuestionConditionalProps {

View File

@@ -1,8 +1,6 @@
import { useState } from "react";
import { cn } from "@formbricks/lib/cn";
import { TSurveyRatingQuestion } from "@formbricks/types/surveys";
import { useState } from "react";
import { cn } from "@formbricks/lib/cn";
import Headline from "./Headline";
import Subheader from "./Subheader";

View File

@@ -1,8 +1,6 @@
import { useEffect, useState } from "react";
import { cn } from "@formbricks/lib/cn";
import { TTemplate } from "@formbricks/types/templates";
import { useEffect, useState } from "react";
import { cn } from "@formbricks/lib/cn";
import { templates } from "./templates";
type TemplateList = {

View File

@@ -1,7 +1,3 @@
import { createId } from "@paralleldrive/cuid2";
import { TSurveyQuestionType } from "@formbricks/types/surveys";
import { TTemplate } from "@formbricks/types/templates";
import {
AppPieChartIcon,
ArrowRightCircleIcon,
@@ -26,18 +22,16 @@ import {
VideoTabletAdjustIcon,
} from "@formbricks/ui/icons";
import { createId } from "@paralleldrive/cuid2";
import { TTemplate } from "@formbricks/types/templates";
import { TSurveyQuestionType } from "@formbricks/types/surveys";
const thankYouCardDefault = {
enabled: true,
headline: "Thank you!",
subheader: "We appreciate your feedback.",
};
const welcomeCardDefault = {
enabled: true,
timeToFinish: false,
showResponseCount: false,
};
export const customSurvey: TTemplate = {
name: "Start from scratch",
description: "Create a survey without template.",
@@ -57,7 +51,10 @@ export const customSurvey: TTemplate = {
},
],
thankYouCard: thankYouCardDefault,
welcomeCard: welcomeCardDefault,
welcomeCard: {
enabled: false,
timeToFinish: false,
},
hiddenFields: {
enabled: false,
},
@@ -153,7 +150,10 @@ export const templates: TTemplate[] = [
},
],
thankYouCard: thankYouCardDefault,
welcomeCard: welcomeCardDefault,
welcomeCard: {
enabled: false,
timeToFinish: false,
},
hiddenFields: {
enabled: false,
},
@@ -260,7 +260,10 @@ export const templates: TTemplate[] = [
},
],
thankYouCard: thankYouCardDefault,
welcomeCard: welcomeCardDefault,
welcomeCard: {
enabled: false,
timeToFinish: false,
},
hiddenFields: {
enabled: false,
},
@@ -337,7 +340,10 @@ export const templates: TTemplate[] = [
},
],
thankYouCard: thankYouCardDefault,
welcomeCard: welcomeCardDefault,
welcomeCard: {
enabled: false,
timeToFinish: false,
},
hiddenFields: {
enabled: false,
},
@@ -383,7 +389,10 @@ export const templates: TTemplate[] = [
},
],
thankYouCard: thankYouCardDefault,
welcomeCard: welcomeCardDefault,
welcomeCard: {
enabled: false,
timeToFinish: false,
},
hiddenFields: {
enabled: false,
},
@@ -438,7 +447,10 @@ export const templates: TTemplate[] = [
},
],
thankYouCard: thankYouCardDefault,
welcomeCard: welcomeCardDefault,
welcomeCard: {
enabled: false,
timeToFinish: false,
},
hiddenFields: {
enabled: false,
},
@@ -501,7 +513,10 @@ export const templates: TTemplate[] = [
},
],
thankYouCard: thankYouCardDefault,
welcomeCard: welcomeCardDefault,
welcomeCard: {
enabled: false,
timeToFinish: false,
},
hiddenFields: {
enabled: false,
},
@@ -567,7 +582,10 @@ export const templates: TTemplate[] = [
},
],
thankYouCard: thankYouCardDefault,
welcomeCard: welcomeCardDefault,
welcomeCard: {
enabled: false,
timeToFinish: false,
},
hiddenFields: {
enabled: false,
},
@@ -622,7 +640,10 @@ export const templates: TTemplate[] = [
},
],
thankYouCard: thankYouCardDefault,
welcomeCard: welcomeCardDefault,
welcomeCard: {
enabled: false,
timeToFinish: false,
},
hiddenFields: {
enabled: false,
},
@@ -664,7 +685,10 @@ export const templates: TTemplate[] = [
},
],
thankYouCard: thankYouCardDefault,
welcomeCard: welcomeCardDefault,
welcomeCard: {
enabled: false,
timeToFinish: false,
},
hiddenFields: {
enabled: false,
},
@@ -699,7 +723,10 @@ export const templates: TTemplate[] = [
},
],
thankYouCard: thankYouCardDefault,
welcomeCard: welcomeCardDefault,
welcomeCard: {
enabled: false,
timeToFinish: false,
},
hiddenFields: {
enabled: false,
},
@@ -725,7 +752,10 @@ export const templates: TTemplate[] = [
},
],
thankYouCard: thankYouCardDefault,
welcomeCard: welcomeCardDefault,
welcomeCard: {
enabled: false,
timeToFinish: false,
},
hiddenFields: {
enabled: false,
},
@@ -773,7 +803,10 @@ export const templates: TTemplate[] = [
},
],
thankYouCard: thankYouCardDefault,
welcomeCard: welcomeCardDefault,
welcomeCard: {
enabled: false,
timeToFinish: false,
},
hiddenFields: {
enabled: false,
},
@@ -815,7 +848,10 @@ export const templates: TTemplate[] = [
},
],
thankYouCard: thankYouCardDefault,
welcomeCard: welcomeCardDefault,
welcomeCard: {
enabled: false,
timeToFinish: false,
},
hiddenFields: {
enabled: false,
},
@@ -869,7 +905,10 @@ export const templates: TTemplate[] = [
},
],
thankYouCard: thankYouCardDefault,
welcomeCard: welcomeCardDefault,
welcomeCard: {
enabled: false,
timeToFinish: false,
},
hiddenFields: {
enabled: false,
},
@@ -922,7 +961,10 @@ export const templates: TTemplate[] = [
},
],
thankYouCard: thankYouCardDefault,
welcomeCard: welcomeCardDefault,
welcomeCard: {
enabled: false,
timeToFinish: false,
},
hiddenFields: {
enabled: false,
},
@@ -971,7 +1013,10 @@ export const templates: TTemplate[] = [
},
],
thankYouCard: thankYouCardDefault,
welcomeCard: welcomeCardDefault,
welcomeCard: {
enabled: false,
timeToFinish: false,
},
hiddenFields: {
enabled: false,
},
@@ -998,7 +1043,10 @@ export const templates: TTemplate[] = [
},
],
thankYouCard: thankYouCardDefault,
welcomeCard: welcomeCardDefault,
welcomeCard: {
enabled: false,
timeToFinish: false,
},
hiddenFields: {
enabled: false,
},
@@ -1023,7 +1071,10 @@ export const templates: TTemplate[] = [
},
],
thankYouCard: thankYouCardDefault,
welcomeCard: welcomeCardDefault,
welcomeCard: {
enabled: false,
timeToFinish: false,
},
hiddenFields: {
enabled: false,
},
@@ -1047,7 +1098,10 @@ export const templates: TTemplate[] = [
},
],
thankYouCard: thankYouCardDefault,
welcomeCard: welcomeCardDefault,
welcomeCard: {
enabled: false,
timeToFinish: false,
},
hiddenFields: {
enabled: false,
},
@@ -1088,7 +1142,10 @@ export const templates: TTemplate[] = [
},
],
thankYouCard: thankYouCardDefault,
welcomeCard: welcomeCardDefault,
welcomeCard: {
enabled: false,
timeToFinish: false,
},
hiddenFields: {
enabled: false,
},
@@ -1122,7 +1179,10 @@ export const templates: TTemplate[] = [
},
],
thankYouCard: thankYouCardDefault,
welcomeCard: welcomeCardDefault,
welcomeCard: {
enabled: false,
timeToFinish: false,
},
hiddenFields: {
enabled: false,
},
@@ -1156,7 +1216,10 @@ export const templates: TTemplate[] = [
},
],
thankYouCard: thankYouCardDefault,
welcomeCard: welcomeCardDefault,
welcomeCard: {
enabled: false,
timeToFinish: false,
},
hiddenFields: {
enabled: false,
},
@@ -1208,17 +1271,12 @@ export const templates: TTemplate[] = [
buttonUrl: "https://app.formbricks.com/auth/signup",
buttonExternal: true,
},
{
id: createId(),
type: TSurveyQuestionType.FileUpload,
headline: "Upload file",
required: false,
allowMultipleFiles: false,
maxSizeInMB: 10,
},
],
thankYouCard: thankYouCardDefault,
welcomeCard: welcomeCardDefault,
welcomeCard: {
enabled: false,
timeToFinish: false,
},
hiddenFields: {
enabled: false,
},

View File

@@ -1,6 +1,6 @@
import HeadingCentered from "@/components/shared/HeadingCentered";
import { FAQPageJsonLd } from "next-seo";
import HeadingCentered from "@/components/shared/HeadingCentered";
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "@formbricks/ui/Accordion";
const FAQ_DATA = [

View File

@@ -1,5 +1,4 @@
import { CodeFileIcon, EyeIcon, HandPuzzleIcon } from "@formbricks/ui/icons";
import HeadingCentered from "../shared/HeadingCentered";
const features = [

View File

@@ -1,3 +1,5 @@
import PHIcon from "@/images/formtribe/ph-logo.png";
import Image from "next/image";
import Link from "next/link";
export const GitHubSponsorship: React.FC = () => {
@@ -20,7 +22,7 @@ export const GitHubSponsorship: React.FC = () => {
/> */}
<div className="col-span-2">
<h2 className="text-2xl font-bold tracking-tight text-slate-800 lg:text-2xl dark:text-slate-200">
<h2 className="text-2xl font-bold tracking-tight text-slate-800 dark:text-slate-200 lg:text-2xl">
We are live on ProductHunt today 🚀
</h2>
<p className="lg:text-md mt-2 max-w-3xl text-slate-500 dark:text-slate-400">
@@ -36,7 +38,7 @@ export const GitHubSponsorship: React.FC = () => {
</p>
</div>
<div className="flex items-center justify-end">
{/* <Image src={PHIcon} alt="Product Hunt Logo" width={80} className="" /> */}
<Image src={PHIcon} alt="Product Hunt Logo" width={80} className="" />
</div>
</div>
</Link>

View File

@@ -1,18 +1,16 @@
import CalLogoDark from "@/images/clients/cal-logo-dark.svg";
import CalLogoLight from "@/images/clients/cal-logo-light.svg";
import ClovyrLogo from "@/images/clients/clovyr-logo.svg";
import CrowdLogoDark from "@/images/clients/crowd-logo-dark.svg";
import CrowdLogoLight from "@/images/clients/crowd-logo-light.svg";
import FlixbusLogo from "@/images/clients/flixbus-white.svg";
import NILogoDark from "@/images/clients/niLogoDark.svg";
import NILogoLight from "@/images/clients/niLogoWhite.svg";
import AnimationFallback from "@/public/animations/opensource-xm-platform-formbricks-fallback.png";
import { Button } from "@formbricks/ui/Button";
import { ChevronRightIcon } from "@heroicons/react/24/outline";
import { usePlausible } from "next-plausible";
import Image from "next/image";
import { useRouter } from "next/router";
import { Button } from "@formbricks/ui/Button";
import HeroAnimation from "./HeroAnimation";
export const Hero: React.FC = ({}) => {
@@ -28,60 +26,60 @@ export const Hero: React.FC = ({}) => {
We&apos;re Open Source - Star us on GitHub
<ChevronRightIcon className="mb-1 ml-1 inline h-4 w-4 text-slate-300" />
</a>
<h1 className="mt-10 text-3xl font-bold tracking-tight text-slate-800 sm:text-4xl md:text-5xl dark:text-slate-200">
<span className="xl:inline">Privacy-first Experience Management</span>
<h1 className="mt-10 text-3xl font-bold tracking-tight text-slate-800 dark:text-slate-200 sm:text-4xl md:text-5xl">
<span className="xl:inline">The Open Source Survey Suite</span>
</h1>
<p className="xs:max-w-none mx-auto mt-3 max-w-xs text-base text-slate-500 sm:text-lg md:mt-5 md:text-xl dark:text-slate-400">
Turn customer insights into irresistible experiences {" "}
<p className="xs:max-w-none mx-auto mt-3 max-w-xs text-base text-slate-500 dark:text-slate-400 sm:text-lg md:mt-5 md:text-xl">
Run link surveys, in-app surveys and email surveys in one app {" "}
<span className="decoration-brand-dark underline underline-offset-4">all privacy-first.</span>
</p>
<div className="mx-auto mt-5 max-w-2xl items-center px-4 sm:flex sm:justify-center md:mt-6 md:space-x-8 md:px-0">
<p className="hidden whitespace-nowrap pt-3 text-xs text-slate-400 md:block dark:text-slate-500">
<p className="hidden whitespace-nowrap pt-3 text-xs text-slate-400 dark:text-slate-500 md:block">
Trusted by
</p>
<div className="grid grid-cols-4 items-center gap-6 pt-2 md:gap-8">
<Image
src={FlixbusLogo}
alt="Flixbus Flix Flixtrain Logo"
className="rounded-lg pb-1 hover:opacity-100 md:opacity-50"
width={200}
/>
<Image
src={CalLogoLight}
alt="Cal Logo"
className="block rounded-lg hover:opacity-100 md:opacity-50 dark:hidden"
className="block rounded-lg hover:opacity-100 dark:hidden md:opacity-50"
width={170}
/>
<Image
src={CalLogoDark}
alt="Cal Logo"
className="hidden rounded-lg hover:opacity-100 md:opacity-50 dark:block"
className="hidden rounded-lg hover:opacity-100 dark:block md:opacity-50"
width={170}
/>
<Image
src={CrowdLogoLight}
alt="Crowd.dev Logo"
className="block rounded-lg pb-1 hover:opacity-100 md:opacity-50 dark:hidden"
className="block rounded-lg pb-1 hover:opacity-100 dark:hidden md:opacity-50"
width={200}
/>
<Image
src={CrowdLogoDark}
alt="Crowd.dev Logo"
className="hidden rounded-lg pb-1 hover:opacity-100 md:opacity-50 dark:block"
className="hidden rounded-lg pb-1 hover:opacity-100 dark:block md:opacity-50"
width={200}
/>
<Image
src={NILogoDark}
alt="Neverinstall Logo"
className="block pb-1 hover:opacity-100 md:opacity-50 dark:hidden"
className="block pb-1 hover:opacity-100 dark:hidden md:opacity-50"
width={200}
/>
<Image
src={NILogoLight}
alt="Neverinstall Logo"
className="hidden pb-1 hover:opacity-100 md:opacity-50 dark:block"
className="hidden pb-1 hover:opacity-100 dark:block md:opacity-50"
width={200}
/>
<Image
src={ClovyrLogo}
alt="Clovyr Logo"
className="rounded-lg pb-1 hover:opacity-100 md:opacity-50"
width={200}
/>
</div>
@@ -94,7 +92,7 @@ export const Hero: React.FC = ({}) => {
router.push("https://app.formbricks.com/auth/signup");
plausible("Hero_CTA_CreateSurvey");
}}>
Get started
Create survey
</Button>
<Button
variant="secondary"

View File

@@ -21,7 +21,7 @@ export const Highlights: React.FC = ({}) => {
significantly higher conversion rate.
</p>
</div>
<div className="rounded-lg bg-slate-100 py-6 pr-4 sm:py-16 sm:pr-8 dark:bg-slate-800">
<div className="rounded-lg bg-slate-100 py-6 pr-4 dark:bg-slate-800 sm:py-16 sm:pr-8">
<Image
src={ImageEventTriggerLight}
alt="react library"
@@ -39,7 +39,7 @@ export const Highlights: React.FC = ({}) => {
<div className="mx-auto mb-12 mt-8 max-w-lg md:mb-0 md:mt-32 md:max-w-none">
<div className="px-4 sm:max-w-4xl sm:px-6 lg:max-w-7xl lg:px-8">
<div className="grid md:grid-cols-2 md:items-center md:gap-16">
<div className="order-last rounded-lg bg-slate-100 p-4 sm:p-8 md:order-first dark:bg-slate-800">
<div className="order-last rounded-lg bg-slate-100 p-4 dark:bg-slate-800 sm:p-8 md:order-first">
<Image
src={ImageAttributesLight}
alt="react library"
@@ -48,7 +48,7 @@ export const Highlights: React.FC = ({}) => {
<Image src={ImageAttributesDark} alt="react library" className="hidden rounded-lg dark:block" />
</div>
<div className="pb-8 md:pb-0">
<h2 className="xs:text-3xl text-2xl font-bold leading-7 tracking-tight text-slate-800 sm:text-3xl dark:text-slate-100">
<h2 className="xs:text-3xl text-2xl font-bold leading-7 tracking-tight text-slate-800 dark:text-slate-100 sm:text-3xl">
Don&apos;t Spray and pray.
<br />
<span className="font-light">Pre-segment granularly.</span>

View File

@@ -1,9 +1,8 @@
import { Button } from "@formbricks/ui/Button";
import { ArrowUpIcon } from "@heroicons/react/24/solid";
import throttle from "lodash/throttle";
import { useCallback, useEffect, useState } from "react";
import { Button } from "@formbricks/ui/Button";
const ScrollToTopButton = () => {
const [visible, setVisible] = useState(false);

View File

@@ -1,7 +1,6 @@
import clsx from "clsx";
import { useState } from "react";
import { IoLogoHtml5, IoLogoNpm } from "react-icons/io5";
import CodeBlock from "../shared/CodeBlock";
interface SecondNavbarProps {
@@ -61,7 +60,7 @@ if (typeof window !== "undefined") {
</>
) : activeTab === "html" ? (
<CodeBlock>{`<script type="text/javascript">
!function(){var t=document.createElement("script");t.type="text/javascript",t.async=!0,t.src="https://unpkg.com/@formbricks/js@^1.4.0/dist/index.umd.js";var e=document.getElementsByTagName("script")[0];e.parentNode.insertBefore(t,e),setTimeout(function(){window.formbricks.init("claDadXk29dak92dK9","https://app.formbricks.com")},500)}();
!function(){var t=document.createElement("script");t.type="text/javascript",t.async=!0,t.src="https://unpkg.com/@formbricks/js@^1.2.0/dist/index.umd.js";var e=document.getElementsByTagName("script")[0];e.parentNode.insertBefore(t,e),setTimeout(function(){window.formbricks.init("claDadXk29dak92dK9","https://app.formbricks.com")},500)}();
</script>`}</CodeBlock>
) : null}
</div>

Some files were not shown because too many files have changed in this diff Show More