▸Install the React Native SDK
npm install @respectlytics/react-native
# or
yarn add @respectlytics/react-native
JavaScript-only — no native modules, no auto-linking, no New Architecture migration concerns. Bundle size: ~14KB minified+gzipped. Works in any Expo project (managed or bare) without expo prebuild.
▸Initialize Respectlytics in React Native
// App.tsx (or App.js)
import { useEffect } from 'react';
import Respectlytics from '@respectlytics/react-native';
export default function App() {
useEffect(() => {
Respectlytics.configure({ appKey: '<YOUR_APP_KEY>' });
}, []);
return <YourApp />;
}
Initialize once in your top-level component. No native config; no Info.plist or AndroidManifest changes. The SDK is Hermes- and JSC-compatible.
✦Privacy & implementation notes
GDPR's Article 4(1) classifies IP addresses as personal data, with narrowing case law on transient-purpose processing. The ECJ's Patrick Breyer v. Bundesrepublik Deutschland (2016) and subsequent cases established that even "dynamic" IPs are personal data when the recipient has the means to identify the user. The transient-discard pattern minimises the data-retention surface but doesn't eliminate the legal classification — consult your legal team.
The country code stored in events is sufficient for the most common product breakdown — "how does this metric vary by market?". Going deeper (city, ZIP) almost always falls into either a marketing-ads use case (handled elsewhere) or a vanity dashboard that doesn't drive product decisions.
The React Native SDK is JavaScript-only — no Objective-C/Swift bridging on iOS, no Java/Kotlin bridging on Android. Side effects: no react-native link, no auto-linking, no New Architecture migration concerns, no platform-channel exception surfaces. Trade-off: no access to platform-only metadata (which we don't want to collect anyway).
Works in Expo managed workflow without expo prebuild. No config plugin is required. EAS Build users: nothing to configure. This is the smoothest integration path on RN — most analytics SDKs require ejecting from managed.
⇋How this compares to other analytics SDKs
| Geolocation handling | Firebase Analytics | Mixpanel | Amplitude | Respectlytics |
|---|---|---|---|---|
| Stores IP address | Yes | Yes (90 days default) | Yes | No (discarded after lookup) |
| Stores precise lat/long | Optional | Optional | Optional | No |
| Stores city / region | Yes | Yes | Yes | No |
| Stores country code | Yes | Yes | Yes | Yes |
| Per-user location history | Yes | Yes | Yes | No |
| Reverse-DNS or VPN detection | Yes | Yes | Yes | No |
❓Frequently asked questions
Is the IP-address-then-discarded path still considered processing PII?
Most regulators (including the EU's EDPB) classify IP addresses as personal data even when transiently held for a strictly defined purpose. The transient-then-discarded pattern is generally accepted as the most minimised viable approach for country lookup. Consult your legal team for the exact framing in your jurisdiction; the standard disclaimer applies.
How accurate is the country lookup?
We use MaxMind GeoLite2's country database, refreshed monthly. Accuracy is ~99% for standard residential and mobile IP ranges; lower for VPNs, Tor, and corporate egresses. For country-level rollups in product analytics, the accuracy is sufficient.
Can we get city-level breakdowns for marketing?
Not from Respectlytics, by design. City-level geolocation is one of the more privacy-sensitive analytics fields and is not aligned with the ROA philosophy. If you genuinely need city-level breakdowns for paid ads campaigns, your ads platform provides them on its own (Google Ads, Meta Ads) — that lives in the ads attribution layer, not in product analytics.
What about regions like Hong Kong / Taiwan / Crimea — how are they assigned?
Respectlytics uses ISO 3166-1 alpha-2 country codes from MaxMind. Regions with politically contested status are coded by MaxMind's geographic convention, not by political alignment. If your audience needs a finer regional breakdown for a specific reason, the workaround is to fire distinct event_names per region of interest.