0.1.10 ⢠Published 4 months ago
react-native-config-jsi v0.1.10
š react-native-config-jsi
Fast JSI-based React Native library to access .env
variables natively with C++ performance.
š¦ Install
To install the library, use either npm or yarn:
npm install react-native-config-jsi
yarn add react-native-config-jsi
š§ Quick Setup
- Create
.env
at project root:
#EXAMPLE
API_KEY=your_api_key
APP_NAME=MyAwesomeApp
...
- iOS:
cd ios && pod install
Add to Xcode ā Target ā Build Phases ā + New Run Script Phase:
bash "${SRCROOT}/../node_modules/react-native-config-jsi/src/scripts/generate.sh"
š Usage
ā ļø Note: After updating
.env
, rebuild or restart your app to apply changes.import { RNConfig } from "react-native-config-jsi";
const apiKey = RNConfig.get("API_KEY"); console.log("API_KEY:", apiKey);
---
## ā” Highlights
- š„ Ultra-fast JSI native access
- āļø Built in C++
- š§© Synchronous API
- šŖ¶ No extra dependencies
---
## š License
MIT
---
š **Enjoy using react-native-config-jsi!** š