react-native-config-jsi
Version:
âĄïļ Fast JSI-based library to access .env variables natively with C++ performance.
65 lines (45 loc) âĒ 1.08 kB
Markdown
# ð 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:
```sh
npm install react-native-config-jsi
yarn add react-native-config-jsi
```
## ð§ Quick Setup
1. Create `.env` at project root:
```env
#EXAMPLE
API_KEY=your_api_key
APP_NAME=MyAwesomeApp
...
```
2. **iOS:**
```bash
cd ios && pod install
```
Add to Xcode â Target â Build Phases â **+ New Run Script Phase**:
```bash
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.
```js
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!** ð