Skip to main content

Requirements

Before integrating the AppDNA React Native SDK, ensure your project meets the following minimum requirements:
RequirementMinimum Version
React Native0.72.0+
React18.0+
TypeScript5.0+
Projects targeting React Native versions below 0.72.0 are not supported. The SDK relies on the New Architecture bridge and TurboModule capabilities introduced in 0.72.

Installation

npm

npm install @appdna/react-native-sdk

yarn

yarn add @appdna/react-native-sdk

Package Info

FieldValue
Package@appdna/react-native-sdk
Version1.0.0

Architecture

The @appdna/react-native-sdk package is a TypeScript thin wrapper around the native iOS and Android AppDNA SDKs. All core logic — event batching, config caching, billing, push handling — is delegated to the native modules via React Native’s NativeModules bridge. The package has no runtime JavaScript dependencies. The Dart-level API marshals method calls down to the native side and surfaces results back as Promises and event listeners.
You do not need to interact with NativeModules directly. The AppDNA class and its module accessors provide a high-level TypeScript API that wraps all native communication.

iOS Setup

After installing the npm package, install the native CocoaPods dependency:
cd ios && pod install
If pod install fails, make sure your CocoaPods repo is up to date by running pod repo update first.

Android Setup

No additional setup is needed for Android. The native module is auto-linked by React Native when you install the package.

Import

Import the SDK in any TypeScript or JavaScript file where you need to use it:
import { AppDNA } from '@appdna/react-native-sdk';

Verify Installation

After adding the dependency, verify the SDK is correctly installed by printing the version:
import { AppDNA } from '@appdna/react-native-sdk';

const version = await AppDNA.getSdkVersion();
console.log(version); // "1.0.0"
You should see 1.0.0 printed in the Metro console. If the import fails, make sure you ran pod install for iOS and rebuilt the app. For Android, a clean rebuild (cd android && ./gradlew clean) may be needed.

Next Steps

Once the SDK is installed, proceed to the Quickstart guide to configure the SDK and start tracking events.