Prerequisites
Expo
Expo SDK 58
vexo-analytics 1.14.0 or later on Expo SDK 58. Earlier versions record nothing on SDK 58. See Upgrading to Expo SDK 58 for the support table and the upgrade checklist.vexo() call at module scope of the root layout (app/_layout.tsx, or src/app/_layout.tsx in the SDK 58 template).When prompted, create an app and give it a name (you can change it later). Vexo generates the app's API key. You can copy it again later from the app's settings.
Install the package.
With Expo:
npx expo install vexo-analytics
With bare React Native, install it with npm (or yarn add vexo-analytics), then install the iOS pods:
npm install vexo-analytics
cd ios && pod install
Call vexo() with your API key in your app's entry file: usually index.js or App.js, or the root layout (app/_layout.tsx) with Expo Router.
import { vexo } from 'vexo-analytics';
vexo('YOUR_API_KEY');
vexo() at module scope, outside any component or useEffect, so tracking starts when the app starts.Rebuild the app, because vexo-analytics includes native code. A JavaScript reload or an over-the-air update isn't enough.
npx expo run:ios or npx expo run:android, or make a new development build with eas build --profile development.npx react-native run-ios or npx react-native run-android.Wait, that's it? Yes! From here, Vexo tracks sessions, screens, taps, and errors with no more code. Go check out the features.
Check these, most common first:
__DEV__ guard. If you wrapped vexo() in if (!__DEV__), a development build never calls it. Remove the guard while you test.Vexo: API key rejected (401). Copy the key again from the app's settings.vexo-analytics, rebuild the app (step 5).https://api.vexo.co. Check that it has network access and that a VPN, proxy, or firewall isn't blocking it.vexo-analytics 1.14.0 or later. See Upgrading to Expo SDK 58.Decide whether your development sessions should count in your analytics. To leave them out, or to send them to a staging app, see Development & staging. Before you publish, check App Store & Play Compliance.
Create a web app:
Add the Vexo script. To start collecting web analytics data, paste this script into your site's <head> tag:
<script src="https://www.vexo.co/analytics.js" defer></script>
With Next.js, use the Script component instead, as shown in Next.js integration.
Optional: track custom events and identify devices.
Custom event:
globalThis.vexo?.customEvent('purchase-completed', { amount: 24.99 });
Identify a device:
globalThis.vexo?.identifyDevice('user@example.com');
That's it! Once the script is live on your site, Vexo starts capturing user sessions, session replays, custom events, and more, just like it does on mobile.