Supported on: iOS SDK
1.0.61+ · Android SDK 1.0.33+ · React Native SDK 1.0.4+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:
| Parameter | Type | Default | Description |
|---|---|---|---|
flushInterval | number? | 30 | Seconds between automatic event flushes |
batchSize | number? | 20 | Number of events to batch before flushing |
configTTL | number? | 3600 | Seconds before cached config is considered stale |
logLevel | AppDNALogLevel? | 'warning' | Verbosity of SDK console logs |
billingProvider | AppDNABillingProvider? | 'storeKit2' | Billing integration to use |
Environment
TheAppDNAEnvironment type controls which backend environment the SDK targets:
| Value | Description |
|---|---|
'production' | Production API and configuration |
'staging' | Staging API for testing |
Log Level
TheAppDNALogLevel type controls console log verbosity:
| Value | Description |
|---|---|
'none' | No logging |
'error' | Errors only |
'warning' | Errors and warnings |
'info' | Errors, warnings, and info |
'debug' | All messages including debug |
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:
| Value | Description |
|---|---|
'storeKit2' | Native StoreKit 2 on iOS, Play Billing on Android (default) |
'revenueCat' | RevenueCat integration |
'adapty' | Adapty integration (pass API key via adaptyApiKey option) |
'none' | Disable the billing module |
On Android the SDK uses Google Play Billing under the StoreKit2 alias. RevenueCat is supported across both platforms when the native bridges are configured.
2. Wait for Ready State
The SDK fetches remote configuration asynchronously. UseonReady to know when the SDK is fully initialized:
onReady() accepts a callback that runs once the remote configuration has been fetched and applied.
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:
flushInterval and batchSize settings.
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: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: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.*}}, {{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: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.

