@rovestudio/react-native
v0.1.2
Published
Rove analytics for Expo and React Native. https://rovestats.com · Docs: https://rovestats.com/docs
Maintainers
Readme
@rovestudio/react-native
Rove analytics for Expo and React Native.
- Website: https://rovestats.com
- Docs: https://rovestats.com/docs
The package only talks to your Rove host (POST /api/v1/events). It never sees your database.
Install
Expo:
npx expo install @rovestudio/react-native @react-native-async-storage/async-storageReact Native:
npm install @rovestudio/react-native @react-native-async-storage/async-storageAsync Storage is optional. Without it, the queue lives in memory and is lost if the process dies.
Use
import { RoveProvider, rove } from "@rovestudio/react-native";
export default function RootLayout({ children }) {
return (
<RoveProvider
writeKey={process.env.EXPO_PUBLIC_ROVE_KEY}
host={process.env.EXPO_PUBLIC_ROVE_HOST}
>
{children}
</RoveProvider>
);
}
rove.track("purchase", { value: 9.99, currency: "USD" });
rove.identify("user_123", { plan: "pro" });
rove.screen("Checkout");RoveProvider records session_start, app_foreground, and app_background on its own.
Put the write key and host in the mobile app env:
EXPO_PUBLIC_ROVE_KEY=rov_live_…
EXPO_PUBLIC_ROVE_HOST=https://rovestats.comOptions
| Prop | Default | Purpose |
| --- | --- | --- |
| writeKey | required | rov_live_… from the Rove dashboard |
| host | required | Origin of your Rove app, no trailing path |
| flushAt | 10 | Send once this many events are queued |
| flushInterval | 2000 | Flush interval in ms |
| sessionTimeoutMs | 30 * 60 * 1000 | New session after this long in background |
| storage | Async Storage, or memory | Override persistence |
| autoTrack.sessions | true | session_start |
| autoTrack.appLifecycle | true | app_foreground / app_background |
