Registry / observability / react-native-adjust

react-native-adjust

JSON →
library5.5.0jsnpmunverified

The `react-native-adjust` package provides the official React Native SDK for Adjust, a mobile app attribution and analytics platform. It enables developers to track installs, events, sessions, and deep links across iOS and Android applications, providing insights into user acquisition campaigns and in-app behavior. The current stable version is `5.5.0`, with frequent updates that typically mirror the underlying native Adjust iOS and Android SDKs. This ensures compatibility with the latest Adjust backend features and OS-level changes. Key differentiators include robust fraud prevention, granular attribution reporting, and seamless integration with the Adjust dashboard for comprehensive analytics, making it a critical tool for mobile marketers and app developers focused on growth and measurement.

npm install react-native-adjust
INSTALL
IMPORT
SIG · REACT-NATIVE-ADJUS
R
react-native-adjust
observabilityjavascriptv5.5.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Adjust
import Adjust from 'react-native-adjust';
import { Adjust } from 'react-native-adjust';
The primary SDK class is a default export.
AdjustConfig
import { AdjustConfig } from 'react-native-adjust';
import AdjustConfig from 'react-native-adjust';
Configuration object is a named export. It's essential for SDK initialization.
AdjustEvent
import { AdjustEvent } from 'react-native-adjust';
const AdjustEvent = require('react-native-adjust').AdjustEvent;
Used for tracking custom in-app events. Ensure you import it as a named export.
AdjustAttribution
import { AdjustAttribution } from 'react-native-adjust';
Type definition for attribution callback data. Primarily used in TypeScript.

Initializes the Adjust SDK, sets up logging and attribution callbacks, and demonstrates tracking a custom event and retrieving the ADID with a timeout.

import Adjust, { AdjustConfig, AdjustEvent, AdjustLogLevel } from 'react-native-adjust'; const APP_TOKEN = process.env.ADJUST_APP_TOKEN ?? 'YOUR_ADJUST_APP_TOKEN'; const ENVIRONMENT = AdjustConfig.EnvironmentSandbox; // Use EnvironmentProduction for production const config = new AdjustConfig(APP_TOKEN, ENVIRONMENT); // Set up a log listener for debugging config.setLogLevel(AdjustLogLevel.Verbose); config.setLogDelegate((logLevel, message) => { console.log(`[Adjust Log] ${AdjustLogLevel[logLevel]}: ${message}`); }); // Set an attribution listener config.setAttributionCallbackListener((attribution) => { console.log('Attribution changed:', attribution); }); // Initialize the SDK Adjust.create(config); // Track an event after SDK initialization const trackPurchaseEvent = (amount: number, currency: string) => { const event = new AdjustEvent('YOUR_EVENT_TOKEN'); // Replace with your event token event.setRevenue(amount, currency); event.setTransactionId('ORDER_XYZ_123'); // Optional: Add transaction ID Adjust.trackEvent(event); console.log(`Tracked purchase event: ${amount} ${currency}`); }; // Example usage: trackPurchaseEvent(19.99, 'USD'); Adjust.getAdidWithTimeout(5000) // Get ADID with a 5-second timeout .then((adid) => { console.log('Adjust ADID (with timeout):', adid); }) .catch((error) => { console.error('Failed to get ADID with timeout:', error); });
Debug
Known issues
gotchaAlways use `AdjustConfig.EnvironmentProduction` for live applications and `AdjustConfig.EnvironmentSandbox` for development/testing. Mixing these can lead to inaccurate data.
fix
Ensure `ENVIRONMENT` variable passed to `AdjustConfig` is correct for your build environment (e.g., via `__DEV__` or build flavors).
affects: >=5.0.0
breakingWhen upgrading Adjust native SDKs, especially across major versions, verify that the `react-native-adjust` package is also compatible. While `react-native-adjust` abstracts native changes, significant native API shifts might require an update to the React Native wrapper.
fix
Always check the official Adjust documentation and `react-native-adjust` release notes before upgrading native SDKs or `react-native-adjust` itself, especially across major versions. The changelog indicates `Adjust Signature library` updates, which, while internal, could imply breaking changes if not handled correctly by the wrapper.
affects: Prior to 5.0.0 (and potentially future major releases)
gotchaThe `index.d.ts` file now explicitly indicates nullable types (e.g., in `AdjustAttribution`). TypeScript users might encounter stricter type checking for optional fields, requiring explicit null checks.
fix
Update TypeScript code to handle potentially `null` or `undefined` values for properties that are now marked as nullable in the type definitions.
affects: >=5.4.1
gotchaNew methods like `getAdidWithTimeout`, `getAttributionWithTimeout`, `resolveLinkWithUrl`, `setStoreInfo` and support for Google LVL/ODM have been added in recent versions. Developers intending to use these features must upgrade their SDK.
fix
Upgrade to `react-native-adjust` v5.4.0 or higher to access `setStoreInfo`, Google ODM, and v5.5.0 or higher for timeout-based methods and `resolveLinkWithUrl`.
affects: >=5.4.0
Errors
Common errors & fixes
Adjust.modulemap not found
Specific CocoaPods integration issues, often related to caching or incorrect project setup.
fix
This issue was fixed in `v5.0.2`. Ensure you are on `v5.0.2` or higher. If it persists, try cleaning CocoaPods cache (`pod cache clean --all`), deleting `Podfile.lock` and `Pods` directory, then reinstalling pods (`pod install`).
TypeError: Cannot read property 'PROPERTY_NAME' of null/undefined in Adjust SDK callbacks or data objects.
Occasional `NPE occurrences` (Null Pointer Exceptions) in native code were reported, especially when the app was entering the background, or `type mismatch` in `AdjustPlayStoreSubscription` fields.
fix
Ensure you are on `v5.1.0` or higher to fix background NPEs and `v5.0.4` or higher for `AdjustPlayStoreSubscription` type mismatches. Always add null/undefined checks for properties retrieved from Adjust callback objects, as some fields might legitimately be absent.
Application Not Responding (ANR) on Android during SDK initialization.
Occasional ANRs while reading install referrer from Shared Preferences during SDK initialization on Android.
fix
This issue was fixed in `v5.0.2`. Upgrade to `react-native-adjust` `v5.0.2` or newer to resolve this problem.
Upgrade
Version history
5.5.0latest on npm
Audit
Dependencies
react-nativerequiredCore dependency for any React Native module.
Agent activity
26 hits · last 30 days
node
22
OpenAI (training)
2
Resources