React Native SDK
Use Toggly's React Native SDK in React Native and Expo applications.
Grab the printable React Native cheat sheet (download PDF) — provider setup, hooks, components, storage, offline.
Overview
The React Native SDK is a modular feature flags solution designed for React Native and Expo applications. It provides React hooks, context providers, and declarative components for easy feature flag management.
Packages
| Package | Description |
|---|---|
@ops-ai/react-native-toggly | Main SDK with React hooks and components |
@ops-ai/react-native-toggly-core | Core functionality (automatically installed) |
@ops-ai/react-native-toggly-storage-async | AsyncStorage adapter for persistent caching |
@ops-ai/react-native-toggly-storage-mmkv | MMKV adapter for high-performance storage |
Installation
Main SDK (Required)
npm install @ops-ai/react-native-toggly
# or
yarn add @ops-ai/react-native-toggly
Storage Adapters (Optional)
For persistent feature flag caching, install a storage adapter:
AsyncStorage (Recommended for Expo):
npm install @ops-ai/react-native-toggly-storage-async @react-native-async-storage/async-storage
MMKV (Recommended for bare React Native - faster):
npm install @ops-ai/react-native-toggly-storage-mmkv react-native-mmkv
cd ios && pod install
Network State Detection (Optional)
For automatic offline/online handling:
npm install @react-native-community/netinfo