React Native SDK (beta)
Get started
Install
npm i @reflag/react-native-sdk1. Add the ReflagProvider
import { ReflagProvider } from "@reflag/react-native-sdk";
<ReflagProvider
publishableKey="{YOUR_PUBLISHABLE_KEY}"
context={{
user: { id: "user_123", name: "John Doe", email: "[email protected]" },
company: { id: "company_123", name: "Acme, Inc", plan: "pro" },
}}
>
{/* children here are shown when loading finishes */}
</ReflagProvider>;2. Use useFlag(<flagKey>)
useFlag(<flagKey>)Reference
Cookbook
Refresh flags when the app returns to the foreground
Last updated
Was this helpful?