PushizoDocs
A/B testing

Feature flags

Turn a feature in your app on and off without shipping a new release, and roll it out gradually to a percentage of users. Text, number or JSON values also serve as remote configuration. Decision record:…

Turn a feature in your app on and off without shipping a new release, and roll it out gradually to a percentage of users. Text, number or JSON values also serve as remote configuration. Decision record: docs/adr/0066-ozellik-bayraklari.md.

Values sent to the SDK can be read by anyone who knows the app ID. Do not put passwords, keys or secrets in them.

Creating a flag

Dashboard → Feature Flags → New flag:

FieldDescriptionDefault
KeyUsed in your app code; cannot be changed laterRequired
Value typeOn/off, text, number, JSONOn/off
On and off valuesThe values users receive, at most 10 KBDepends on type
Target audienceOptional segmentAll users
Rollout percentage0–100100
Scheduled stepsTimes at which the percentage changes automatically, at most 10None
Kill switchWhen off, everyone gets the off valueOff

You can define at most 200 flags per app.

How it is evaluated

  1. If the kill switch is off, the off value.
  2. If a segment is selected and the user is not in it, the off value.
  3. If the user is outside the rollout percentage, the off value.
  4. Otherwise, the on value.

The same user always gets the same result. When the percentage increases, users who were already in stay in. The percentage is computed separately for each flag, so flags do not land on the same set of users.

Reading with the SDK

Values are refreshed at the start of a session and stored on the device. Without a network, the last value is returned; if none was ever fetched, the default in your code is returned.

if (Pushizo.FeatureFlags.isEnabled('yeni_sepet')) showNewCart();
const limit = Pushizo.FeatureFlags.getValue('sepet_limiti', 10);
await Pushizo.FeatureFlags.refresh();
if (Pushizo.FeatureFlags.isEnabled("yeni_sepet")) showNewCart()
val limit = Pushizo.FeatureFlags.getValue("sepet_limiti", 10)
Pushizo.FeatureFlags.refresh()
if Pushizo.FeatureFlags.isEnabled("yeni_sepet") { showNewCart() }
let limit = Pushizo.FeatureFlags.value("sepet_limiti", default: 10)
await Pushizo.FeatureFlags.refresh()

Available in the Web, Android and iOS SDKs; starting with 0.2.0, the Flutter, React Native, Capacitor, Cordova, MAUI, Unity and KMP bridges offer the same API (FeatureFlags.refresh, isEnabled, getValue) (the Capacitor and Flutter web targets are wired to the web SDK).

No requests are sent while privacy consent is pending. When there is no subscription, the SDK uses a persistent random ID; in that case, segment-targeted flags return off.

Evaluating from the server

curl -X POST "https://api.pushizo.com/v1/apps/$APP_ID/feature-flags/evaluate" \
  -H "Authorization: Bearer $PUSHIZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"external_id":"musteri-1"}'

The response returns enabled, value and reason (on, disabled, segment, rollout) for each flag.

EndpointScope
GET /v1/apps/{appId}/feature-flags, GET .../{flagId}analytics:read
POST .../feature-flags/evaluateanalytics:read
POST, PATCH, DELETEadmin

Gradual rollout

Scheduled steps are checked every 5 minutes, and the latest step whose time has come is applied. Changing the percentage manually does not delete the remaining steps. There is no automatic rollback; if something goes wrong, turn off the kill switch.

Limits

  • Values are updated at the start of a session, not pushed in real time. Call refresh to get them immediately.
  • There is no flag exposure or conversion report; send events from your app for measurement.
  • If the target segment is deleted, the flag gives everyone the off value. To turn it back on, change the flag's target.

On this page