SdksReact native
React Native SDK
Userbubble SDK for React Native and Expo applications
The React Native SDK is not yet published to npm. It's coming soon. The documentation below is a preview of the upcoming API.
Overview
The Userbubble React Native SDK enables seamless user identification in your mobile applications. It supports both Expo and bare React Native projects with automatic platform detection.
Key Features
- Simple Integration: Just wrap your app with
<UserbubbleProvider>and use theuseUserbubble()hook - Platform Support: Works with both Expo (expo-secure-store) and bare React Native (@react-native-async-storage/async-storage)
- Automatic Storage: Auto-detects and uses the appropriate storage solution
- TypeScript: Full TypeScript support with complete type definitions
- Lightweight: Minimal dependencies and small bundle size
- Secure: API key-based authentication with secure storage
Quick Links
Installation
Get started by installing the SDK
Quick Start
Integrate in 5 minutes
API Reference
Complete API documentation
Examples
Code examples and recipes
Example Usage
import { UserbubbleProvider, useUserbubble } from "@userbubble/react-native";
function App() {
return (
<UserbubbleProvider config={{ apiKey: "ub_live_xxxxx" }}>
<MyApp />
</UserbubbleProvider>
);
}
function MyApp() {
const { identify, openUserbubble, isIdentified } = useUserbubble();
const handleLogin = async () => {
await identify({
id: user.id,
email: user.email,
name: user.name,
});
};
return (
<>
{!isIdentified && <Button title="Login" onPress={handleLogin} />}
{isIdentified && (
<Button title="Feedback" onPress={() => openUserbubble()} />
)}
</>
);
}Next Steps
Start by installing the SDK or jump straight to the quick start guide.