Merge branch 'formbricks:main' into fix/sentry-useClickOutside-contains-error

This commit is contained in:
Raghuraj Pratap Singh
2025-10-01 21:11:39 +05:30
committed by GitHub
4 changed files with 199 additions and 38 deletions

View File

@@ -1,13 +1,13 @@
"use client";
import { cn } from "@/lib/cn";
import { Badge } from "@/modules/ui/components/badge";
import { Button } from "@/modules/ui/components/button";
import { ConfirmationModal } from "@/modules/ui/components/confirmation-modal";
import { useTranslate } from "@tolgee/react";
import { CheckIcon } from "lucide-react";
import { useMemo, useState } from "react";
import { TOrganization, TOrganizationBillingPeriod } from "@formbricks/types/organizations";
import { cn } from "@/lib/cn";
import { Badge } from "@/modules/ui/components/badge";
import { Button } from "@/modules/ui/components/button";
import { ConfirmationModal } from "@/modules/ui/components/confirmation-modal";
import { TPricingPlan } from "../api/lib/constants";
interface PricingCardProps {
@@ -170,14 +170,13 @@ export const PricingCard = ({
{plan.id !== projectFeatureKeys.FREE && isCurrentPlan && (
<Button
variant="secondary"
loading={loading}
onClick={async () => {
setLoading(true);
await onManageSubscription();
setLoading(false);
}}
className="flex justify-center">
className="flex justify-center bg-[#635bff]">
{t("environments.settings.billing.manage_subscription")}
</Button>
)}

View File

@@ -6,23 +6,37 @@ icon: "key"
To unlock Formbricks Enterprise Edition features, you need to activate your Enterprise License Key. Follow these steps to activate your license:
## 1. Set the License Key
<Steps>
<Step title="Set the License Key">
Add your Enterprise License Key as an environment variable in your deployment:
Add your Enterprise License Key as an environment variable in your deployment:
```bash
ENTERPRISE_LICENSE_KEY=
```
```bash
ENTERPRISE_LICENSE_KEY=
```
- Add your Enterprise License Key after `ENTERPRISE_LICENSE_KEY=` with the key you received from Formbricks.
- How you set environment variables depends on your deployment (Docker, Kubernetes, .env file, etc.).
</Step>
- Add your Enterprise License Key after `ENTERPRISE_LICENSE_KEY=` with the key you received from Formbricks.
- How you set environment variables depends on your deployment (Docker, Kubernetes, .env file, etc.).
<Step title="Restart Your Instance">
After setting the environment variable, **restart your Formbricks instance** to apply the changes.
</Step>
## 2. Restart Your Instance
<Step title="Verify License Activation">
To verify if your license is active, visit `Organization Settings` -> `Enterprise License` to check the confirmation screen.
</Step>
After setting the environment variable, **restart your Formbricks instance** to apply the changes.
<Step title="Ensure License Server is Reachable">
Your Formbricks instance performs a daily license check to verify your Enterprise License. If you're deploying Formbricks behind a firewall or have network restrictions, you need to whitelist the following:
## 3. Verify License Activation
To verify if your license is active, visit `Organization Settings` -> `Enterprise License` to check the confirmation screen.
- **Domain**: `ee.formbricks.com`
- **URL**: `https://ee.formbricks.com/api/licenses/check`
- **Protocol**: HTTPS (Port 443)
- **Method**: POST
- **Frequency**: Every 24 hours
### Troubleshooting
Your server needs to be able to reach the Formbricks License Server. In case you're deploying Formbricks behind a firewall, please reach out to hola@formbricks.com for more info.
The license check includes a 3-day grace period. If the check fails temporarily, your instance will continue using cached license information for up to 3 days.
</Step>
</Steps>
If you have questions or need assistance with network configuration, please reach out to hola@formbricks.com.

View File

@@ -4,10 +4,10 @@ description: "License for Formbricks"
icon: "file-certificate"
---
The Formbricks core source code is licensed under AGPLv3 and available on GitHub. Additionally, we offer features for bigger organisations & enterprises under a separate, paid Enterprise License. This assures the long-term sustainability of the open source project. All free features are listed [below](#what-features-are-free).
The Formbricks core source code is licensed under AGPLv3 and available on GitHub. Additionally, we offer features for bigger organisations & enterprises under a separate, paid Enterprise License. This assures the long-term sustainability of the open source project. All free features are listed [below](#what-features-are-free%3F).
<Note>
Want to get your hands on the Enterprise Edition? [Request a free 60-day Enterprise Edition
Want to get your hands on the Enterprise Edition? [Request a free Enterprise Edition
Trial](https://formbricks.com/enterprise-license?source=docs) License to build a fully functioning Proof of
Concept.
</Note>
@@ -18,21 +18,17 @@ Additional to the AGPLv3 licensed Formbricks core, the Formbricks repository con
## When do I need an Enterprise License?
| | Community Edition | Enterprise License |
| | Community Edition | Enterprise Edition |
| ------------------------------------------------------------- | ----------------- | ------------------ |
| Self-host for commercial purposes | ✅ | No license needed |
| Fork codebase, make changes, release under AGPLv3 | ✅ | No license needed |
| Self-host for commercial purposes | ✅ | |
| Fork codebase, make changes, release under AGPLv3 | ✅ | |
| Fork codebase, make changes, **keep private** | ❌ | ✅ |
| Unlimited responses | ✅ | No license needed |
| Unlimited surveys | ✅ | No license needed |
| Unlimited users | ✅ | No license needed |
| Unlimited responses | ✅ | Pay per response |
| Unlimited surveys | ✅ | |
| Unlimited users | ✅ | |
| Projects | 3 | Unlimited |
| Use any of the other [free features](#what-features-are-free) | ✅ | No license needed |
| Remove branding | ❌ | |
| SSO | ❌ | ✅ |
| Contacts & Targeting | ❌ | ✅ |
| Teams & access roles | ❌ | ✅ |
| Use any of the [paid features](#what-features-are-free) | ❌ | ✅ |
| Use all [free features](#what-features-are-free%3F) | ✅ | |
| Use [paid features](#what-features-are-free%3F) | ❌ | Pay per feature |
## Open Core Licensing
@@ -45,14 +41,14 @@ The Formbricks core application is licensed under the [AGPLv3 Open Source Licens
Additional to the AGPL licensed Formbricks core, this repository contains code licensed under an Enterprise license. The [code](https://github.com/formbricks/formbricks/tree/main/apps/web/modules/ee) and [license](https://github.com/formbricks/formbricks/blob/main/apps/web/modules/ee/LICENSE) for the enterprise functionality can be found in the `/apps/web/modules/ee` folder of this repository. This additional functionality is not part of the AGPLv3 licensed Formbricks core and is designed to meet the needs of larger teams and enterprises. This advanced functionality is already included in the Docker images, but you need an [Enterprise License Key](https://formbricks.com/enterprise-license?source=docs) to unlock it.
<Note>
Want to get your hands on the Enterprise Edition? [Request a free 60-day Enterprise Edition
Want to get your hands on the Enterprise Edition? [Request a free Enterprise Edition
Trial](https://formbricks.com/enterprise-license?source=docs) License to build a fully functioning Proof of
Concept.
</Note>
## White-Labeling Formbricks and Other Licensing Needs
We currently do not offer Formbricks white-labeled. Any other needs? [Send us an email](mailto:hola@formbricks.com).
We offer Formbricks white-labeled in some cases. [Please send us an email with a project description and we'll get back to you.](mailto:hola@formbricks.com).
## Why charge for Enterprise Features?
@@ -63,6 +59,8 @@ The Enterprise Edition allows us to fund the development of Formbricks sustainab
| Feature | Community Edition | Enterprise Edition |
| ---------------------------------------------- | ----------------- | ------------------ |
| Unlimited surveys | ✅ | ✅ |
| Full API Access | ✅ | ✅ |
| All SDKs | ✅ | ✅ |
| Website & App surveys | ✅ | ✅ |
| Link surveys | ✅ | ✅ |
| Email embedded surveys | ✅ | ✅ |
@@ -77,18 +75,18 @@ The Enterprise Edition allows us to fund the development of Formbricks sustainab
| Hidden fields | ✅ | ✅ |
| Single-use links | ✅ | ✅ |
| Pin-protected surveys | ✅ | ✅ |
| Full API Access | ✅ | ✅ |
| All SDKs | ✅ | ✅ |
| Webhooks | ✅ | ✅ |
| Email follow-ups | ✅ | ✅ |
| Multi-language UI | ✅ | ✅ |
| All integrations (Slack, Zapier, Notion, etc.) | ✅ | ✅ |
| Domain Split Configuration | ✅ | ✅ |
| Cluster Hosting via Formbricks Helm Chart | ✅ | ✅ |
| Hide "Powered by Formbricks" | ❌ | ✅ |
| Whitelabel email follow-ups | ❌ | ✅ |
| Teams & access roles | ❌ | ✅ |
| Contact management & segments | ❌ | ✅ |
| Multi-language surveys | ❌ | ✅ |
| Quota Management | ❌ | ✅ |
| Audit Logs | ❌ | ✅ |
| OIDC SSO (AzureAD, Google, OpenID) | ❌ | ✅ |
| SAML SSO | ❌ | ✅ |
@@ -98,4 +96,4 @@ The Enterprise Edition allows us to fund the development of Formbricks sustainab
| White-glove onboarding | ❌ | ✅ |
| Support SLAs | ❌ | ✅ |
**Any more questions?** [Send us an email](mailto:johannes@formbricks.com) or [book a call with us.](https://cal.com/johannes/license)
Questions? [Send us an email](mailto:johannes@formbricks.com) or [book a call with us.](https://cal.com/johannes/license)

150
packages/surveys/README.md Normal file
View File

@@ -0,0 +1,150 @@
## Overview
The `@formbricks/surveys` package provides a complete survey rendering system built with Preact/React. It features automated translation management through Lingo.dev.
## Features
- **Survey Components**: Complete set of survey question types and UI components
- **Internationalization**: Built with i18next and react-i18next
- **Type Safety**: Full TypeScript support
- **Testing**: Comprehensive test coverage with Vitest
- **Lightweight**: Built with Preact for optimal bundle size
- **Multi-language Support**: Supports 10+ languages with automated translation generation
## Architecture
### File Structure
```text
packages/surveys/
├── locales/ # Translation files
│ ├── en.json # Source translations (English)
│ ├── de.json # Generated translations (German)
│ ├── fr.json # Generated translations (French)
│ └── ... # Other target languages
├── i18n.json # lingo.dev configuration
├── src/
│ ├── components/
│ │ ├── buttons/ # Survey navigation buttons
│ │ ├── general/ # Core survey components
│ │ ├── i18n/
│ │ │ └── provider.tsx # i18n provider component
│ │ ├── icons/ # Icon components
│ │ ├── questions/ # Question type components
│ │ └── wrappers/ # Layout wrappers
│ ├── lib/
│ │ ├── i18n.config.ts # i18next configuration
│ │ ├── i18n-utils.ts # Utility functions
│ │ └── ... # Other utilities
│ ├── styles/ # CSS styles
│ └── types/ # TypeScript types
└── package.json
```
## Setting Up Automated Translations
### Prerequisites
- [Lingo.dev](https://Lingo.dev) API key
- Access to the Formbricks team on Lingo.dev
### Step-by-Step Setup
1. **Join the Formbricks Team**
- Join the Formbricks team on Lingo.dev
2. **Get Your API Key**
- In the sidebar, go to **Projects** and open the default project
- Navigate to the **Settings** tab
- Copy the API key
3. **Configure Environment Variables**
In the surveys package directory, create a `.env` file:
```bash
# packages/surveys/.env
LINGODOTDEV_API_KEY=<YOUR_API_KEY>
```
4. **Generate Translations**
Run the translation generation script:
```bash
# From the root of the repo or from within the surveys package
pnpm run i18n:generate
```
This will execute the auto-translate script and update translation files if needed.
## Development Workflow
### Adding New Translation Keys
1. **Update Source File**: Add new keys to `packages/surveys/locales/en.json`
2. **Generate Translations**: Run `pnpm run i18n:generate`
3. **Update Components**: Use the new translation keys in your components with `useTranslation` hook
4. **Test**: Verify translations work across all supported languages
### Updating Existing Translations
1. **Update Target File**: Update the translation keys in the target language file (`packages/surveys/locales/<target-language>.json`)
2. **Test**: Verify translations work across all supported languages
3. You don't need to run the `i18n:generate` command as it is only required when the source language is updated.
### Adding New Languages
#### 1. Update lingo.dev Configuration
Edit `packages/surveys/i18n.json` to include new target languages:
```json
{
"locale": {
"source": "en",
"targets": ["de", "it", ...otherLanguages, "new-lang"]
}
}
```
#### 2. Update i18n Configuration
Modify `packages/surveys/src/lib/i18n.config.ts`:
```tsx
// Add new import
import newLangTranslations from "../../locales/new-lang.json";
i18n
.use(ICU)
.use(initReactI18next)
.init({
supportedLngs: ["en", "de", ...otherLanguages, "new-lang"],
resources: {
// ... existing resources
"new-lang": { translation: newLangTranslations },
},
});
```
#### 3. Generate Translation Files
Run the translation generation command:
```bash
pnpm run i18n:generate
```
This will create new translation files in the `locales/` directory for each target language.
## Scripts
- `pnpm dev` - Start development build
- `pnpm build` - Build for production
- `pnpm test` - Run tests
- `pnpm test:coverage` - Run tests with coverage
- `pnpm i18n:generate` - Generate translations using Lingo.dev
- `pnpm lint` - Lint and fix code