Supported on: iOS SDK
1.0.70+ · Android SDK 1.0.42+ · React Native SDK 1.0.7+ (New Architecture only)1. Configure the SDK
Initialize AppDNA as early as possible in your app lifecycle, typically in your app entry point (index.js, App.tsx, or similar) before rendering the root component:
If you don’t have your own Firebase: The AppDNA SDK manages a separate named Firebase instance internally — no
firebase package install required.If you already use Firebase in your app (via @react-native-firebase/app or similar): the SDK automatically initializes its own named Firebase instance from GoogleService-Info-AppDNA.plist (iOS) and google-services-appdna.json (Android). Your existing Firebase setup is not affected.Configuration Options
TheAppDNAOptions interface lets you customize SDK behavior:
Environment
TheAppDNAEnvironment type controls which backend environment the SDK targets:
There is no
'staging'. Which data you touch is decided by the API-key prefix (adn_test_ vs
adn_live_); this value only tags the SDK’s own environment.Log Level
TheAppDNALogLevel type controls console log verbosity:
Use
'debug' during development to see all SDK activity. Switch to 'warning' or 'none' for production builds.Billing Provider
TheAppDNABillingProvider type specifies which billing system to use:
The provider applies on both platforms. On Android
'storeKit2' means Google Play Billing. Choose 'revenueCat' when RevenueCat is your purchase SDK: AppDNA then never finishes or acknowledges a transaction, an AppDNA paywall tap calls onPaywallPurchaseFailed with errorType: 'providerNotAvailable' (start the RevenueCat purchase from there), and purchases reach AppDNA through the RevenueCat webhook. See Billing.2. Wait for Ready State
UseonReady to know when the SDK is ready — the bootstrap has succeeded or failed:
onReady() takes no callback — it returns a Promise that resolves once the SDK is ready (immediately, if it
already is). onReady does not wait for the remote configuration. When it fires, the SDK serves the cached and bundled config, and the remote fetch may still be running (after a failed bootstrap it starts when a retry succeeds). Use remoteConfig.onChanged to pick up the fetched values.
3. Identify Users
Once a user signs in, callidentify to associate events with their user ID:
Traits are merged with any previously set traits. You do not need to pass all traits on every call — only the ones that have changed.
4. Track Events
Track user actions withtrack:
track() is fire-and-forget: it returns void, not a Promise, so there is nothing to await.
Native enqueues the event and batches the upload; call flush() when you need delivery.
Events are batched and flushed automatically: every flushInterval seconds, when the app goes to the background or returns to the foreground, and when the queue reaches a batch size set by the network (100 events on Wi-Fi or a wired connection, metered or not; 20 on a cellular connection the system marks as expensive (iOS) or metered (Android), which is every cellular connection on iOS and most cellular plans on Android; 50 on any other cellular connection). The batchSize option caps it: with a cap, the queue is flushed at the smaller of the two, and no upload sends more.
5. Flush Events Manually
Force an immediate flush of all queued events:6. Set User Consent
Control whether the SDK collects and sends analytics data:setConsent takes a boolean — there is one analytics consent decision, not one per category.
When consent is false, events are silently dropped and not queued. No data is sent to AppDNA
servers until consent is granted. The decision is persisted — setConsent(false) survives a
cold start.
7. Change Log Level at Runtime
Adjust the log level without reconfiguring the SDK:'none', 'error', 'warning', 'info', 'debug'.
8. Remote Config and Feature Flags
Retrieve server-side configuration values:9. Experiments
Get the variant assigned to a user for an experiment:Record<string, unknown> carrying experimentId and variant.
10. Session Data
Store cross-module session data that can be used in template interpolation across onboarding flows, paywalls, and in-app messages:{{session.selected_plan}}. See the Rich Media guide for the full template namespace ({{user.*}}, {{session.*}}, {{device.*}}, {{remote_config.*}}).
11. Entitlements
Check whether the user has any active subscription (StoreKit, Play Billing, RevenueCat, or web entitlement):12. Web Entitlement
Retrieve the current web entitlement (subscriptions granted outside the app store, e.g. via Stripe):13. Deferred Deep Links
Check for a deferred deep link that brought the user to your app on first launch:14. Get SDK Version
Print the underlying native SDK version (useful for support tickets):15. Reset on Logout
When a user signs out, callreset to clear the user identity and flush any remaining events:
16. Shutdown
When the app is terminating, shut down the SDK to ensure all events are flushed and resources are released:configure() starts
clean.
You now have the SDK configured with user identification, event tracking, remote config, experiments, entitlements, and deep links working. Continue to the module-specific guides for Push Notifications, Billing, Onboarding, and Paywalls.

