React Native
Drop the @capreolus/react-native package into your bare or managed app.
Install
npm
npm install @capreolus/react-nativeFor bare React Native projects, also run cd ios && pod install. Expo users see the Expo guide.
Initialize
App.tsx
import { Capreolus } from "@capreolus/react-native";
import { useEffect } from "react";
export default function App() {
useEffect(() => {
Capreolus.start({
apiKey: "pub_xxx",
apiUrl: "https://api.capreolus.app",
});
}, []);
return <RootNavigator />;
}Public API
| Symbol | Purpose |
|---|---|
Capreolus.start({apiKey, apiUrl}) | Bootstraps the SDK across iOS, Android, and Hermes. |
Capreolus.identify(userId, traits) | Associate the current session with a user. |
Capreolus.track(event, properties) | Emit a custom event. |
Capreolus.flush() | Force-send queued events. |
The package supports both the New Architecture (Fabric/TurboModules) and the legacy bridge. No Codegen config required.