Installation
Install the Easy React Native SDK in your project.
Package Installation
npm install @easylabs/react-native
# or
yarn add @easylabs/react-native
# or
pnpm add @easylabs/react-native
Requirements
- React Native: 0.79 or higher
- React: 18.0 or higher
- Expo: SDK 49+ (if using Expo)
- Node.js: 20.0 or higher
- TypeScript: 5.0+ (recommended but optional)
Getting Your API Key
- Sign up at itseasy.co
- Navigate to your dashboard
- Generate a publishable API key for client-side use
Security
Never use your secret API key in client-side code! Always use the publishable key for the React Native SDK.
Environment Setup
Expo
For Expo projects, create or update app.config.js:
export default {
expo: {
extra: {
easyApiKey: process.env.EASY_API_KEY,
},
},
};
Create a .env file:
EASY_API_KEY=your_publishable_key_here
Access it in your app:
import Constants from "expo-constants";
const apiKey = Constants.expoConfig?.extra?.easyApiKey;
Bare React Native
For bare React Native projects, use react-native-config:
Install the package:
npm install react-native-config
Create a .env file:
EASY_API_KEY=your_publishable_key_here
Access it in your app:
import Config from "react-native-config";
const apiKey = Config.EASY_API_KEY;
Platform-Specific Setup
iOS
If you're using CocoaPods, run:
cd ios && pod install && cd ..
Android
No additional setup required for Android.
Verification
Verify the installation by importing the SDK:
import { EasyProvider, useEasy } from "@easylabs/react-native";
// If no errors, installation was successful!
Next Steps
Troubleshooting
Module not found
If you see "Module not found" errors:
-
Clear your cache:
# Expo
expo start -c
# React Native
npx react-native start --reset-cache -
Reinstall dependencies:
rm -rf node_modules
npm install
iOS Build Issues
If you encounter iOS build issues:
cd ios
pod deintegrate
pod install
cd ..
Android Build Issues
If you encounter Android build issues:
cd android
./gradlew clean
cd ..
For more help, visit our GitHub Issues.