Installation
Install the Userbubble React Native SDK
The React Native SDK is not yet published to npm. It's coming soon. The documentation below is a preview of the upcoming API.
Choose Your Platform
Expo Projects
For Expo projects, install the SDK along with expo-secure-store:
npx expo install @userbubble/react-native expo-secure-storeThe SDK will automatically detect Expo and use expo-secure-store for secure data storage.
Bare React Native Projects
For bare React Native projects, install the SDK with AsyncStorage:
npm install @userbubble/react-native @react-native-async-storage/async-storageOr with yarn:
yarn add @userbubble/react-native @react-native-async-storage/async-storageThe SDK will automatically detect bare React Native and use AsyncStorage.
Get Your API Key
Before using the SDK, you'll need an API key:
- Go to your organization settings in Userbubble
- Navigate to "API Keys"
- Click "Generate New Key"
- Copy the API key (it starts with
ub_live_orub_test_)
Store your API key securely in environment variables. Never commit it to your repository.
Environment Variables
For Expo:
Add to your .env file:
EXPO_PUBLIC_USERBUBBLE_API_KEY=ub_live_xxxxxxxxxxxxxFor bare React Native:
Add to your .env file and use a package like react-native-dotenv:
USERBUBBLE_API_KEY=ub_live_xxxxxxxxxxxxxNext Steps
Now that you've installed the SDK, continue to the Quick Start guide to integrate it into your app.