Core Concepts
Understanding feature flags, environments, targeting, and more
Core Concepts
This page explains the key concepts in Flipswitch that you'll use to manage feature flags.
Organizations
An organization is the top-level container for all your projects. Organizations have:
- Members - Users who can access projects
- Groups - Collections of users with shared permissions
- Projects - Containers for flags and environments
Projects
A project typically represents an application or service. Each project contains:
- Flags - Feature flags with variants and rules
- Environments - Isolated configurations (dev, staging, prod)
- Segments - Reusable user groups for targeting
Environments
Environments allow you to configure flags differently for each stage of your deployment pipeline.
| Environment | Use Case |
|---|---|
| Development | Testing new features locally |
| Staging | Pre-production validation |
| Production | Live user traffic |
Each environment has its own:
- Flag states (enabled/disabled)
- Targeting rules
- API keys
Flags exist at the project level, but their rules and states are configured per environment.
Feature Flags
A feature flag controls the behavior of your application. Flags have:
Key
A unique identifier using kebab-case (e.g., dark-mode, new-checkout-flow).
Type
The data type of the flag value:
| Type | Example Values |
|---|---|
| Boolean | true, false |
| String | "variant-a", "blue" |
| Number | 100, 3.14 |
| Object | { "theme": "dark", "maxItems": 10 } |
Variants
Named values the flag can return. Every flag has at least two variants:
- Default variant - Returned when the flag is disabled or no rules match
- Additional variants - Used for A/B testing or feature variations
Default Value
The value returned when:
- The flag is disabled
- No targeting rules match
- An error occurs during evaluation
Targeting
Targeting determines which users see which variant of a flag.
Evaluation Context
Context is user/request data passed during flag evaluation:
Targeting Rules
Rules evaluate context attributes to determine the flag value:
Operators
Available comparison operators:
| Operator | Description | Example |
|---|---|---|
EQUALS | Exact match | plan EQUALS "premium" |
NOT_EQUALS | Not equal | country NOT_EQUALS "US" |
CONTAINS | String contains | email CONTAINS "test" |
STARTS_WITH | String prefix | email STARTS_WITH "admin" |
ENDS_WITH | String suffix | email ENDS_WITH "@company.com" |
MATCHES | Regex match | email MATCHES ".*@(alpha|beta)\\.com" |
IN | In list | country IN ["SE", "NO", "DK"] |
NOT_IN | Not in list | plan NOT_IN ["free", "trial"] |
Segments
Segments are reusable groups of users defined by targeting rules.
Instead of repeating rules across flags:
Create a segment called beta-users and reference it:
Segments make it easy to:
- Maintain consistent targeting across flags
- Update targeting in one place
- Create meaningful user groups (beta testers, enterprise customers, internal users)
Percentage Rollouts
Percentage rollouts gradually release a feature to a portion of users:
Rollouts are deterministic - the same user always gets the same variant based on their targetingKey hash. This ensures:
- Consistent experience for each user
- Reproducible results for debugging
- Statistically valid A/B tests
API Keys
API keys authenticate SDK requests to the Flag API. Each environment has its own keys.
| Key Type | Purpose | Example |
|---|---|---|
| Server | Backend services | sk_live_... |
| Client | Frontend/mobile apps | pk_live_... |
Server keys should never be exposed to client-side code. Use client keys for browser and mobile applications.
Real-Time Updates (SSE)
Flipswitch uses Server-Sent Events (SSE) to push flag changes to connected clients instantly.
When you toggle a flag in the dashboard:
- The server broadcasts a
flag-changeevent - Connected SDKs receive the event
- SDKs invalidate their cache
- Next evaluation fetches the fresh value
This enables:
- Instant kill switches for broken features
- Real-time A/B test adjustments
- Dynamic configuration without redeployment