Environments are isolated data containers in Formbricks. Each project has exactly two environments: Development and Production. They ensure you can test surveys, integrations, and configurations without affecting real user data.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/formbricks/formbricks/llms.txt
Use this file to discover all available pages before exploring further.
What is an Environment?
An environment is a complete, isolated instance of your Formbricks setup within a project. Each environment has its own:- Surveys: Different surveys in dev and prod
- Contacts: Separate user bases
- Responses: Isolated response data
- Action Classes: Different triggers and events
- Attribute Keys: Custom attributes schema
- Integrations: Separate webhook endpoints, API keys
- API Keys: Unique credentials per environment
The Two Environment Types
Every Formbricks project includes:Development Environment
Purpose: Test surveys, iterate on questions, and experiment with configurations before going live. Use cases:- Build and preview surveys without users seeing them
- Test survey logic and branching
- Experiment with integrations (webhooks, Slack, etc.)
- Train team members without affecting real data
- Debug SDK implementations
- Isolated from production users
- Safe to delete data and start fresh
- Can generate test responses
- Not billed for responses (on most plans)
- Create survey in Development
- Preview and test locally
- Share with team for review
- Once approved, duplicate to Production
Production Environment
Purpose: Collect real responses from real users. Use cases:- Live surveys shown to customers
- Real response data for analysis
- Production integrations to your CRM, Slack, etc.
- User-facing feedback loops
- Connected to your live app/website
- Contains real user data
- Subject to data retention and privacy policies
- Counted towards response limits (on paid plans)
How Environments Work
Data Isolation
Environments are completely isolated:Environment IDs
Each environment has a unique ID (starts withclx... or similar cuid).
Where you’ll use Environment IDs:
In your app (SDK initialization):
Common Environment Workflows
Workflow 1: Develop and Test Surveys
Create Survey in Development
Build your survey in the Development environment. Add questions, configure triggers, and set targeting rules.
Test Locally
Initialize the Formbricks SDK with your Development environment ID in your local app. Trigger the survey and verify it appears correctly.
Review with Team
Share the Development environment link with your team. Collect internal feedback on the survey.
Duplicate to Production
Once approved, use the “Duplicate Survey” feature to copy it to Production. This creates an identical survey in the Production environment.
Workflow 2: Debugging SDK Integration
Check Formbricks Dashboard
In the Development environment, go to Settings → Setup to see if your SDK is connected and sending data.
Workflow 3: A/B Testing Survey Variants
You can create multiple survey variants in Development and test them before choosing one for Production:- Create 2-3 survey variants in Development
- Test each with internal users
- Analyze completion rates and response quality
- Duplicate the winner to Production
Environment Settings
Each environment has its own configuration:API Keys
Generate separate API keys for Development and Production.- Development API Key: Use in local/staging environments
- Production API Key: Use in production, keep secret
Setup Checklist
Formbricks tracks whether your environment is properly configured:- SDK installed and initialized
- First action received
- First contact created
- First response received
Webhooks & Integrations
Integrations are per-environment:- Development webhooks can point to staging/test endpoints
- Production webhooks point to live systems
- Dev environment webhook:
https://staging.yourapp.com/formbricks-webhook - Prod environment webhook:
https://yourapp.com/formbricks-webhook
Switching Between Environments
In the Formbricks Dashboard
Use the environment switcher in the top navigation bar:In Your App (SDK)
Use environment variables to switch:NODE_ENV.
In API Requests
Include the environment ID in the API endpoint:Best Practices
Always Test in Development First
Always Test in Development First
Never publish a survey directly to Production without testing in Development. Bugs and issues are inevitable—catch them early.
Use Separate API Keys
Use Separate API Keys
Never use Production API keys in your local or staging environments. Rotate keys if accidentally exposed.
Don't Mix Environment IDs
Don't Mix Environment IDs
Hardcoding the wrong environment ID is a common mistake. Always use environment variables and verify which environment your app is using.
Keep Production Data Clean
Keep Production Data Clean
Delete test responses in Production immediately. Use Development for all testing to avoid polluting analytics.
Document Your Setup
Document Your Setup
Keep a README with your Development and Production environment IDs, API keys location, and setup instructions for new team members.
Review Prod Changes Carefully
Review Prod Changes Carefully
Editing a live survey in Production affects users immediately. Double-check changes or duplicate to Dev first to preview.
Common Questions
Can I create more than 2 environments?
Can I create more than 2 environments?
No, each project has exactly 2 environments: Development and Production. If you need more separation, create multiple projects (e.g., “Web App” and “Mobile App”).
Can I rename environments?
Can I rename environments?
No, environment types are fixed. However, project names are customizable.
Can I copy data from Production to Development?
Can I copy data from Production to Development?
Not automatically. You can duplicate surveys, but responses and contacts remain separate. This is intentional to protect user privacy.
What happens if I use the wrong environment ID?
What happens if I use the wrong environment ID?
Your app will send data to the wrong environment. Development data will pollute Production (or vice versa). Always use environment variables and verify your setup.
Are environments billed separately?
Are environments billed separately?
Typically, only Production responses count towards billing. Check your plan for details.
Next Steps
Surveys
Learn how to create and configure surveys within environments
Contacts
Understand how contacts are tracked per environment
API Keys
Generate and manage API keys for each environment
SDK Setup
Configure the SDK to switch between environments