gomarketme-react-native-expo
v4.0.1
Published
Affiliate Marketing for Expo-Based iOS and Android Apps.
Maintainers
Readme
Installation
Using npm
npm install [email protected]Using yarn
yarn add [email protected]Using pnpm
pnpm add [email protected]GoMarketMe is built on top of expo-iap, so you may also need to install:
npm install expo-iap
(or yarn add expo-iap)
(or pnpm add expo-iap)Usage
⚙️ Basic Integration
To initialize GoMarketMe, import the gomarketme package and initialize the SDK with your API key:
import GoMarketMe from 'gomarketme-react-native-expo';
useEffect(() => {
GoMarketMe.initialize('API_KEY'); // Initialize with your API key
}, []);No further steps needed. The SDK automatically attributes and reports your affiliate sales in real time.
⚙️ OR - Advanced Integration
Use this approach for more advanced scenarios, such as:
- Affiliate-aware paywalls: Offer exclusive pricing or promotions to users acquired through affiliate campaigns.
- Personalized onboarding: For example, a social or fitness app can automatically make new users follow the influencer who referred them, strengthening engagement and maximizing the affiliate’s impact.
import GoMarketMe from 'gomarketme-react-native-expo';
const goMarketMeSDK = GoMarketMe;
const [affiliateData, setAffiliateData] = useState<GoMarketMeAffiliateMarketingData | null>(null);
useEffect(() => {
const initGoMarketMe = async () => {
await goMarketMeSDK.initialize('API_KEY'); // Initialize with your API key
const data = goMarketMeSDK.affiliateMarketingData;
if (data) { // user acquired through affiliate campaign
console.log('Affiliate ID:', data.affiliate?.id); // maps to GoMarketMe > Affiliates > Export > id column
console.log('Affiliate %:', data.saleDistribution?.affiliatePercentage); // maps to GoMarketMe > Campaigns > [Name] > Affiliate's Revenue Split (%)
console.log('Campaign ID:', data.campaign?.id); // maps to GoMarketMe > Campaigns > [Name] > id in the URL
setAffiliateData(data);
}
};
initGoMarketMe();
}, []);Make sure to replace API_KEY with your actual GoMarketMe API key. You can find it on the product onboarding page and under Profile > API Key.
For React Native (non-Expo), go to https://www.npmjs.com/package/gomarketme-react-native.
Support
Check out our sample Expo app at https://github.com/GoMarketMe/gomarketme-react-native-expo-sample-app.
If you run into any issues, please reach out to us at [email protected] or visit https://gomarketme.co.
