@affiliateo/react-native
v2.0.0
Published
Affiliateo SDK for React Native — mobile affiliate attribution and session tracking
Maintainers
Readme
@affiliateo/react-native
Affiliateo SDK for React Native — mobile affiliate attribution and screen tracking.
Install
npm install @affiliateo/react-nativeSetup
Wrap your app with AffiliateoProvider:
import { AffiliateoProvider } from '@affiliateo/react-native';
export default function App() {
return (
<AffiliateoProvider campaignId="YOUR_CAMPAIGN_ID">
<YourApp />
</AffiliateoProvider>
);
}Track Screens (optional)
import { useAffiliateoScreen } from '@affiliateo/react-native';
function PricingScreen() {
useAffiliateoScreen('Pricing');
return <View>...</View>;
}Get Affiliate Ref
import { useAffiliateRef } from '@affiliateo/react-native';
function MyComponent() {
const { refCode, isMatched, isLoading } = useAffiliateRef();
// ...
}How It Works
- On first app open, the SDK sends a device fingerprint to Affiliateo
- Affiliateo matches it against recent affiliate link clicks using IP + device signals
- If matched, the SDK auto-sets the
affiliateo_refattribute on RevenueCat (if installed) - Screen views are batched and sent every 30s for funnel analytics
- Events are persisted offline and flushed when connectivity returns
