ScaleBun
Skip to article

Flags

react-nativeDeveloperv0.1.0-alpha.4

The ScaleBun.flags namespace — 1 members.

Updated Reviewed
TypeScript
import ScaleBun from '@scalebun/react-native';
ScaleBun.flags.<method>(…);

Members#

MemberSignature
isEnabledisEnabled(key: string)

Reference#

isEnabled#

TypeScript
ScaleBun.flags.isEnabled(key: string)

Notes#

flags.isEnabled(key) is the whole namespace, and that narrowness is the point: a feature flag is a boolean question with a boolean answer.

It resolves locally, from delivered configuration#

isEnabled does not make a network call. Flag values arrive with the SDK's configuration payload and are evaluated on the device, which is what makes the call cheap enough to put in a render path.

The consequence is a propagation delay: flipping a flag in the dashboard reaches a device when that device next receives configuration, not instantly.

Ordering#

  1. Before init(), the flag is not enabled

    There is no configuration yet, so isEnabled cannot return true. Treat pre-init as "off" and do not gate startup-critical behaviour on a flag.

  2. Read at the point of use, not at launch

    Reading on every check is the intended usage and is what lets a mid-session flip take effect.

  3. Default to the safe branch

    Write your code so that "not enabled" is the behaviour you would ship if the flag service vanished.

Limits and edge cases#

  • An unknown key is not enabled. A typo silently disables the feature rather than erroring, so check the key against the dashboard rather than trusting the call.

  • Boolean only. For a value rather than a switch use config; for percentage rollouts use rollouts; for variant assignment use experiments.

  • Client-side evaluation means the flag and its value are visible to anyone inspecting the app. Never use a flag to hide something that must stay secret.

  • Remove flags after rollout. Each permanent flag is a branch nobody tests.

Flags · API reference · React Native SDK · ScaleBun