React Native SDK Installation
The @superflag-sh/react-native package provides feature flags and remote config for React Native and Expo applications.
Requirements
- React Native 0.70+
- React 18 or higher
- Expo SDK 49+ (if using Expo)
@react-native-async-storage/async-storage 1.0+
Installation
npx expo install @superflag-sh/react-native @react-native-async-storage/async-storage
npm install @superflag-sh/react-native @react-native-async-storage/async-storage
yarn add @superflag-sh/react-native @react-native-async-storage/async-storage
pnpm add @superflag-sh/react-native @react-native-async-storage/async-storage
Then link AsyncStorage (if not using autolinking):cd ios && pod install && cd ..
AsyncStorage is required. The React Native SDK needs AsyncStorage for persistent caching. Make sure to install @react-native-async-storage/async-storage.
The React Native SDK works on:
- iOS (14.0+)
- Android (API 21+)
- Expo (SDK 49+)
Bundle Size
- ~6 KB minified (gzipped)
- Zero dependencies (except peer deps: React, AsyncStorage)
- Fully tree-shakeable ES modules
TypeScript Support
The SDK is written in TypeScript with full type definitions included.
import { useFlag } from '@superflag-sh/react-native'
// Type-safe hooks
const enabled = useFlag<boolean>('feature-flag', false)
const config = useFlag<{ theme: string }>('ui-config', { theme: 'light' })
Next Steps