ابرووا
شروع رایگان
☰ فهرست مستندات · محیط‌ها
به‌زودی. Abrova Flags به‌زودی فعال می‌شود. این صفحه توضیح می‌دهد چطور کار خواهد کرد؛ هنوز قابل استفاده نیست.
این صفحه هنوز ترجمه نشده — نسخه‌ی انگلیسی نمایش داده می‌شود. English

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.

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:

Development

Local development and testing. Safe to experiment.

Staging

Pre-production testing. Mirrors production config.

Production

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:

text
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

dart
await AbrovaFlags.init(const AbrovaFlagsConfig(
  apiKey: 'ab_live_xxx',
  environment: 'production',
));

React Native / Next.js (client)

tsx
<AbrovaFlagsProvider config={{ apiKey: 'ab_live_xxx', environment: 'production' }}>
  {children}
</AbrovaFlagsProvider>

Node.js / Next.js (server)

typescript
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

kotlin
val flags = AbrovaFlags(
    applicationContext,
    AbrovaFlagsConfig(
        apiKey = "ab_live_xxx",
        environment = if (BuildConfig.DEBUG) "development" else "production",
    ),
)
flags.start()

iOS

swift
#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.

Note.

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.

این صفحه مفید بود؟
گزارش مشکل