This is a minimal example app that demonstrates the experimental FDv2 data system for the React Native SDK.
Note: FDv2 support is
@internaland experimental. It is not ready for production use and may change or be removed without notice.
- SDK initialization with the
dataSystemoption (FDv2 protocol) - Connection mode switching for all FDv2 modes:
- Streaming - real-time flag updates with polling fallback
- Polling - periodic polling only
- Offline - cached flags only, no network
- One-Shot - initialize then stop (no persistent synchronizer)
- Background - low-frequency polling for background state
- Automatic - clear the override and use automatic mode selection
- Context identification
- Boolean flag evaluation
- At the js-core repo root, install dependencies and build:
yarn && yarn build- Create an
.envfile in this directory (example-fdv2/) with your mobile key:
MOBILE_KEY=mob-your-mobile-key-here-
Update the flag key in
src/welcome.tsxif needed (defaults tosample-feature). -
Run the app:
# iOS
yarn ios
# Android
yarn androidNote: You may need to run
npx expo prebuildbefore the first iOS or Android build.
- Network-based automatic mode switching is not yet implemented. The wiring
is in place, but
RNStateDetectordoes not yet emit network state changes. Lifecycle-based switching (foreground/background) works. - The
dataSystemoption andsetConnectionMode()are marked@internaland require@ts-ignoreto use from TypeScript.