Compare commits

..

1 Commits

Author SHA1 Message Date
Matthias Nannt
133691facb feature: support arm architecture with docker images 2023-12-14 12:02:42 +01:00
614 changed files with 9570 additions and 22074 deletions

8
.changeset/README.md Normal file
View File

@@ -0,0 +1,8 @@
# Changesets
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

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,28 +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",
"postAttachCommand": "pnpm dev --filter=web... --filter=demo...",
// 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

@@ -1,3 +1,4 @@
/*
########################################################################
# ------------ MANDATORY (CHANGE ACCORDING TO YOUR SETUP) ------------#
########################################################################
@@ -63,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
@@ -105,10 +106,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=
@@ -138,6 +135,4 @@ ENTERPRISE_LICENSE_KEY=
# set to 1 to skip onboarding for new users
# ONBOARDING_DISABLED=1
# Send new users to customer.io
# CUSTOMER_IO_API_KEY=
# CUSTOMER_IO_SITE_ID=
*/

View File

@@ -42,6 +42,7 @@ body:
- First time: Please read our [introductory blog post](https://formbricks.com/blog/join-the-formtribe)
- All UI components are in the package `formbricks/ui`
- Run `pnpm go` to find a demo app to test in-app surveys at `localhost:3002`
- Everything is type-safe.
- We use **chatGPT** to help refactor code.
- Everything is type-safe
- We use **chatGPT** to help refactor code. Use our [Formbricks ✨ megaprompt ✨](https://github.com/formbricks/formbricks/blob/main/megaprompt.md) to create the right
context before you write your prompt.
- Anything unclear? [Ask in Discord](https://formbricks.com/discord)

View File

@@ -1,5 +1,3 @@
<!-- We require pull request titles to follow the Conventional Commits specification ( https://www.conventionalcommits.org/en/v1.0.0/#summary ). Please make sure your title follow these conventions -->
## What does this PR do?
<!-- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. -->
@@ -10,6 +8,18 @@ Fixes # (issue)
Loom Video: https://www.loom.com/
-->
## Type of change
<!-- Please mark the relevant points by using [x] -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] Chore (refactoring code, technical debt, workflow improvements)
- [ ] Enhancement (small improvements)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change adds a new database migration
- [ ] This change requires a documentation update
## How should this be tested?
<!-- Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration -->
@@ -32,6 +42,7 @@ Fixes # (issue)
- [ ] Removed all `console.logs`
- [ ] Merged the latest changes from main onto my branch with `git pull origin main`
- [ ] My changes don't cause any responsiveness issues
- [ ] First PR at Formbricks? [Please sign the CLA!](https://formbricks.com/clmyhzfrymr4ko00hycsg1tvx) Without it we wont be able to merge it 🙏
### Appreciated

View File

@@ -1,4 +1,4 @@
name: Build formbricks-com
name: Build
on:
workflow_call:
jobs:
@@ -11,10 +11,10 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup Node.js 20.x
- name: Setup Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 20.x
node-version: 18.x
- name: Install pnpm
uses: pnpm/action-setup@v2

View File

@@ -1,4 +1,4 @@
name: Build web
name: Build
on:
workflow_call:
jobs:
@@ -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

@@ -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 20:00 UTC every day of every month.
- cron: "0 20 * * *"
# This will run the job at 22:00 UTC every day of every month.
- cron: "0 22 * * *"
jobs:
cron-reportUsageToStripe:
env:

View File

@@ -1,80 +0,0 @@
name: E2E Tests
on:
workflow_call:
workflow_dispatch:
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: Install Playwright Browsers
run: pnpm exec playwright install --with-deps
- name: create .env
run: cp .env.example .env
- name: Generate ENCRYPTION_KEY
run: |
SECRET=$(openssl rand -hex 32)
echo "ENCRYPTION_KEY=$SECRET" >> $GITHUB_ENV
- name: Start PostgreSQL
run: |
cd packages/database && pnpm db:up &
for attempt in {1..20}; do
if nc -zv localhost 5432; then
echo "Ready"
break
fi
echo "Waiting..."
sleep 5
done
pnpm db:migrate:dev
- name: Build App in dev mode without external dependencies
run: |
pnpm build:dev --filter=web...
- name: Serve packages for lazy loading
run: |
cd packages/surveys && pnpm serve &
- name: Run App
run: |
NODE_ENV=test pnpm start --filter=web &
for attempt in {1..20}; do
if [ $(curl -o /dev/null -s -w "%{http_code}" http://localhost:3000/health) -eq 200 ]; then
echo "Ready"
break
fi
echo "Waiting..."
sleep 10
done
- name: Test Serve endpoints
run: |
curl -s http://localhost:3003
- name: Run E2E Tests
run: |
pnpm test:e2e
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30

View File

@@ -1,137 +0,0 @@
name: ECS
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
on:
push:
branches:
- main
workflow_dispatch: # Add manual trigger support
env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME: formbricks/formbricks-experimental
DATABASE_URL: "postgresql://postgres:postgres@localhost:5432/formbricks?schema=public"
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
# This is used to complete the identity challenge
# with sigstore/fulcio when running outside of PRs.
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
- name: Set up Depot CLI
uses: depot/setup-action@v1
# https://github.com/sigstore/cosign-installer
- name: Install cosign
uses: sigstore/cosign-installer@6e04d228eb30da1757ee4e1dd75a0ec73a653e06 #v3.1.1
with:
cosign-release: "v2.1.1"
# https://github.com/docker/login-action
- name: Log into registry
uses: docker/login-action@v3 # v3.0.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5 # v5.0.0
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=sha,format=long
type=raw,value=latest,enable={{is_default_branch}}
# Build and push Docker image with Buildx
# https://github.com/docker/build-push-action
- name: Build and push Docker image
id: build-and-push
uses: depot/build-push-action@v1
env:
NEXT_PUBLIC_SENTRY_DSN: ${{ secrets.NEXT_PUBLIC_SENTRY_DSN }}
with:
project: tw0fqmsx3c
token: ${{ secrets.DEPOT_PROJECT_TOKEN }}
context: .
file: ./apps/web/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
NEXTAUTH_SECRET=${{ env.NEXTAUTH_SECRET }}
DATABASE_URL=${{ env.DATABASE_URL }}
ENCRYPTION_KEY=${{ env.ENCRYPTION_KEY }}
NEXT_PUBLIC_SENTRY_DSN=${{ env.NEXT_PUBLIC_SENTRY_DSN }}
- name: Sign the images with GitHub OIDC Token
env:
DIGEST: ${{ steps.build-and-push.outputs.digest }}
TAGS: ${{ steps.meta.outputs.tags }}
run: |
images=""
for tag in ${TAGS}; do
images+="${tag}@${DIGEST} "
done
cosign sign --yes ${images}
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Download task definition
run: |
aws ecs describe-task-definition --task-definition prod-webapp-ecs-service --query taskDefinition > task-definition.json
- name: Fill in the new image ID in the Amazon ECS task definition
id: task-def
uses: aws-actions/amazon-ecs-render-task-definition@v1
with:
task-definition: task-definition.json
container-name: prod-webapp-container
image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
- name: Deploy Amazon ECS task definition
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
with:
task-definition: ${{ steps.task-def.outputs.task-definition }}
service: prod-webapp-ecs-service
cluster: prod-core-infra-ecs-cluster
wait-for-service-stability: true

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

37
.github/workflows/playwright.yml vendored Normal file
View File

@@ -0,0 +1,37 @@
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 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

@@ -29,7 +29,7 @@ jobs:
e2e-test:
name: Run E2E Tests
uses: ./.github/workflows/e2e.yml
uses: ./.github/workflows/playwright.yml
secrets: inherit
required:

View File

@@ -44,9 +44,6 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Depot CLI
uses: depot/setup-action@v1
# Install the cosign tool except on PR
# https://github.com/sigstore/cosign-installer
- name: Install cosign
@@ -55,6 +52,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
# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
@@ -77,10 +85,8 @@ jobs:
# https://github.com/docker/build-push-action
- name: Build and push Docker image
id: build-and-push
uses: depot/build-push-action@v1
uses: docker/build-push-action@v5 # v5.0.0
with:
project: tw0fqmsx3c
token: ${{ secrets.DEPOT_PROJECT_TOKEN }}
context: .
file: ./apps/web/Dockerfile
platforms: linux/amd64,linux/arm64

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

View File

@@ -11,35 +11,55 @@
<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>
<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">
<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://flixbus.com"><img src="https://github.com/formbricks/formbricks/assets/72809645/d6c91d89-7633-4845-ae1e-03bbd2ce0946" height="35px"></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>&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>
</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>
## ✨ About Formbricks
@@ -126,6 +146,8 @@ Formbricks has a hosted cloud offering with a generous free plan to get you up a
Formbricks is available Open-Source under AGPLv3 license. You can host Formbricks on your own servers using Docker without a subscription.
(In the future we may develop additional features that aren't in the free Open-Source version).
If you opt for self-hosting Formbricks, here are a few options to consider:
#### Docker

View File

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

View File

@@ -2,7 +2,7 @@ import { Head, Html, Main, NextScript } from "next/document";
export default function Document() {
return (
<Html lang="en" className="h-full bg-slate-50">
<Html lang="en" className="h-full bg-gray-50">
<Head />
<body className="h-full">
<Main />

View File

@@ -74,7 +74,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">
@@ -100,22 +100,22 @@ export default function AppPage({}) {
</div>
<div className="md:grid md:grid-cols-3">
<div className="col-span-3 rounded-lg border border-slate-300 bg-slate-100 p-6 dark:border-slate-600 dark:bg-slate-800">
<div className="col-span-3 rounded-lg border border-slate-300 bg-slate-100 p-6 dark:border-gray-600 dark:bg-gray-800">
<h3 className="text-lg font-semibold dark:text-white">
Reset person / pull data from Formbricks app
</h3>
<p className="text-slate-700 dark:text-slate-300">
<p className="text-slate-700 dark:text-gray-300">
On formbricks.reset() a few things happen: <strong>New person is created</strong> and{" "}
<strong>surveys & no-code actions are pulled from Formbricks:</strong>.
</p>
<button
className="my-4 rounded-lg bg-slate-500 px-6 py-3 text-white hover:bg-slate-700 dark:bg-slate-700 dark:hover:bg-slate-600"
className="my-4 rounded-lg bg-slate-500 px-6 py-3 text-white hover:bg-slate-700 dark:bg-gray-700 dark:hover:bg-gray-600"
onClick={() => {
formbricks.reset();
}}>
Reset
</button>
<p className="text-xs text-slate-700 dark:text-slate-300">
<p className="text-xs text-slate-700 dark:text-gray-300">
If you made a change in Formbricks app and it does not seem to work, hit &apos;Reset&apos; and
try again.
</p>
@@ -124,7 +124,7 @@ export default function AppPage({}) {
<div className="p-6">
<div>
<button
className="mb-4 rounded-lg bg-slate-800 px-6 py-3 text-white hover:bg-slate-700 dark:bg-slate-700 dark:hover:bg-slate-600"
className="mb-4 rounded-lg bg-slate-800 px-6 py-3 text-white hover:bg-slate-700 dark:bg-gray-700 dark:hover:bg-gray-600"
onClick={() => {
formbricks.track("Code Action");
}}>
@@ -132,7 +132,7 @@ export default function AppPage({}) {
</button>
</div>
<div>
<p className="text-xs text-slate-700 dark:text-slate-300">
<p className="text-xs text-slate-700 dark:text-gray-300">
This button sends a{" "}
<a href="https://formbricks.com/docs/actions/code" className="underline" target="_blank">
Code Action
@@ -143,12 +143,12 @@ export default function AppPage({}) {
</div>
<div className="p-6">
<div>
<button className="mb-4 rounded-lg bg-slate-800 px-6 py-3 text-white hover:bg-slate-700 dark:bg-slate-700 dark:hover:bg-slate-600">
<button className="mb-4 rounded-lg bg-slate-800 px-6 py-3 text-white hover:bg-slate-700 dark:bg-gray-700 dark:hover:bg-gray-600">
No-Code Action
</button>
</div>
<div>
<p className="text-xs text-slate-700 dark:text-slate-300">
<p className="text-xs text-slate-700 dark:text-gray-300">
This button sends a{" "}
<a
href="https://formbricks.com/docs/actions/no-code"
@@ -172,12 +172,12 @@ export default function AppPage({}) {
onClick={() => {
formbricks.setAttribute("Plan", "Free");
}}
className="mb-4 rounded-lg bg-slate-800 px-6 py-3 text-white hover:bg-slate-700 dark:bg-slate-700 dark:hover:bg-slate-600">
className="mb-4 rounded-lg bg-slate-800 px-6 py-3 text-white hover:bg-slate-700 dark:bg-gray-700 dark:hover:bg-gray-600">
Set Plan to &apos;Free&apos;
</button>
</div>
<div>
<p className="text-xs text-slate-700 dark:text-slate-300">
<p className="text-xs text-slate-700 dark:text-gray-300">
This button sets the{" "}
<a
href="https://formbricks.com/docs/attributes/custom-attributes"
@@ -195,12 +195,12 @@ export default function AppPage({}) {
onClick={() => {
formbricks.setAttribute("Plan", "Paid");
}}
className="mb-4 rounded-lg bg-slate-800 px-6 py-3 text-white hover:bg-slate-700 dark:bg-slate-700 dark:hover:bg-slate-600">
className="mb-4 rounded-lg bg-slate-800 px-6 py-3 text-white hover:bg-slate-700 dark:bg-gray-700 dark:hover:bg-gray-600">
Set Plan to &apos;Paid&apos;
</button>
</div>
<div>
<p className="text-xs text-slate-700 dark:text-slate-300">
<p className="text-xs text-slate-700 dark:text-gray-300">
This button sets the{" "}
<a
href="https://formbricks.com/docs/attributes/custom-attributes"
@@ -218,12 +218,12 @@ export default function AppPage({}) {
onClick={() => {
formbricks.setEmail("test@web.com");
}}
className="mb-4 rounded-lg bg-slate-800 px-6 py-3 text-white hover:bg-slate-700 dark:bg-slate-700 dark:hover:bg-slate-600">
className="mb-4 rounded-lg bg-slate-800 px-6 py-3 text-white hover:bg-slate-700 dark:bg-gray-700 dark:hover:bg-gray-600">
Set Email
</button>
</div>
<div>
<p className="text-xs text-slate-700 dark:text-slate-300">
<p className="text-xs text-slate-700 dark:text-gray-300">
This button sets the{" "}
<a
href="https://formbricks.com/docs/attributes/identify-users"
@@ -242,7 +242,7 @@ export default function AppPage({}) {
onClick={() => {
window.location.href = "/app";
}}
className="mb-4 rounded-lg bg-slate-800 px-6 py-3 text-white hover:bg-slate-700 dark:bg-slate-700 dark:hover:bg-slate-600">
className="mb-4 rounded-lg bg-slate-800 px-6 py-3 text-white hover:bg-slate-700 dark:bg-gray-700 dark:hover:bg-gray-600">
Deactivate User Identification
</button>
</div>
@@ -252,13 +252,13 @@ export default function AppPage({}) {
onClick={() => {
window.location.href = "/app?userId=true";
}}
className="mb-4 rounded-lg bg-slate-800 px-6 py-3 text-white hover:bg-slate-700 dark:bg-slate-700 dark:hover:bg-slate-600">
className="mb-4 rounded-lg bg-slate-800 px-6 py-3 text-white hover:bg-slate-700 dark:bg-gray-700 dark:hover:bg-gray-600">
Activate User Identification
</button>
</div>
)}
<div>
<p className="text-xs text-slate-700 dark:text-slate-300">
<p className="text-xs text-slate-700 dark:text-gray-300">
This button activates/deactivates{" "}
<a
href="https://formbricks.com/docs/attributes/identify-users"

View File

@@ -0,0 +1,37 @@
export const metadata = {
title: "Implementing Code Actions in Formbricks | Real-time User Action Tracking",
description:
"Dive into the world of Formbricks' code actions. Learn how to seamlessly integrate formbricks.track() method into your codebase, enabling real-time tracking of user actions like button clicks, visiting a specific URL. Up your survey game with precise and exact triggers.",
};
#### Actions
# Code Actions
Actions can also be set in the codebase to trigger surveys. Please add the code action first in the Formbricks web interface to be able to configure your surveys to use this action.
After that you can fire an action using `formbricks.track()`
<Col>
<CodeGroup title="Track an action">
```javascript
formbricks.track("Action Name");
```
</CodeGroup>
</Col>
Here is an example of how to fire an action when a user clicks a button:
<Col>
<CodeGroup title="Track Button Click">
```javascript
const handleClick = () => {
formbricks.track("Button Clicked");
};
return <button onClick={handleClick}>Click Me</button>;
```
</CodeGroup>
</Col>

View File

@@ -0,0 +1,30 @@
export const metadata = {
title: "Implementing No-Code Actions in Formbricks | Real-time User Action Tracking",
description:
"Discover the power of Formbricks' No-Code Actions. Easily set up triggers based on Page URL, innerText, and CSS Selectors without touching a line of code. Inccrease user engagement and get insights at precise moments in the user journey.",
};
#### Actions
# No-Code Actions
No-Code actions can be set up within Formbricks with just a few clicks. There are three types of No-Code actions:
## Page URL Action
The page URL action is triggered, when a user visits a specific page in your application. There are several match conditions:
- `exactMatch`: The URL should exactly match the provided string.
- `contains`: The URL should contain the specified string as a substring.
- `startsWith`: The URL should start with the specified string.
- `endsWith`: The URL should end with the specified string.
- `notMatch`: The URL should not match the specified condition.
- `notContains`: The URL should not contain the specified string as a substring.
## innerText Action
The innerText action checks if the `innerText` of a clicked HTML element matches a specific text, e.g. the label of a button. Display a survey on any button click!
## CSS Selector Action
The CSS Selector action checks if the provided CSS selector matches the selector of a clicked HTML element. The CSS selector can be a class, id or any other CSS selector within your website. Display a survey on any element click!

View File

@@ -0,0 +1,23 @@
export const metadata = {
title: "Using Actions in Formbricks | Fine-tuning User Moments",
description:
"Dive deep into how actions in Formbricks help products and teams to engage users at precise moments in their journey. Discover the power of actions, from coding to no-code setups, to refine user targeting and generate richer, more detailed user insights.",
};
#### Actions
# What are actions and why are they useful?
You want to understand what your users think and feel during specific moments in the user journey. To be able to ask at exactly the right point in time, you need actions.
## What are actions?
Actions are a little notification sent from your application to Formbricks. You decide which actions are sent either in your [Code](/docs/actions/code) or by setting up a [No-Code](/docs/actions/no-code) action within Formbricks.
## How do actions work?
When a predefined action happens in your app, the Formbricks widget notices. This action can then trigger a survey to be shown to the user and is stored in the database.
## Why are actions useful?
Actions help you to display your surveys at the right time. Later on, you will be able to segment your users based on the actions they have triggered in the past. This way, you can create much more granular user segments, e.g. only target users that already have used a specific feature.

View File

@@ -1,7 +1,7 @@
import { Fence } from "@/components/shared/Fence";
export const metadata = {
title: "Formbricks Actions API Documentation - Manage Your Survey Data Seamlessly",
title: "Formbricks Responses API Documentation - Manage Your Survey Data Seamlessly",
description:
"Unlock the full potential of Formbricks' Client Actions API. Create Actions right from the API.",
};
@@ -13,9 +13,9 @@ export const metadata = {
The Public Client API is designed for the JavaScript SDK and does not require authentication. It's primarily used for creating persons, sessions, and responses within the Formbricks platform. This API is ideal for client-side interactions, as it doesn't expose sensitive information.
This API can be used to:
- [Add Action for User](#add-action-for-user)
---
## Add Action for User {{ tag: 'POST', label: '/api/v1/client/<environment-id>/actions' }}
@@ -85,3 +85,4 @@ Adds an Actions for a given User by their User ID
</Row>
---

View File

@@ -218,7 +218,7 @@ This set of API can be used to
<CodeGroup title="Request" tag="DELETE" label="/api/v1/client/responses/<response-id>">
```bash {{ title: 'cURL' }}
curl -X DELETE https://app.formbricks.com/api/v1/management/responses/<response-id> \
curl -X DELETE https://app.formbricks.com/api/v1/management/resposnes/<response-id> \
--header 'x-api-key: <your-api-key>'
```

View File

@@ -0,0 +1,57 @@
export const metadata = {
title: "Guide for Setting Custom Attributes | Formbricks Documentation",
description:
"Learn how to set attributes in code using setAttribute function. Enhance user segmentation, target surveys effectively, and gather valuable insights for better decisions. Easily send user-specific details for better survey segmentation and gain deeper insights.",
};
#### Attributes
# Setting attributes with code
One way to send attributes to Formbricks is in your code. In Formbricks, there are two special attributes for [user identification](/docs/attributes/identify-users)(user ID & email) and custom attributes. An example:
## Setting 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.
<Col>
<CodeGroup title="Setting Plan to Pro">
```javascript
formbricks.setAttribute("Plan", "Pro");
```
</CodeGroup>
</Col>
Generally speaking, the setAttribute function works like this:
<Col>
<CodeGroup title="Setting Custom Attributes">
```javascript
formbricks.setAttribute("attribute_key", "attribute_value");
```
</CodeGroup>
</Col>
Where `attributeName` is the name of the attribute you want to set, and `attributeValue` is the value of the attribute you want to set.

View File

@@ -1,28 +1,18 @@
export const metadata = {
title: "Understanding User Attributes in Formbricks Surveys",
title: "User Identification in Formbricks | Enhancing Survey Feedback",
description:
"Dive into the importance of attributes in surveys. Learn how key-value pairs can significantly improve survey targeting, enhance feedback quality, and guide data-driven decisions with Formbricks.",
"A comprehensive guide on identifying users in Formbricks without compromising privacy. Learn how to set User ID, email, and custom attributes to optimize survey targeting, recontact users, and control survey intervals, all while respecting user anonymity.",
};
#### In-App Surveys
#### Attributes
# Attributes
# Identifying Users
Surveying your user base without segmentation leads to weak results and survey fatigue. Attributes help you segment your users into groups.
At Formbricks, we value user privacy. By default, Formbricks doesn't collect or store any personal information from your users. However, we understand that it can be helpful for you to know which user submitted the feedback and also functionality like recontacting users and controlling the waiting period between surveys requires identifying the users. That's why we provide a way for you to share existing user data from your app, so you can view it in our dashboard.
## How do Attributes work?
If you would like to use the User Identification feature of Formbricks, target surveys to specific user segments and see more information about the user who responded to a survey, you can identify users by setting a User ID, email, and custom attributes. This guide will walk you through how to do that.
Attributes are **key-value pairs** that you can set for each person individually.
Attributes are sent from your application to Formbricks and are associated with the current user. We store it in our database and allow you to use it the next time you create a survey. They help show surveys to the right group of people.
<Note>
At Formbricks, we value user privacy. By default, Formbricks doesn't collect or store any personal information from your users.
</Note>
## Identifying Users
To use the User Identification feature of Formbricks, target surveys to specific user segments and see more information about the user who responded to a survey, you can identify users by setting a User ID, email, and custom attributes. Below is how to do that.
### Setting User ID
## Setting User ID
To enable the User identification feature you need to set the `userId` in the init() call of Formbricks. Only when the `userId` is set the person will be visible in the Formbricks dashboard. The `userId` can be any string and it's best to use the default identifier you use in your app (e.g. unique id from database or the email address if it's unique) but you can also anonymize these as long as they are unique for every user.
@@ -40,7 +30,7 @@ formbricks.init({
</CodeGroup>
</Col>
### Enhanced Initialization with User Attributes
## 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:
@@ -62,7 +52,7 @@ formbricks.init({
</CodeGroup>
</Col>
### Setting User Email
## 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:
@@ -75,8 +65,7 @@ formbricks.setEmail("user@example.com");
</CodeGroup>
</Col>
## Setting Custom User Attributes
### Setting Custom User Attributes
You can use the setAttribute function to set any custom attribute for the user (e.g. name, plan, etc.):
@@ -89,20 +78,6 @@ formbricks.setAttribute("Plan", "free");
</CodeGroup>
</Col>
Generally speaking, the setAttribute function works like this:
<Col>
<CodeGroup title="Setting Custom Attributes">
```javascript
formbricks.setAttribute("attribute_key", "attribute_value");
```
</CodeGroup>
</Col>
Where `attributeName` is the name of the attribute you want to set, and `attributeValue` is the value of the attribute you want to set.
### Logging Out Users
When a user logs out of your webpage, make sure to log them out of Formbricks as well. This will prevent new activity from being associated with an incorrect user. Use the logout function:

View File

@@ -0,0 +1,23 @@
export const metadata = {
title: "Understanding User Attributes in Formbricks Surveys",
description:
"Dive into the importance of attributes in surveys. Learn how key-value pairs can significantly improve survey targeting, enhance feedback quality, and guide data-driven decisions with Formbricks.",
};
#### Attributes
# What are attributes and why are they useful?
Surveying your user base without segmentation leads to weak results and survey fatigue. Attributes help you segment your users into groups.
## What are attributes?
Attributes are key-value pairs that you can set for each person individually. For example, the attribute "Plan" can be set to "Free" or "Paid".
## How do attributes work?
Attributes are sent from your application to Formbricks and are associated with the current user. We store it in our database and allow you to use it the next time you create a survey.
## Why are attributes useful?
Attributes help show surveys to the right group of people. For example, you can show a survey to all users who have a "Plan" attribute set to "Paid".

View File

@@ -1,19 +1,18 @@
import DemoPreview from "@/components/dummyUI/DemoPreview";
import Image from "next/image";
import DemoPreview from "@/components/dummyUI/DemoPreview";
import ChangeText from "./change-text.webp";
import CreateChurnFlow from "./create-cancel-flow.webp";
import PublishSurvey from "./publish-survey.webp";
import RecontactOptions from "./recontact-options.webp";
import SelectAction from "./select-action.webp";
import TriggerCSS from "./trigger-css-selector.webp";
import ChangeText from "./change-text.webp";
import TriggerInnerText from "./trigger-inner-text.webp";
import TriggerCSS from "./trigger-css-selector.webp";
import TriggerPageUrl from "./trigger-page-url.webp";
import RecontactOptions from "./recontact-options.webp";
import PublishSurvey from "./publish-survey.webp";
import SelectAction from "./select-action.webp";
export const metadata = {
title: "Mastering Churn Surveys with Formbricks | Essential Tips & Steps",
description:
"Learn how to effectively utilize Formbricks' Churn Surveys to gain deeper insights into user departures. Dive into a step-by-step guide to craft, trigger, and optimize your churn surveys, ensuring you capture invaluable feedback at critical junctures",
description: "Learn how to effectively utilize Formbricks' Churn Surveys to gain deeper insights into user departures. Dive into a step-by-step guide to craft, trigger, and optimize your churn surveys, ensuring you capture invaluable feedback at critical junctures",
};
#### Best Practices
@@ -40,16 +39,15 @@ The Churn Survey is among the most effective ways to identify weaknesses in your
To run the Churn Survey in your app you want to proceed as follows:
1. Create new Churn Survey at [app.formbricks.com](https://app.formbricks.com/)
1. Create new Churn Survey at [app.formbricks.com](http://app.formbricks.com/)
2. Set up the user action to display survey at right point in time
3. Choose correct recontact options to never miss a feedback
4. Prevent that churn!
<Note>
## Formbricks Widget running?
We assume that you have already installed the Formbricks Widget in your web
app. Its required to display messages and surveys in your app. If not, please follow the [Quick Start Guide
(takes 15mins max.)](/docs/getting-started/quickstart-in-app-survey)
## Formbricks Widget running?
We assume that you have already installed the Formbricks Widget in your web app. Its required to display messages
and surveys in your app. If not, please follow the [Quick Start Guide (takes 15mins max.)](/docs/getting-started/quickstart-in-app-survey)
</Note>
### 1. Create new Churn Survey
@@ -62,7 +60,7 @@ Click on "Create Survey" and choose the template “Churn Survey”:
src={CreateChurnFlow}
alt="Create churn survey by template"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
className="rounded-lg max-w-full sm:max-w-3xl"
/>
### 2. Update questions (if you like)
@@ -73,7 +71,7 @@ Youre free to update the question and answer options. However, based on our e
src={ChangeText}
alt="Change text content"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
className="rounded-lg max-w-full sm:max-w-3xl"
/>
_Want to change the button color? You can do so in the product settings._
@@ -94,7 +92,7 @@ To create the trigger for your Churn Survey, you have two options to choose from
src={TriggerInnerText}
alt="Set the trigger by inner Text"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
className="rounded-lg max-w-full sm:max-w-3xl"
/>
2. **Trigger by CSS Selector:** In case you have more than one button saying “Cancel Subscription” in your app and only want to display the survey when one of them is clicked, you want to be more specific. The best way to do that is to give this button the HTML `id=“cancel-subscription”` and set your user action up like so:
@@ -103,7 +101,7 @@ To create the trigger for your Churn Survey, you have two options to choose from
src={TriggerCSS}
alt="Set the trigger by CSS Selector"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
className="rounded-lg max-w-full sm:max-w-3xl"
/>
3. **Trigger by pageURL:** Lastly, you could also display your survey on a subpage “/subscription-cancelled” where you forward users once they cancelled the trial subscription. You can then create a user Action with the type `pageURL` with the following settings:
@@ -112,7 +110,7 @@ To create the trigger for your Churn Survey, you have two options to choose from
src={TriggerPageUrl}
alt="Set the trigger by page URL"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
className="rounded-lg max-w-full sm:max-w-3xl"
/>
Whenever a user visits this page, matches the filter conditions above and the recontact options (below) the survey will be displayed ✅
@@ -121,9 +119,9 @@ Here is our complete [Actions manual](/docs/actions/why) covering [Code](/docs/a
<Note>
## Pre-churn flow coming soon
Were currently building full-screen survey pop-ups. Youll be able to prevent
users from closing the survey unless they respond to it. Its certainly debatable if you want that but you
could force them to click through the survey before letting them cancel 🤷
Were currently building full-screen survey pop-ups. Youll be able to prevent users from closing the survey
unless they respond to it. Its certainly debatable if you want that but you could force them to click through
the survey before letting them cancel 🤷
</Note>
### 5. Select Action in the “When to ask” card
@@ -132,7 +130,7 @@ Here is our complete [Actions manual](/docs/actions/why) covering [Code](/docs/a
src={SelectAction}
alt="Select feedback button action"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
className="rounded-lg max-w-full sm:max-w-3xl"
/>
### 6. Last step: Set Recontact Options correctly
@@ -143,7 +141,7 @@ Lastly, scroll down to “Recontact Options”. Here you have to choose the corr
src={RecontactOptions}
alt="Set recontact options"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
className="rounded-lg max-w-full sm:max-w-3xl"
/>
These settings make sure the survey is always displayed, when a user wants to Cancel their subscription.
@@ -154,14 +152,13 @@ These settings make sure the survey is always displayed, when a user wants to Ca
src={PublishSurvey}
alt="Publish survey"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
className="rounded-lg max-w-full sm:max-w-3xl"
/>
<Note>
## Formbricks Widget running?
You need to have the Formbricks Widget installed to display the Churn Survey
in your app. Please follow [this tutorial (Step 4 onwards)](/docs/getting-started/quickstart-in-app-survey)
to install the widget.
You need to have the Formbricks Widget installed to display the Churn Survey in your app. Please follow [this
tutorial (Step 4 onwards)](/docs/getting-started/quickstart-in-app-survey) to install the widget.
</Note>
###

View File

@@ -11,8 +11,7 @@ import SelectAction from "./select-action.webp";
export const metadata = {
title: "Setting Up Feature Chaser Surveys with Formbricks: A Comprehensive Guide",
description:
"Learn how to harness the power of Formbricks to gather targeted user feedback on specific features. Dive deep into creating, triggering, and publishing the Feature Chaser survey to enhance your product with actionable insights for specific users.",
description: "Learn how to harness the power of Formbricks to gather targeted user feedback on specific features. Dive deep into creating, triggering, and publishing the Feature Chaser survey to enhance your product with actionable insights for specific users.",
};
#### Best Practices
@@ -39,14 +38,13 @@ Product analytics never tell you why a feature is used - and why not. Following
To run the Feature Chaser survey in your app you want to proceed as follows:
1. Create new Feature Chaser survey at [app.formbricks.com](https://app.formbricks.com/)
1. Create new Feature Chaser survey at [app.formbricks.com](http://app.formbricks.com/)
2. Setup a user action to display survey at the right point in time
<Note>
## Formbricks Widget running?
We assume that you have already installed the Formbricks Widget in your web
app. Its required to display messages and surveys in your app. If not, please follow the [Quick Start Guide
(takes 15mins max.)](/docs/getting-started/quickstart-in-app-survey)
We assume that you have already installed the Formbricks Widget in your web app. Its required to display messages
and surveys in your app. If not, please follow the [Quick Start Guide (takes 15mins max.)](/docs/getting-started/quickstart-in-app-survey)
</Note>
### 1. Create new Feature Chaser
@@ -59,7 +57,7 @@ Click on "Create Survey" and choose the template “Feature Chaser”:
src={CreateSurvey}
alt="Create survey by template"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
className="rounded-lg max-w-full sm:max-w-3xl"
/>
### 2. Update questions
@@ -70,7 +68,7 @@ The questions you want to ask are dependent on your feature and can be very spec
src={ChangeText}
alt="Change text content"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
className="rounded-lg max-w-full sm:max-w-3xl"
/>
Save, and move over to where the magic happens: The “Audience” tab.
@@ -89,7 +87,7 @@ There are two ways to track a button:
src={ActionText}
alt="Set the trigger by inner Text"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
className="rounded-lg max-w-full sm:max-w-3xl"
/>
2. **Trigger by CSS Selector:** In case you have more than one button saying “Export Report” in your app and only want to display the survey when one of them is clicked, you want to be more specific. The best way to do that is to give this button the HTML `id=“export-report-featurename”` and set your user action up like so:
@@ -98,7 +96,7 @@ There are two ways to track a button:
src={ActionCSS}
alt="Set the trigger by CSS Selector"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
className="rounded-lg max-w-full sm:max-w-3xl"
/>
Please follow our [Actions manual](/docs/actions/why) for an in-depth description of how Actions work.
@@ -109,7 +107,7 @@ Please follow our [Actions manual](/docs/actions/why) for an in-depth descriptio
src={SelectAction}
alt="Select PMF trigger button action"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
className="rounded-lg max-w-full sm:max-w-3xl"
/>
### 5. Last step: Set Recontact Options correctly
@@ -120,18 +118,17 @@ Lastly, scroll down to “Recontact Options”. Here you have full freedom to de
src={RecontactOptions}
alt="Set recontact options"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
className="rounded-lg max-w-full sm:max-w-3xl"
/>
### 7. Congrats! Youre ready to publish your survey 💃
<Image src={Publish} alt="Publish survey" quality="100" className="max-w-full rounded-lg sm:max-w-3xl" />
<Image src={Publish} alt="Publish survey" quality="100" className="rounded-lg max-w-full sm:max-w-3xl" />
<Note>
## Formbricks Widget running?
You need to have the Formbricks Widget installed to display the Feature Chaser
in your app. Please follow [this tutorial (Step 4 onwards)](/docs/getting-started/quickstart-in-app-survey)
to install the widget.
## Formbricks Widget running?
You need to have the Formbricks Widget installed to display the Feature Chaser in your app. Please follow [this
tutorial (Step 4 onwards)](/docs/getting-started/quickstart-in-app-survey) to install the widget.
</Note>
###

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.9 KiB

View File

@@ -1,113 +0,0 @@
import DemoPreview from "@/components/dummyUI/DemoPreview";
import Image from "next/image";
import NewsletterSurveyType from './choose-survey-type.webp';
import NewsletterSurveyEmbedCode from './embed-survey-code-in-your-email.webp';
import NewsletterSurveyEmbedPrompt from './embed-survey-prompt.webp';
import NewsletterSurveyEditor from './improve-newsletter-content-editor-formbricks.webp';
import NewsletterSurvey from './improve-newsletter-content-survey-location.webp';
export const metadata = {
title: "Measure email content quality with Formbricks",
description:
"Measuring the content quality of both transactional and marketing email is a key element for improving customer communication.",
};
#### Best Practices
# Improve Email Content
Email remains the predominant way to communicate with your customers. Measure the effectiveness to improve your offering.
## Purpose
Measuring the content quality of both transactional and marketing email is a key element for improving customer communication.
## Preview
<DemoPreview template="Improve Newsletter Content" />
## Formbricks Approach
- Embed the survey into your email so its part of the newsletter.
- Use link prefilling to store the answer users clicked on in the email.
- Dynamic user identification to append reader's email for personalized profiles and follow ups.
## Installation
To embed the newsletter survey into your email, follow these steps:
1. Create new 'Improve Newsletter Content' survey at [app.formbricks.com](https://app.formbricks.com/)
2. Select how you where you want to display the survey.
3. Copy the embed code anywhere you want in your newsletter.
### 1. Create new 'Improve Newsletter Content' Survey
If you don't have an account yet, create one at [app.formbricks.com](https://app.formbricks.com/auth/signup)
Then, create a new survey and look for the "Improve Newsletter Content" template:
<Image
src={NewsletterSurvey}
alt="Create Improve Newsletter Content by template"
quality="100"
className="rounded-lg max-w-full sm:max-w-3xl"
/>
### 2. Customize Survey questions
Customize survey questions, emojis or stars however you like:
<Image
src={NewsletterSurveyEditor}
alt="Edit Improve Newsletter Content template"
quality="100"
className="rounded-lg max-w-full sm:max-w-3xl"
/>
### 3. Configure Survey Settings
When you are done customizing your survey questions, navigate to the Settings tab and choose the type of survey you want. You need to choose Link Survey:
<Image
src={NewsletterSurveyType}
alt="Choose survey type"
quality="100"
className="rounded-lg max-w-full sm:max-w-3xl"
/>
### 4. Choose how you want to embed your survey
After publishing your survey, a modal that prompts you to embed your survey will pop up.
<Image
src={NewsletterSurveyEmbedPrompt}
alt="Embed newsletter survey"
quality="100"
className="rounded-lg max-w-full sm:max-w-3xl"
/>
Select the Embed Survey card and you will be directed to another modal, where the first embed option displayed will be to embed the survey in an email.
### 5. Copy code to embed the survey in your newsletter
Click the button with the “View Embed Code” text at the top right corner of the modal and simply paste the HTML code for your survey anywhere you want it in your newsletter. You can see the preview in the below image:
<Image
src={NewsletterSurveyEmbedCode}
alt="Embed survey code"
quality="100"
className="rounded-lg max-w-full sm:max-w-3xl"
/>
And you're done! Send a test email to yourself and try it out 🤓
## Learn about data prefilling
<Note>
## How does data prefilling work?
Learn about how link prefilling and user identification maximize your insights in [this detailed guide](/blog/how-smart-writers-use-formbricks-open-source-tool-to-measure-the-quality-of-their-newsletter-content).
</Note>
### &nbsp;
# Thats it! 🎉

View File

@@ -11,8 +11,7 @@ import SelectAction from "./select-action.webp";
export const metadata = {
title: "Boost Your Trial Conversion Rates with Formbricks: Comprehensive Guide",
description:
"Unlock the secret to converting more trial users into paying customers using Formbricks. Understand insights behind trial cancellations and tailor your offering to fit user needs. Dive into our step-by-step tutorial and improve your conversion strategy today",
description: "Unlock the secret to converting more trial users into paying customers using Formbricks. Understand insights behind trial cancellations and tailor your offering to fit user needs. Dive into our step-by-step tutorial and improve your conversion strategy today",
};
#### Best Practices
@@ -38,15 +37,14 @@ The better you understand why free users dont convert to paid users, the high
To display the Trial Conversion Survey in your app you want to proceed as follows:
1. Create new Trial Conversion Survey at [app.formbricks.com](https://app.formbricks.com/)
1. Create new Trial Conversion Survey at [app.formbricks.com](http://app.formbricks.com/)
2. Set up the user action to display survey at right point in time
3. Print that 💸
<Note>
## Formbricks Widget running?
We assume that you have already installed the Formbricks Widget in your web
app. Its required to display messages and surveys in your app. If not, please follow the [Quick Start Guide
(takes 15mins max.)](/docs/getting-started/quickstart-in-app-survey)
## Formbricks Widget running?
We assume that you have already installed the Formbricks Widget in your web app. Its required to display messages
and surveys in your app. If not, please follow the [Quick Start Guide (takes 15mins max.)](/docs/getting-started/quickstart-in-app-survey)
</Note>
### 1. Create new Trial Conversion Survey
@@ -59,7 +57,7 @@ Click on "Create Survey" and choose the template “Improve Trial Conversion”:
src={CreateSurvey}
alt="Create survey by template"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
className="rounded-lg max-w-full sm:max-w-3xl"
/>
### 2. Update questions (if you like)
@@ -70,7 +68,7 @@ Youre free to update the questions and answer options. However, based on our
src={ChangeText}
alt="Change text content"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
className="rounded-lg max-w-full sm:max-w-3xl"
/>
_Want to change the button color? You can do so in the product settings!_
@@ -81,8 +79,7 @@ Save, and move over to the “Audience” tab.
<Note>
## Filter by attribute coming soon
We're working on pre-segmenting users by attributes. We will update this
manual in the next days.
We're working on pre-segmenting users by attributes. We will update this manual in the next days.
</Note>
Pre-segmentation isn't relevant for this survey because you likely want to solve all people who cancel their trial. You probably have a specific user action e.g. clicking on "Cancel Trial" you can use to only display the survey to users trialing your product.
@@ -97,7 +94,7 @@ How you trigger your survey depends on your product. There are two options:
src={ActionPageurl}
alt="Change text content"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
className="rounded-lg max-w-full sm:max-w-3xl"
/>
Whenever a user visits this page, the survey will be displayed ✅
@@ -108,7 +105,7 @@ Whenever a user visits this page, the survey will be displayed ✅
src={ActionText}
alt="Change text content"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
className="rounded-lg max-w-full sm:max-w-3xl"
/>
Please have a look at our complete [Actions manual](/docs/actions/why) if you have questions.
@@ -119,7 +116,7 @@ Please have a look at our complete [Actions manual](/docs/actions/why) if you ha
src={SelectAction}
alt="Select feedback button action"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
className="rounded-lg max-w-full sm:max-w-3xl"
/>
### 6. Last step: Set Recontact Options correctly
@@ -130,18 +127,17 @@ Lastly, scroll down to “Recontact Options”. Here you have to choose the corr
src={RecontactOptions}
alt="Set recontact options"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
className="rounded-lg max-w-full sm:max-w-3xl"
/>
### 7. Congrats! Youre ready to publish your survey 💃
<Image src={Publish} alt="Publish survey" quality="100" className="max-w-full rounded-lg sm:max-w-3xl" />
<Image src={Publish} alt="Publish survey" quality="100" className="rounded-lg max-w-full sm:max-w-3xl" />
<Note>
## Formbricks Widget running?
You need to have the Formbricks Widget installed to display the Feedback Box
in your app. Please follow [this tutorial (Step 4 onwards)](/docs/getting-started/quickstart-in-app-survey)
to install the widget.
You need to have the Formbricks Widget installed to display the Feedback Box in your app. Please follow [this
tutorial (Step 4 onwards)](/docs/getting-started/quickstart-in-app-survey) to install the widget.
</Note>
###

View File

@@ -14,8 +14,7 @@ import SelectAction from "./select-action.webp";
export const metadata = {
title: "Maximize User Interview Participation with In-app Interview Prompts",
description:
"Engage with your power users seamlessly using Formbricks' In-app Interview Prompt. Ditch traditional email invites and experience way more more respondents. Dive into our comprehensive guide on setting up auto-scheduled interviews today and enhance your user understanding",
description: "Engage with your power users seamlessly using Formbricks' In-app Interview Prompt. Ditch traditional email invites and experience way more more respondents. Dive into our comprehensive guide on setting up auto-scheduled interviews today and enhance your user understanding",
};
#### Best Practices
@@ -43,15 +42,14 @@ Product analytics and in-app surveys are incomplete without user interviews. Set
To display an Interview Prompt in your app you want to proceed as follows:
1. Create new Interview Prompt at [app.formbricks.com](https://app.formbricks.com/)
1. Create new Interview Prompt at [app.formbricks.com](http://app.formbricks.com/)
2. Adjust content and settings
3. Thats it! 🎉
<Note>
## Formbricks Widget running?
We assume that you have already installed the Formbricks Widget in your web
app. Its required to display messages and surveys in your app. If not, please follow the [Quick Start Guide
(15mins).](/docs/getting-started/quickstart-in-app-survey)
## Formbricks Widget running?
We assume that you have already installed the Formbricks Widget in your web app. Its required to display messages
and surveys in your app. If not, please follow the [Quick Start Guide (15mins).](/docs/getting-started/quickstart-in-app-survey)
</Note>
### 1. Create new Interview Prompt
@@ -64,7 +62,7 @@ Click on "Create Survey" and choose the template “Interview Prompt”:
src={CreatePrompt}
alt="Create interview prompt by template"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
className="rounded-lg max-w-full sm:max-w-3xl"
/>
### 2. Update prompt and CTA
@@ -75,7 +73,7 @@ Update the prompt, description and button text to match your products tonality.
src={ChangeText}
alt="Change text content"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
className="rounded-lg max-w-full sm:max-w-3xl"
/>
In the button settings you have to make sure it is set to “External URL”. In the URL field, copy your booking link (e.g. https://cal.com/company/user-interview). If you dont have a booking link yet, head over to [cal.com](http://cal.com) and get one - they have the best free plan out there!
@@ -84,7 +82,7 @@ In the button settings you have to make sure it is set to “External URL”. In
src={InterviewExample}
alt="Add CSS action"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
className="rounded-lg max-w-full sm:max-w-3xl"
/>
Save, and move over to the “Audience” tab.
@@ -93,8 +91,7 @@ Save, and move over to the “Audience” tab.
<Note>
## Filter by attribute coming soon
We're working on pre-segmenting users by attributes. We will update this
manual in the next few days.
We're working on pre-segmenting users by attributes. We will update this manual in the next few days.
</Note>
Once you clicked over to the “Audience” tab you can change the settings. In the **Who To Send** card, select “Filter audience by attribute”. This allows you to only show the prompt to a specific segment of your user base.
@@ -107,13 +104,12 @@ Great, now only the “Power User” segment will see our Interview Prompt. But
To create the trigger to show your Interview Prompt, go to the “Audience” tab, find the “When to send” card and choose “Add Action”. We will now use our super cool No-Code User Action Tracker:
<Image src={AddAction} alt="Add action" quality="100" className="max-w-full rounded-lg sm:max-w-3xl" />
<Image src={AddAction} alt="Add action" quality="100" className="rounded-lg max-w-full sm:max-w-3xl" />
<Note>
## You can also add actions in your code
You can also create [Code Actions](/docs/actions/code) using
`formbricks.track("Eventname")` - they will automatically appear in your Actions overview as long as the SDK
is embedded.
## You can also add actions in your code
You can also create [Code Actions](/docs/actions/code) using `formbricks.track("Eventname")` - they will automatically
appear in your Actions overview as long as the SDK is embedded.
</Note>
Generally, we have two types of user actions: Page views and clicks. The Interview Prompt, youll likely want to display it on a page visit since you already filter who sees the prompt by attributes.
@@ -124,18 +120,18 @@ Generally, we have two types of user actions: Page views and clicks. The Intervi
src={ActionPageurl}
alt="Add page URL action"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
className="rounded-lg max-w-full sm:max-w-3xl"
/>
2. **innerText & CSS-Selector:** When a user clicks an element (like a button) with a specific text content or CSS selector, the prompt will be displayed as long as the other conditions also match.
<div className="flex max-w-full flex-col sm:max-w-3xl lg:gap-1">
<Image src={ActionCSS} alt="Add CSS action" quality="100" className="max-w-full rounded-lg sm:max-w-3xl" />
<Image src={ActionCSS} alt="Add CSS action" quality="100" className="rounded-lg max-w-full sm:max-w-3xl" />
<Image
src={ActionInner}
alt="Add inner text action"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
className="rounded-lg max-w-full sm:max-w-3xl"
/>
</div>
@@ -145,7 +141,7 @@ Generally, we have two types of user actions: Page views and clicks. The Intervi
src={SelectAction}
alt="Select feedback button action"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
className="rounded-lg max-w-full sm:max-w-3xl"
/>
### 6. Set Recontact Options correctly
@@ -156,18 +152,17 @@ Scroll down to “Recontact Options”. Here you have to choose the correct sett
src={RecontactOptions}
alt="Set recontact options"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
className="rounded-lg max-w-full sm:max-w-3xl"
/>
### 7. Congrats! Youre ready to publish your survey 💃 🤸
<Image src={Publish} alt="Publish survey" quality="100" className="max-w-full rounded-lg sm:max-w-3xl" />
<Image src={Publish} alt="Publish survey" quality="100" className="rounded-lg max-w-full sm:max-w-3xl" />
<Note>
## Formbricks Widget running?
You need to have the Formbricks Widget installed to display the Feedback Box
in your app. Please follow [this tutorial (Step 4 onwards)](/docs/getting-started/quickstart-in-app-survey)
to install the widget.
## Formbricks Widget running?
You need to have the Formbricks Widget installed to display the Feedback Box in your app. Please follow [this
tutorial (Step 4 onwards)](/docs/getting-started/quickstart-in-app-survey) to install the widget.
</Note>
###

View File

@@ -11,8 +11,7 @@ import SelectAction from "./select-action.webp";
export const metadata = {
title: "How to Set Up a Product-Market Fit Survey Using Formbricks - Step-by-Step Guide",
description:
"Learn to leverage Formbricks to create and implement a Product-Market Fit survey in your web app. Follow our detailed step-by-step guide to measure and understand your PMF effectively. Ensure high data quality, efficient triggers, and actionable insights.",
description: "Learn to leverage Formbricks to create and implement a Product-Market Fit survey in your web app. Follow our detailed step-by-step guide to measure and understand your PMF effectively. Ensure high data quality, efficient triggers, and actionable insights.",
};
#### Best Practices
@@ -37,15 +36,14 @@ Measuring and understanding your PMF is essential to build a large, successful b
To display the Product-Market Fit survey in your app you want to proceed as follows:
1. Create new Product-Market Fit survey at [app.formbricks.com](https://app.formbricks.com/)
1. Create new Product-Market Fit survey at [app.formbricks.com](http://app.formbricks.com/)
2. Setup pre-segmentation to assure high data quality
3. Setup the user action to display survey at good point in time
<Note>
## Formbricks Widget running?
We assume that you have already installed the Formbricks Widget in your web
app. Its required to display messages and surveys in your app. If not, please follow the [Quick Start Guide
(15mins).](/docs/getting-started/quickstart-in-app-survey)
## Formbricks Widget running?
We assume that you have already installed the Formbricks Widget in your web app. Its required to display messages
and surveys in your app. If not, please follow the [Quick Start Guide (15mins).](/docs/getting-started/quickstart-in-app-survey)
</Note>
### 1. Create new PMF survey
@@ -58,7 +56,7 @@ Click on "Create Survey" and choose one of the PMF survey templates. The first o
src={CreateSurvey}
alt="Create survey by template"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
className="rounded-lg max-w-full sm:max-w-3xl"
/>
### 2. Update questions (if you like)
@@ -69,7 +67,7 @@ Youre free to update the question and answer options. However, based on our e
src={ChangeText}
alt="Change text content"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
className="rounded-lg max-w-full sm:max-w-3xl"
/>
_Want to change the button color? You can do so in the product settings!_
@@ -79,9 +77,8 @@ Save, and move over to where the magic happens: The “Audience” tab.
### 3. Pre-segment your audience (coming soon)
<Note>
## Filter by attribute coming soon
We're working on pre-segmenting users by attributes. We will update this
manual in the next days.
## Filter by attribute coming soon
We're working on pre-segmenting users by attributes. We will update this manual in the next days.
</Note>
To run this survey properly, you should pre-segment your user base. As touched upon earlier: if you ask every user youll get lots of opinions which are often misleading. You only want to gather feedback from people who invested the time to get to know and use your product:
@@ -99,31 +96,25 @@ This way you make sure that you separate potentially misleading opinions from va
### 4. Set up a trigger for the Product-Market Fit survey:
You need a trigger to display the survey but in this case, the filtering does all the work. Its up to you to decide to display the survey after the user viewed a specific subpage (pageURL) or after clicking an element. Have a look at the [Actions manual](/docs/actions/why) if you are not sure how to set them up:
<Col>
<div>
<Image
src={ActionCSS}
alt="Add CSS action"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
/>
<Image
src={ActionPageurl}
alt="Add inner text action"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
/>
</div>
<div>
<Image src={ActionCSS} alt="Add CSS action" quality="100" className="rounded-lg max-w-full sm:max-w-3xl" />
<Image
src={ActionPageurl}
alt="Add inner text action"
quality="100"
className="rounded-lg max-w-full sm:max-w-3xl"
/>
</div>
</Col>
### 5. Select Action in the “When to ask” card
<Col>
<Image
src={SelectAction}
alt="Select PMF trigger button action"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
/>
<Image
src={SelectAction}
alt="Select PMF trigger button action"
quality="100"
className="rounded-lg max-w-full sm:max-w-3xl"
/>
</Col>
### 6. Last step: Set Recontact Options correctly
@@ -133,18 +124,17 @@ Lastly, scroll down to “Recontact Options”. Here you have to choose the corr
src={RecontactOptions}
alt="Set recontact options"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
className="rounded-lg max-w-full sm:max-w-3xl"
/>
### 7. Congrats! Youre ready to publish your survey 💃
<Image src={Publish} alt="Publish survey" quality="100" className="max-w-full rounded-lg sm:max-w-3xl" />
<Image src={Publish} alt="Publish survey" quality="100" className="rounded-lg max-w-full sm:max-w-3xl" />
<Note>
## Formbricks Widget running?
You need to have the Formbricks Widget installed to display the Feedback Box
in your app. Please follow [this tutorial (Step 4 onwards)](/docs/getting-started/quickstart-in-app-survey)
to install the widget.
You need to have the Formbricks Widget installed to display the Feedback Box in your app. Please follow [this
tutorial (Step 4 onwards)](/docs/getting-started/quickstart-in-app-survey) to install the widget.
</Note>
###

View File

@@ -42,4 +42,6 @@ If you are at all unsure, just raise it as an enhancement issue first and tell u
To be able to keep working on Formbricks over the coming years, we need to collect a CLA from all relevant contributors.
Once you open a PR, you will get a message from the CLA bot to fill out the form. Please note that we can only get your contribution merged when we have a CLA signed by you.
Please note that we can only get your contribution merged when we have a CLA signed by you.
To access the CLA form, please click [here](https://formbricks.com/clmyhzfrymr4ko00hycsg1tvx)

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

View File

@@ -1,19 +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 GithubCodespaceLoading from "./github-codespaces/loading.webp";
import GithubCodespaceNew from "./github-codespaces/new.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
@@ -23,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, all the dependencies installed & Formbricks running. 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
@@ -53,17 +54,17 @@ 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:**
- We initialize the @formbricks/web component during prebuilds. This involves:
**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.
3. To prevent the "Init" task from running indefinitely due to prebuild rules, a cleanup `docker compose down` step i.e. `db:down` is added to `turbo.json`. This step is designed to halt the execution of containers that are currently running.
@@ -72,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**: SMTP 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.
---
@@ -204,25 +169,37 @@ 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. Monitor the logs in the terminal and once you see the following, you are good to go!
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="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="rounded-lg max-w-full sm:max-w-3xl" />
6. Now, run the following command to run the app
<Col>
<CodeGroup title="Run the entire Formbricks Stack">
```bash
pnpm dev
```
</CodeGroup>
</Col>
<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!
<Col>
<CodeGroup title="The WebApp is running">
@@ -233,132 +210,19 @@ These URLs and port numbers represent various services and endpoints within your
@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
```
</CodeGroup>
</Col>
5. 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!
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>
---
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

@@ -1,10 +1,9 @@
import { Libraries } from "@/components/docs/Libraries";
import Image from "next/image";
import SetupChecklist from "./env-id.webp";
import ReactApp from "./react-in-app-survey-app-popup-form.webp";
import WidgetConnected from "./widget-connected.webp";
import WidgetNotConnected from "./widget-not-connected.webp";
import WidgetConnected from "./widget-connected.webp";
import ReactApp from "./react-in-app-survey-app-popup-form.webp";
export const metadata = {
title: "Integrate Formbricks: Comprehensive Framework Guide & Integration Tutorial",
@@ -46,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 -->
```
@@ -223,10 +222,9 @@ Refer to our [Example NextJS App Directory project](https://github.com/formbrick
```tsx {{ title: 'Typescript' }}
// other import
import { useRouter } from "next/router";
import { useEffect } from "react";
import formbricks from "@formbricks/js";
import { useEffect } from "react";
import { useRouter } from "next/router";
if (typeof window !== "undefined") {
formbricks.init({
@@ -388,43 +386,6 @@ To this:
className="max-w-full rounded-lg sm:max-w-3xl"
/>
## Overwrite CSS Styles for In-App Surveys
You can overwrite the default CSS styles for the in-app surveys by adding the following CSS to your global CSS file (eg. `globals.css`):
Make sure that you do not change the CSS variable names as they are used by Formbricks to identify the CSS variables. You can change the values to your liking. We have filled in some sample values for you to change according to your desired appearance.
<Col>
<CodeGroup title="Overwrite Formbricks CSS">
```css
/* Formbricks CSS */
--fb-brand-color: red;
--fb-brand-text-color: white;
--fb-border-color: green;
--fb-border-color-highlight: rgb(13, 13, 12);
--fb-focus-color: red;
--fb-heading-color: yellow;
--fb-subheading-color: green;
--fb-info-text-color: orange;
--fb-signature-text-color: blue;
--fb-survey-background-color: black;
--fb-accent-background-color: rgb(13, 13, 12);
--fb-accent-background-color-selected: red;
--fb-placeholder-color: white;
--fb-shadow-color: var(--fb-brand-color);
--fb-rating-fill: rgb(13, 13, 12);
--fb-rating-hover: green;
--fb-back-btn-border: blue;
--fb-submit-btn-border: transparent;
--fb-rating-selected: black;
```
</CodeGroup>
</Col>
We have an example of this in our [Demo project](https://github.com/formbricks/formbricks/blob/main/apps/demo/styles/globals.css.) here.
**Cant figure it out? [Join our Discord!](https://formbricks.com/discord)**
---

View File

@@ -1,73 +0,0 @@
export const metadata = {
title: "Using Actions in Formbricks | Fine-tuning User Moments",
description:
"Dive deep into how actions in Formbricks help products and teams to engage users at precise moments in their journey. Discover the power of actions, from coding to no-code setups, to refine user targeting and generate richer, more detailed user insights.",
};
#### In-App Surveys
# Actions
You want to understand what your users think and feel during specific moments in the user journey. To be able to ask at exactly the right point in time, you need actions.
## How do Actions work?
Actions are a little notification sent from your application to Formbricks. When a predefined action happens in your app, the Formbricks widget notices. This action can then trigger a survey to be shown to the user and is stored in the database.
You decide which actions are sent either in your [Code](#code-actions) or by setting up a [No-Code](#no-code-actions) action within Formbricks.
### Why are actions useful?
Actions help you to display your surveys at the right time. Later on, you will be able to segment your users based on the actions they have triggered in the past. This way, you can create much more granular user segments, e.g. only target users that already have used a specific feature.
## No-Code Actions
No-Code actions can be set up within Formbricks with just a few clicks. There are three types of No-Code actions:
1. **Page URL Action**
The page URL action is triggered, when a user visits a specific page in your application. There are several match conditions:
- `exactMatch`: The URL should exactly match the provided string.
- `contains`: The URL should contain the specified string as a substring.
- `startsWith`: The URL should start with the specified string.
- `endsWith`: The URL should end with the specified string.
- `notMatch`: The URL should not match the specified condition.
- `notContains`: The URL should not contain the specified string as a substring.
2. **innerText Action**
The innerText action checks if the `innerText` of a clicked HTML element matches a specific text, e.g. the label of a button. Display a survey on any button click!
3. **CSS Selector Action**
The CSS Selector action checks if the provided CSS selector matches the selector of a clicked HTML element. The CSS selector can be a class, id or any other CSS selector within your website. Display a survey on any element click!
## Code Actions
Actions can also be set in the codebase to trigger surveys. Please add the code action first in the Formbricks web interface to be able to configure your surveys to use this action.
After that you can fire an action using `formbricks.track()`
<Col>
<CodeGroup title="Track an action">
```javascript
formbricks.track("Action Name");
```
</CodeGroup>
</Col>
Here is an example of how to fire an action when a user clicks a button:
<Col>
<CodeGroup title="Track Button Click">
```javascript
const handleClick = () => {
formbricks.track("Button Clicked");
};
return <button onClick={handleClick}>Click Me</button>;
```
</CodeGroup>
</Col>

View File

@@ -1,86 +0,0 @@
export const metadata = {
title: "Identifying Users in Formbricks In-App Surveys",
description:
"Dive into the importance of user identification in surveys. Boost your survey response rates and target the right users with Formbricks.",
};
#### In-App Surveys
# User Identification
User Identification helps you to not only segment your users but also to see more information about the user who responded to a survey. This helps you to target surveys to specific user segments and see more information about the user who responded to a survey.
### Understanding Identified vs Unidentified Users
In Formbricks, understanding the distinction between identified and unidentified users is crucial for effective survey segmentation and targeted feedback collection.
| Feature | Unidentified Users | Identified Users |
| -------------------------------------------------------- | ------------------ | ---------------- |
| Show surveys based on **trigger** actions | ✅ | ✅ |
| Set **recontact details** to avoid survey fatique | ✅ | ✅ |
| Target a subset of users using **attributes & segments** | ❌ | ✅ |
| Collect **user information** in Formbricks | ❌ | ✅ |
| Track **custom attributes** | ❌ | ✅ |
| Counts towards your **monthly tacked user (MTU)** limit | ❌ | ✅ |
| Recommended for **public-facing websites** | ✅ | ❌ |
| Recommended for **web apps after login** | ❌ | ✅ |
## Unidentified Users
Unidentified users are those without a specific userId set. Surveys can still be presented to these users based on trigger actions, but without the granularity of user-specific targeting.
This method is recommended for public-facing websites where users are not required to log in.
<Col>
<CodeGroup title="Initialization without a user ID">
```javascript
formbricks.init({
environmentId: "<environment-id>",
apiHost: "<api-host>",
});
```
</CodeGroup>
</Col>
## Identified Users
Identified users are those for whom specific information has been set, notably the userId. This identification allows for more precise targeting of surveys and a deeper understanding of the feedback provided. When enabled, all information specified by you and all actions are sent to Formbricks.
This method is recommended for applications where users are required to log in and will often return.
**Setting the User ID:**
To identify a user, set the `userId` in the Formbricks initialization call. The userId should be a unique string, such as a database ID or an email address. This is essential for the user to be visible on the Formbricks dashboard.
<Col>
<CodeGroup title="Initialization with a user ID">
```javascript
formbricks.init({
environmentId: "<environment-id>",
apiHost: "<api-host>",
userId: "<user_id>",
});
```
</CodeGroup>
</Col>
**Logging Out Users:**
When a user logs out of your application, ensure they are also logged out of Formbricks. This prevents the association of their activities with the wrong user profile.
<Col>
<CodeGroup title="Logging out User">
```javascript
formbricks.logout();
```
</CodeGroup>
</Col>
<Note>
To set other custom attributes for a user, view our <a href="/docs/in-app-surveys/attributes">Attributes</a>{" "}
documentation.
</Note>

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}
@@ -123,7 +123,6 @@ We will first create a Google Cloud Project and then enable the Google Sheets AP
- `GOOGLE_SHEETS_CLIENT_ID` - Client ID
- `GOOGLE_SHEETS_CLIENT_SECRET` - Client Secret
16. Also use the **same Authorized redirect URI** in the `GOOGLE_SHEETS_REDIRECT_URL` environment variable.
17. One last that we need to do is to **enable the Google Drive API** for the project. For that, go to the "**APIs & Services**" section and click on the "**Enable APIs and Services**" button and search for "**Google Drive API**" and enable it.
### By now, your environment variables should include the below ones as well:

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

@@ -1,133 +0,0 @@
import Image from "next/image";
import Img1 from "./1-wordpress-targeted-survey-on-website-free.webp";
import Img2 from "./2-run-website-survey-wordpress-targeted-for-free.webp";
import Img3 from "./3-wordpress-setup-survey-on-website-targeted-free-open-source.webp";
import Img4 from "./4-wordpress-website-survey-target-visitor-free.webp";
import Img5 from "./step-4-copy-to-wordpress-for-free-targeted-survey.webp";
import Img6 from "./6-targeted-survey-on-wordpress-website-for-free.webp";
import Img7 from "./7-wordpress-free-hotjar-survey-open-source-website-survey-hotjar.webp";
export const metadata = {
title: "Run targeted surveys on your WordPress page",
description:
"Target specific visitors with a survey on your WordPress page using Formbricks for free. Show survey on specific page or on button click.",
};
#### WordPress
# Connect Formbricks with your WordPress page
If you want to run a targeted survey on your WordPress website, Formbricks is the way to go! With our generous free plan and open source tech, you get everything you need to get started and keep full control over your data.
## TLDR
1. Install the Formbricks WordPress plugin
2. Create a [free Formbricks account](https://app.formbricks.com/auth/signup)
3. Find and copy the `environment id`
4. Copy the environment id into the right field in the plugin settings
5. Create survey on trigger “New Session” to test it
## Step 1: Install the Formbricks WordPress plugin
As long as the Formbricks plugin is in review, please download it from our [GitHub repository directly.](https://github.com/formbricks/wordpress)
<Image
src={Img1}
alt="Run targeted website survye on any WordPress site"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
/>
## Step 2: Create a Formbricks Account
This is super straight forward: Go to [app.formbricks.com/auth/signup](https://app.formbricks.com/auth/signup), create the account, verify your email and youre in!
When you see this screen, youre there:
<Image
src={Img2}
alt="Free HotJar survey alternative open source"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
/>
## Step 3: Find and copy the environmentId
Go to Settings > Setup Checklist where youll find your environmentId:
<Image
src={Img3}
alt="Run targeted surveys for free on WordPress pages"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
/>
## Step 4: Copy the environmentId to the WordPress Plugin Settings
In your WordPress instance, go to the Formbricks Plugin settings and copy the environmentId in the correct field:
<Image
src={Img5}
alt="Free and open source HotJar survey on WordPress page"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
/>
Then click the button at the bottom to see if the connection worked.
<Note>If you dont use our Cloud, you also have to update the API Host</Note>
Great!
## Step 5: Create survey on trigger “New Session”
Now that all is setup, we create a survey to display an example survey. Pick any template here:
<Image
src={Img2}
alt="Free HotJar survey alternative open source"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
/>
Keep the content for now, click on the Settings tab:
<Image
src={Img4}
alt="Free and open source HotJar survey on WordPress page"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
/>
Here we do three things:
1. Change survey type to “In-App Survey”
2. Select trigger “New Session”
3. Publish
<Image
src={Img6}
alt="Open Source survey on targeted website wordpress"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
/>
When you see this page, you did it!
<Image
src={Img7}
alt="Run free an open source targeted survey on any page"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
/>
## Step 6: Reload your page to check out your survey 🤓
You did it! Reload the WordPress page and your survey should appear!
## Doesn't work?
Join our [Discord to get help 🤓](https://formbricks.com/discord)

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

View File

@@ -1,88 +0,0 @@
import Image from "next/image";
import HomePage from "./home-page.webp";
import SurveyQuestions from "./survey-questions.webp";
import SurveySettings from "./survey-settings.webp";
import SurveyResponseOptions from "./survey-response-options.webp";
import SurveyPublished from "./survey-published.webp";
export const metadata = {
title: "Formbricks Quickstart Guide: Link Surveys Made Easier & Faster",
description:
"Formbricks is the easiest way to create and manage link surveys. This quickstart guide will show you how to create your first link survey in under 5 minutes.",
};
#### Getting Started
# Quickstart
Link Surveys make it easy for your users to give you feedback. They are a great way to get feedback from your users, without interrupting their workflow. This quickstart guide will show you how to create your first link survey in under 5 minutes.
## Create a free Formbricks Cloud account
While you can [self-host](/docs/self-hosting/deployment) Formbricks, but the quickest and easiest way to get started is with the free Cloud plan. Just [sign up here](https://app.formbricks.com/auth/signup) and click through the onboarding, until youre here:
<Image
src={HomePage}
alt="Choose a link survey template"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl "
/>
Choose one of the pre-created templates to get started. Well choose the **Product Market Fit** template for this quickstart guide.
## Create your first survey
On clicking the template, youll be forwarded to the survey editor. Here you can edit the survey questions and settings. For the sake of simplicity, we'll keep the questions as they are and move to the survey settings.
<Image
src={SurveyQuestions}
alt="Survey Editor opens up in the Formbricks App"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
/>
Click on the **Settings** tab to edit the survey settings.
## Configure your survey settings
Formbricks packs a lot of useful functionality out of the box. You can:
- Close the survey on a specidic date
- After a number of response
- Redirect users to a URL after they completed the survey
- Protect survey with a Pin
- ... and much more!
<Image
src={SurveyResponseOptions}
alt="Survey response configuration for link survey"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
/>
## Style your survey
Style your survey to your need. You can keep it simplistic or use animated backgrounds. You can change the main color and soon you'll be able to fully control the appearance of the survey.
<Image
src={SurveySettings}
alt="UI & View configuration for link survey"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
/>
## Publish your survey
Once youre happy with the survey settings, hit **Publish** and youll be forwarded to the Summary Page. This is where youll find the responses to this survey.
<Image
src={SurveyPublished}
alt="Survey published successfully and received link to share with users"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
/>
## Share your survey
Congratulations! Your survey is now published and ready to be shared with your users. You can share the survey link via email, SMS, or any other channel.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

View File

@@ -1,70 +0,0 @@
import Image from "next/image";
import ShareLink from "./share-link.webp";
import ViewResponse from "./view-response.webp";
export const metadata = {
title: "Source Tracking",
description: "Track the source of your users in an easy & compliant way!",
};
#### Link Surveys
# Source Tracking
Understand the source a survey respondent comes from when responding to your survey - all while keeping data privacy standards high!
Check out this video to learn more about source tracking in link surveys:
{/* Replace link below with our new link on Source Tracking */}
<iframe width="700" height="450" src="https://www.youtube.com/embed/CytWhuyEMVI?si=t-SFB2A1l1RZDdAC" title="YouTube video player: Formbricks" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"></iframe>
## Purpose
Source tracking for link surveys is essential when you:
- Want to analyze the origin of your survey respondents.
- Aim to ensure compliance with tracking and data collection regulations.
## Code Example
<Col>
<CodeGroup title="Example Source as Google">
```sh
https://formbricks.com/clin3dxja02k8l80hpwmx4bjy?source=Google
```
</CodeGroup>
</Col>
## How it Works
To track the source of users in your link surveys effectively, follow these steps:
1. **Generate Survey URL**: Create a Link Survey and get the sharable link. Append `?source=YourSouce` to the link to reference it with your campaigns and sources.
<Col>
<CodeGroup title="Example Source as Google">
```sh
https://formbricks.com/clin3dxja02k8l80hpwmx4bjy?source=Google
```
</CodeGroup>
</Col>
2. **Collect Data**: When users access the survey through these links, the URL parameters will capture the source information from which they were shared.
3. **View Responses**: Use the collected source data to analyze where your survey respondents are coming from. You can hover over the user icon in the responses tab to see the source of the user.
<Image
src={ViewResponse}
alt="View Source in Response"
quality="100"
className="max-w-full rounded-lg sm:max-w-3xl"
/>
4. **Analyse Data**: Download all the responses as a CSV/Excel and get access to the source information. This can provide valuable insights into your audience.
Source tracking allows you to make informed decisions based on the origin of your survey participants, helping you tailor your surveys and marketing strategies accordingly.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

View File

@@ -1,24 +0,0 @@
export const metadata = {
title: "Self-hosting License to run Formbricks on premises",
description:
"Request a self-hosting licenses to run Formbricks on your own servers.",
};
#### Self-Hosting
# License Request (Beta)
We're handing out free self-hosting license keys during our Beta.
**Please note:** Sooner than later we will introduce a self-hosting license pricing. For a free beta key, fill out this form:
<div style={{ position: 'relative', height: '100vh', maxHeight: '100vh', overflow: 'auto', borderRadius:'12px' }}>
<iframe
src="https://app.formbricks.com/s/clrf4z8zg1u3912250j7shqb5"
style={{ position: 'absolute', left: 0, top: 0, width: '100%', height: '100%', border: 0 }}
>
</iframe>
</div>
**Cant figure it out?**: [Join our Discord!](https://formbricks.com/discord)

View File

@@ -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/formbricks.sh -o formbricks.sh && chmod +x formbricks.sh && ./formbricks.sh install
curl -fsSL https://raw.githubusercontent.com/formbricks/formbricks/main/docker/production.sh -o formbricks.sh && chmod +x formbricks.sh && ./formbricks.sh install
```
</CodeGroup>
@@ -219,16 +219,18 @@ The script will automatically stop all the Formbricks related containers, remove
## Debugging
If you encounter any issues, you can check the logs of the containers with:
If you encounter any issues, you can check the logs of the container with:
<Col>
<CodeGroup title="Check logs of the container">
```bash
./formbricks.sh logs
cd formbricks && docker compose logs -f
```
</CodeGroup>
</Col>
You can close the logs again with `CTRL + C`.
## Troubleshooting
@@ -242,4 +244,4 @@ If you encounter any issues, consider the following steps:
- **Check Formbricks Logs**: Run `cd formbricks && docker compose logs` to check the logs of the Formbricks stack.
**Cant figure it out?**: [Join our Discord!](https://formbricks.com/discord)
**Still cant figure it out?**: [Join our Discord!](https://formbricks.com/discord)

View File

@@ -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

@@ -89,7 +89,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

@@ -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

@@ -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

@@ -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

@@ -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

@@ -189,24 +189,35 @@ export const navigation: Array<NavGroup> = [
],
},
{
title: "In-App Surveys",
title: "Getting Started",
links: [
{ title: "Quickstart", href: "/docs/getting-started/quickstart-in-app-survey" },
{ title: "Quickstart: In app", href: "/docs/getting-started/quickstart-in-app-survey" },
{ title: "Framework Guides", href: "/docs/getting-started/framework-guides" },
{ title: "Troubleshooting", href: "/docs/getting-started/troubleshooting" },
{ title: "Identify Users", href: "/docs/in-app-surveys/user-identification" },
{ title: "Actions", href: "/docs/in-app-surveys/actions" },
{ title: "Attributes", href: "/docs/in-app-surveys/attributes" },
],
},
{
title: "Attributes",
links: [
{ title: "Why Attributes?", href: "/docs/attributes/why" },
{ title: "Custom Attributes", href: "/docs/attributes/custom-attributes" },
{ title: "Identify users", href: "/docs/attributes/identify-users" },
],
},
{
title: "Actions",
links: [
{ title: "Why Actions?", href: "/docs/actions/why" },
{ title: "No-Code Actions", href: "/docs/actions/no-code" },
{ title: "Code Actions", href: "/docs/actions/code" },
],
},
{
title: "Link Surveys",
links: [
{ title: "Quickstart", href: "/docs/link-surveys/quickstart" },
{ 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: "Source Tracking", href: "/docs/link-surveys/source-tracking" },
],
},
{
@@ -219,7 +230,6 @@ export const navigation: Array<NavGroup> = [
{ title: "Feature Chaser", href: "/docs/best-practices/feature-chaser" },
{ title: "Feedback Box", href: "/docs/best-practices/feedback-box" },
{ title: "Docs Feedback", href: "/docs/best-practices/docs-feedback" },
{ title: "Improve Email Content", href: "/docs/best-practices/improve-email-content" },
],
},
{
@@ -227,10 +237,8 @@ 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: "Wordpress", href: "/docs/integrations/wordpress" },
{ title: "Zapier", href: "/docs/integrations/zapier" },
],
},
@@ -242,7 +250,6 @@ export const navigation: Array<NavGroup> = [
{ title: "Advanced Setup", href: "/docs/self-hosting/docker" },
{ title: "Configure", href: "/docs/self-hosting/external-auth-providers" },
{ title: "Migration Guide", href: "/docs/self-hosting/migration-guide" },
{ title: "Self-hosting License", href: "/docs/self-hosting/license" },
],
},
{
@@ -275,7 +282,6 @@ export const navigation: Array<NavGroup> = [
{ title: "Attribute Classes", href: "/docs/api/management/attribute-classes" },
{ title: "Me", href: "/docs/api/management/me" },
{ title: "People", href: "/docs/api/management/people" },
{ title: "Responses", href: "/docs/api/management/responses" },
{ title: "Surveys", href: "/docs/api/management/surveys" },
{ title: "Webhooks", href: "/docs/api/management/webhooks" },
],

View File

@@ -243,7 +243,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 +336,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 +409,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 +432,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

@@ -55,7 +55,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 +80,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

@@ -27,7 +27,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,10 +1,11 @@
import * as DOMPurify from "dompurify";
/* import { cleanHtml } from "../../lib/cleanHtml"; */
import { cleanHtml } from "@formbricks/lib/cleanHtml";
export default function HtmlBody({ htmlString, questionId }: { htmlString: string; questionId: string }) {
return (
<label
htmlFor={questionId}
className="fb-block fb-font-normal fb-leading-6 text-sm text-slate-500 dark:text-slate-300"
dangerouslySetInnerHTML={{ __html: DOMPurify.sanitize(htmlString) }}></label>
dangerouslySetInnerHTML={{ __html: cleanHtml(htmlString) }}></label>
);
}

View File

@@ -22,7 +22,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

@@ -50,7 +50,7 @@ export default function NPSQuestion({ question, onSubmit, lastQuestion, brandCol
selectedChoice === number
? "z-10 bg-slate-50 dark:bg-slate-500"
: "dark:bg-slate-700 dark:hover:bg-slate-500",
"relative h-10 flex-1 cursor-pointer border bg-white text-center text-sm leading-10 text-slate-900 first:rounded-l-md last:rounded-r-md hover:bg-slate-100 focus:outline-none dark:border-slate-600 dark:text-white "
"relative h-10 flex-1 cursor-pointer border bg-white text-center text-sm leading-10 text-slate-900 first:rounded-l-md last:rounded-r-md hover:bg-gray-100 focus:outline-none dark:border-slate-600 dark:text-white "
)}>
<input
type="radio"

View File

@@ -42,7 +42,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

@@ -56,7 +56,7 @@ export default function RatingQuestion({
className={cn(
selectedChoice === number
? "z-10 border-slate-400 bg-slate-50"
: "bg-white hover:bg-slate-100 dark:bg-slate-700 dark:hover:bg-slate-500",
: "bg-white hover:bg-gray-100 dark:bg-slate-700 dark:hover:bg-slate-500",
"relative h-10 flex-1 cursor-pointer border border-slate-100 text-center text-sm leading-10 text-slate-800 first:rounded-l-md last:rounded-r-md focus:outline-none dark:border-slate-500 dark:text-slate-200 "
)}>
<input

View File

@@ -53,11 +53,12 @@ export default function TemplateList({ onTemplateClick, activeTemplate }: Templa
{templates
.filter((template) => selectedFilter === ALL_CATEGORY_NAME || template.category === selectedFilter)
.map((template: TTemplate) => (
<div
key={template.name}
<button
type="button"
onClick={() => {
onTemplateClick(template); // Pass the 'template' object instead of 'activeTemplate'
}}
key={template.name}
className={cn(
activeTemplate?.name === template.name && "ring-brand ring-2",
"duration-120 group relative rounded-lg bg-white p-6 shadow transition-all duration-150 hover:scale-105 dark:bg-slate-700"
@@ -70,7 +71,7 @@ export default function TemplateList({ onTemplateClick, activeTemplate }: Templa
{template.name}
</h3>
<p className="text-left text-xs text-slate-600 dark:text-slate-400">{template.description}</p>
</div>
</button>
))}
</div>
</main>

View File

@@ -14,7 +14,6 @@ import {
DashboardIcon,
DogChaserIcon,
DoorIcon,
EmailIcon,
FeedbackIcon,
GaugeSpeedFastIcon,
HeartCommentIcon,
@@ -1225,61 +1224,6 @@ export const templates: TTemplate[] = [
},
},
},
{
name: "Improve Newsletter Content",
icon: EmailIcon,
category: "Growth",
description: "Find out how your subscribers like your newsletter content.",
objectives: ["increase_conversion", "sharpen_marketing_messaging"],
preset: {
name: "Improve Newsletter Content",
questions: [
{
id: createId(),
type: TSurveyQuestionType.Rating,
logic: [
{ value: "5", condition: "equals", destination: "l2q1chqssong8n0xwaagyl8g" },
{ value: "5", condition: "lessThan", destination: "k3s6gm5ivkc5crpycdbpzkpa" },
],
range: 5,
scale: "smiley",
headline: "How would you rate this weeks newsletter?",
required: true,
subheader: "",
lowerLabel: "Meh",
upperLabel: "Great",
},
{
id: "k3s6gm5ivkc5crpycdbpzkpa",
type: TSurveyQuestionType.OpenText,
logic: [
{ condition: "submitted", destination: "end" },
{ condition: "skipped", destination: "end" },
],
headline: "What would have made this weeks newsletter more helpful?",
required: false,
placeholder: "Type your answer here...",
inputType: "text",
},
{
id: "l2q1chqssong8n0xwaagyl8g",
html: '<p class="fb-editor-paragraph" dir="ltr"><span>Who thinks like you? You\'d do us a huge favor if you\'d share this weeks episode with your brain friend!</span></p>',
type: TSurveyQuestionType.CTA,
headline: "Thanks! ❤️ Spread the love with ONE friend.",
required: false,
buttonUrl: "https://formbricks.com",
buttonLabel: "Happy to help!",
buttonExternal: true,
dismissButtonLabel: "Find your own friends",
},
],
welcomeCard: welcomeCardDefault,
thankYouCard: thankYouCardDefault,
hiddenFields: {
enabled: false,
},
},
},
];
export const findTemplateByName = (name: string): TTemplate | undefined => {

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