1. Configure the SDK
Initialize AppDNA as early as possible in your app lifecycle. Place the call in your root component or app entry point:Firebase is automatically initialized from
GoogleService-Info-AppDNA.plist (iOS) and google-services-appdna.json (Android) by @react-native-firebase/app. You do not need to call any Firebase initialization method manually. See Installation to ensure the config files are in place.If your app already uses Firebase for your own services, AppDNA automatically creates a separate named Firebase instance. 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 | 300 | Seconds before cached config is considered stale |
logLevel | AppDNALogLevel | 'warning' | Verbosity of SDK console logs |
billingProvider | AppDNABillingProvider | undefined | 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 (iOS) / Google Play (Android) |
'revenueCat' | RevenueCat integration |
'none' | Disable billing module |
2. Wait for Ready State
The SDK fetches remote configuration asynchronously. UseonReady to know when the SDK is fully initialized:
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:setLogLevel is the only synchronous method on the AppDNA class. All other methods return Promises and should be awaited.8. Remote Config and Feature Flags
Retrieve server-side configuration values:9. Experiments
Get the variant assigned to a user for an experiment:10. Web Entitlements
Retrieve the current web entitlement for the user:11. Deferred Deep Links
Check for a deferred deep link that led to the app install:12. Reset on Logout
When a user signs out, callreset to clear the user identity and flush any remaining events:
13. Shutdown
When your app is terminating or you need to fully tear down the SDK:You now have the SDK configured, user identification, event tracking, remote config, and experiments working. Continue to the module-specific guides for Push Notifications, Billing, Onboarding, and Paywalls.

