Documentation

SDK integration guides and ad platform recipes, same content as each app's Docs tab.

React Native SDK

Track events, resolve deep links, and identify users in React Native and Expo apps.

Requirements

PlatformMinimum Version
iOS13.0+
Android5.0+ (API 21)
React Native0.72+
Expo SDK49+ (development build)
Node.js16+

Both Old Architecture (Bridge) and New Architecture (TurboModules) are supported.

Installation : Expo

Use a development build for full native signal fidelity. Expo Go can use the JS fallback with reduced native signals.

Terminal
npx expo install @appcat/react-native-sdk
npx expo prebuild
npx expo run:ios
npx expo run:android

To update native modules after upgrading:

Terminal
npx expo prebuild --clean
npx expo run:ios   # or run:android

Installation : Bare React Native

Terminal
npm install @appcat/react-native-sdk
cd ios && pod install

Then rebuild:

Terminal
npx react-native run-ios
npx react-native run-android

Android autolinking handles native setup. iOS CocoaPods dependencies resolve automatically via the bundled podspec.

Initialization

Call once at app startup before any other SDK method.

App.tsx
import AppCat from '@appcat/react-native-sdk';

await AppCat.init({
  appId: 'your-app-id',
  apiKey: 'YOUR_API_KEY',
});
Add this to your app entry point (e.g. App.tsx or a bootstrap function).

API Keys

Every request the SDK makes is authenticated with an API key. You can have as many keys as you need, one per environment (production, staging, CI, local) is the recommended pattern so you can revoke a single environment without rotating everyone.

Generate a key

  1. Open your app in the AppCat dashboard and expand the SDK Guides section in the sidebar.
  2. Click API Key Management.
  3. Click New API key, give it a descriptive name (e.g. Production iOS), and copy the value shown in the reveal modal.

The raw key is shown exactly once. Store it in your secrets manager or CI environment immediately, it cannot be retrieved later. Every app is auto-provisioned with a Default key the first time you land on API Key Management, so you always have a usable key to bootstrap from.

Multiple keys

All keys for an app point at the same project and have the same permissions. The SDK does not care which key you use; the dashboard only tracks last used at to help you identify which key is active in each environment.

Rotating a key

  1. Generate a new key and deploy it to the target environment.
  2. Once traffic is flowing on the new key, revoke the old one from the dashboard.

Revoking a key

Click Revoke next to a key and type DELETE API into the confirmation field. Revocation is immediate, the cache invalidates within a few seconds and subsequent SDK requests using that key receive a 401 INVALID_API_KEY.

Every app must always have at least one active key. The dashboard blocks revocation of the last remaining active key so you cannot accidentally lock your app out.

Security notes

  • Only the last 4 characters of a key are ever shown after creation.
  • Keys are stored hashed, even AppCat staff cannot recover a lost key.
  • Treat API keys like passwords: never commit them to source control, never log them, and rotate if they leak.

Event Tracking

Track standard or custom events. Never throws.

TypeScript
// Standard event
AppCat.sendEvent('ViewContent', { page: 'home' });

// Revenue event
AppCat.sendEvent('Purchase', {
  item: 'premium',
  value: 9.99,
  currency: 'USD',
});

// Custom event
AppCat.sendEvent('LevelComplete', { level: 5, score: 2400 });

User Identification

Call after login or signup to link attribution data to a user.

TypeScript
const profile = await AppCat.identify({
  userId: 'user_123',
  email: 'user@example.com',
  name: 'Jane Smith',
});

Utility Methods

TypeScript
const deviceId = await AppCat.getAppCatId();
const attribution = await AppCat.getAttribution();
const context = await AppCat.getDeviceContext();

if (AppCat.isInitialized()) {
  AppCat.sendEvent('ViewContent');
}

API Reference

AppCat.init(config)

ParameterTypeRequiredDescription
appIdstringNoApplication ID, resolved from API key if omitted
apiKeystringYesAPI key
isDebugbooleanNoEnable debug logging
logLevelLogLevelNoDEBUG, INFO, WARN, ERROR
customerUserIdstringNoUser ID for session

AppCat.sendEvent(name, params?)

ParameterTypeRequiredDescription
eventNamestringYesEvent name
paramsRecord<string, unknown>NoCustom data plus reserved keys: eventId, value, currency, testEventCode

InitResponse (returned from AppCat.init)

FieldTypeDescription
deepLinkParamsRecord<string, string> | nullQuery params from the matched ad click URL, or null if no match.
geo{ city, country, state } | nullGeo resolved from device IP, or null.

AppCat.identify(data)

Accepts userId, email, phone, name, geo, customAttributes. Returns Promise<IdentifyResponse | null>.

Records the user's tracking-consent choice after ATT, GDPR, or an in-app privacy setting. Returns Promise<void>.

Available Event Types

Event NameDescription
MobileAppInstallApp installed
ViewContentUser viewed content
AddToCartItem added to cart
InitiateCheckoutCheckout started
StartTrialFree trial started
SubscribeSubscription started
PurchasePurchase completed
CompleteRegistrationRegistration completed
SearchSearch performed

Custom event names are also supported.