React Native SDK (beta)
We've launced a new React Native SDK (beta). It's a lightweight React Native wrapper around @reflag/react-sdk that makes it easy to feature-flag in React Native apps.
This release gives you the core parts of Reflag in your mobile apps, supports flag evaluation with hooks, and includes patterns for refreshing flags on app lifecycle events.
How to get started
Install the package:
$ npm i @reflag/react-native-sdkWrap your app:
import { ReflagProvider } from "@reflag/react-native-sdk";
// ...
<ReflagProvider>{/* app */}</ReflagProvider>
Read a flag:
import { useFlag } from "@reflag/react-native-sdk";
function StartHuddleButton() {
const { isEnabled, track } = useFlag("huddle");
if (!isEnabled) return null;
return <Button onPress={() => track()}>Start Huddle</Button>;
}
See the documentation for detailed instructions on how to get started.
Happy shipping!