Environments
Manage flag values per deployment stage. A flag can be enabled in development, staged for testing, and disabled in production — all from the same dashboard.
Environments let you manage flag values per deployment stage. A flag can be enabled in development, staged for testing, and disabled in production — all from the same dashboard.
Default Environments#
Each project starts with three default environments:
Local development and testing. Safe to experiment.
Pre-production testing. Mirrors production config.
Live environment. Changes affect real users.
You can create custom environments from the dashboard (e.g., canary, qa).
How Overrides Work#
Each flag has a base configuration. Environment overrides replace specific properties of the base flag when non-null:
Base Flag (enabled: false, rollout: 100%) └── development override (enabled: true) → enabled in dev └── staging override (enabled: true) → enabled in staging └── production override (null = inherit) → disabled (inherits base)
Override properties include: enabled, rolloutPercentage, targetingRules, variants, and defaultValue. If an override property is null, the base flag value is inherited.
Passing Environment in SDKs#
Pass the environment name when initializing the SDK:
Flutter
await AbrovaFlags.init(const AbrovaFlagsConfig( apiKey: 'ab_live_xxx', environment: 'production', ));
React Native / Next.js (client)
<AbrovaFlagsProvider config={{ apiKey: 'ab_live_xxx', environment: 'production' }}>
{children}
</AbrovaFlagsProvider>Node.js / Next.js (server)
const flags = new AbrovaFlags({
apiKey: process.env.ABROVA_FLAGS_API_KEY!,
serverSecret: process.env.ABROVA_FLAGS_SERVER_SECRET!,
environment: process.env.NODE_ENV === 'production'
? 'production' : 'development',
});Android
val flags = AbrovaFlags(
applicationContext,
AbrovaFlagsConfig(
apiKey = "ab_live_xxx",
environment = if (BuildConfig.DEBUG) "development" else "production",
),
)
flags.start()iOS
#if DEBUG
let env = "development"
#else
let env = "production"
#endif
let flags = AbrovaFlags(config: AbrovaFlagsConfig(
apiKey: "ab_live_xxx",
environment: env
))
flags.start()The environment is fixed for the lifetime of a client. Flag dependencies are checked in the same environment as the flag.
If no environment is specified, the SDK gets the base flag values without any environment overrides (the Default values). If the key does not match an active environment of the project, the request is refused: the SDK logs an error, keeps serving cached values or the defaults in your code, and stops fetching until you call refresh(). Check the spelling of the key first when every flag suddenly returns its default.