
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
react-native-appstack-sdk
Advanced tools
React Native bridge for Appstack iOS SDK - Track events and revenue with SKAdNetwork integration
Track events and revenue with this SDK. You will also be able to activate Apple Search Ads attribution for your iOS applications and retrieve detailed attribution parameters from both iOS and Android.
Here, you will find the npmjs.org react-native-appstack-sdk documentation. Please use the latest available version of the SDK.
**iOS - Configuring the SKAdNetwork attribution endpoint (optional)**
Add to `ios/YourApp/Info.plist`:
```kotlin
<key>NSAdvertisingAttributionReportEndpoint</key>
<string>https://ios-appstack.com/</string>
```
**Android Configuration**
No additional configuration is needed for Android; the SDK will work automatically after installation.
```javascript
import { useEffect } from 'react';
import { Platform } from 'react-native';
import AppstackSDK from 'react-native-appstack-sdk';
const App = () => {
useEffect(() => {
const init = async () => {
const apiKey = Platform.OS === 'ios'
? process.env.APPSTACK_IOS_API_KEY
: process.env.APPSTACK_ANDROID_API_KEY;
await AppstackSDK.configure(apiKey);
// Request tracking permission and enable Appple Ads Attribution
if (Platform.OS === 'ios') {
await AppstackSDK.enableAppleAdsAttribution();
}
};
init();
}, []);
const trackPurchase = () => {
AppstackSDK.sendEvent('PURCHASE', null, { revenue: 29.99, currency: 'USD' });
};
// ... your app
};
```
Initializes the SDK with your API key. Must be called before any other SDK methods.
Parameters:
- `apiKey` - Your platform-specific API key from the Appstack dashboard
Returns: A promise that resolves to `true` if configuration was successful
Example:
```javascript
const success = await AppstackSDK.configure('your-api-key-here');
if (!success) {
console.error('SDK configuration failed');
}
```
Track user actions and revenue in your activities:
```javascript
// Track events without parameters
await AppstackSDK.sendEvent('LOGIN');
await AppstackSDK.sendEvent('SIGN_UP');
// Track events with parameters (including revenue)
await AppstackSDK.sendEvent(
'PURCHASE', null, { revenue: 29.99, currency: 'USD' }
);
await AppstackSDK.sendEvent(
'SUBSCRIBE', null, { revenue: 9.99, plan: 'monthly' }
);
// Custom events
await AppstackSDK.sendEvent(
'CUSTOM',
'user_attributes',
{
email: "test@example.com",
name: "John Doe",
phone_number: "+33060000000",
date_of_birth: "2026-02-01"
}
);
```
**Available EventType values**
It is recommended to use standard events for a smoother experience.
- `INSTALL` - App installation (tracked automatically)
- `LOGIN`, `SIGN_UP`, `REGISTER` - Authentication
- `PURCHASE`, `ADD_TO_CART`, `ADD_TO_WISHLIST`, `INITIATE_CHECKOUT`, `START_TRIAL`, `SUBSCRIBE` - Monetization
- `LEVEL_START`, `LEVEL_COMPLETE` - Game progression
- `TUTORIAL_COMPLETE`, `SEARCH`, `VIEW_ITEM`, `VIEW_CONTENT`, `SHARE` - Engagement
- `CUSTOM` - For application-specific eventsTracks custom events with optional parameters
Tracks custom events with optional parameters:
- `eventType` - Event type from EventType enum or string (e.g., 'PURCHASE', 'LOGIN')
- `eventName` - Event name for custom events (optional)
- `parameters` - Optional parameters object (e.g., `{ revenue: 29.99, currency: 'USD' }`)
Returns: A promise that resolves to `true` if event was sent successfully
**Enhanced app campaigns**
<Tip>
When running enhanced app campaigns (EACs), it is highly recommended to send multiple parameters with the in-app event to improve matching quality.
</Tip>
For any event that represents revenue, we recommend sending:
1. `revenue` or `price` (number)
2. `currency`(string, e.g. `EUR`, `USD`)
```kotlin
AppStackAttributionSdk.sendEvent(
EventType.PURCHASE,
parameters = mapOf("revenue" to 4.99, "currency" to "EUR")
)
```
To improve matching quality on Meta, send events including the following parameters if you can fulfill them:
1. `email`
2. `name` (first + last name in the same field).
3. `phone_number`
4. `date_of_birth` (recommended format: `YYYY-MM-DD`).
Set up different API keys for different environments:
// .env.development
APPSTACK_IOS_API_KEY=your_ios_dev_key
APPSTACK_ANDROID_API_KEY=your_android_dev_key
// .env.production
APPSTACK_IOS_API_KEY=your_ios_prod_key
APPSTACK_ANDROID_API_KEY=your_android_prod_key
import Config from 'react-native-config';
const apiKey = Platform.OS === 'ios'
? Config.APPSTACK_IOS_API_KEY
: Config.APPSTACK_ANDROID_API_KEY;
await AppstackSDK.configure(apiKey);
Apple Ads attribution:
import { Platform } from 'react-native';
if (Platform.OS === 'ios' && Platform.Version >= '14.3') {
await AppstackSDK.enableAppleAdsAttribution();
}
Play Store attribution:
const initializeSDK = async () => {
const apiKey = Platform.select({
ios: process.env.APPSTACK_IOS_API_KEY,
android: process.env.APPSTACK_ANDROID_API_KEY,
default: process.env.APPSTACK_DEFAULT_API_KEY
});
if (!apiKey) {
console.error('Appstack API key not configured');
return;
}
const configured = await AppstackSDK.configure(apiKey);
if (configured && Platform.OS === 'ios') {
await AppstackSDK.enableAppleAdsAttribution();
}
};
// ✅ Good - Use environment variables
const apiKey = Config.APPSTACK_API_KEY;
// ❌ Avoid - Hardcoded keys
const apiKey = "ak_live_1234567890abcdef"; // DON'T DO THIS
revenue (or price) and a currency parameterenableAppleAdsAttribution() only works on iOS and will do nothing on AndroidConfiguration fails:
// Check if API key is valid
const success = await AppstackSDK.configure(apiKey);
if (!success) {
console.error('Invalid API key or network issue');
}
Events not appearing in dashboard:
iOS Attribution not working:
NSAdvertisingAttributionReportEndpoint it is configured in Info.plistFor questions or issues:
FAQs
React Native bridge for Appstack iOS SDK - Track events and revenue with SKAdNetwork integration
We found that react-native-appstack-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.