{"library":"react-native-adjust","title":"Adjust React Native SDK","description":"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.","language":"javascript","status":"active","last_verified":"Sun Apr 19","install":{"commands":["npm install react-native-adjust"],"cli":null},"imports":["import Adjust from 'react-native-adjust';","import { AdjustConfig } from 'react-native-adjust';","import { AdjustEvent } from 'react-native-adjust';","import { AdjustAttribution } from 'react-native-adjust';"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import Adjust, { AdjustConfig, AdjustEvent, AdjustLogLevel } from 'react-native-adjust';\n\nconst APP_TOKEN = process.env.ADJUST_APP_TOKEN ?? 'YOUR_ADJUST_APP_TOKEN';\nconst ENVIRONMENT = AdjustConfig.EnvironmentSandbox; // Use EnvironmentProduction for production\n\nconst config = new AdjustConfig(APP_TOKEN, ENVIRONMENT);\n\n// Set up a log listener for debugging\nconfig.setLogLevel(AdjustLogLevel.Verbose);\nconfig.setLogDelegate((logLevel, message) => {\n  console.log(`[Adjust Log] ${AdjustLogLevel[logLevel]}: ${message}`);\n});\n\n// Set an attribution listener\nconfig.setAttributionCallbackListener((attribution) => {\n  console.log('Attribution changed:', attribution);\n});\n\n// Initialize the SDK\nAdjust.create(config);\n\n// Track an event after SDK initialization\nconst trackPurchaseEvent = (amount: number, currency: string) => {\n  const event = new AdjustEvent('YOUR_EVENT_TOKEN'); // Replace with your event token\n  event.setRevenue(amount, currency);\n  event.setTransactionId('ORDER_XYZ_123'); // Optional: Add transaction ID\n  Adjust.trackEvent(event);\n  console.log(`Tracked purchase event: ${amount} ${currency}`);\n};\n\n// Example usage:\ntrackPurchaseEvent(19.99, 'USD');\n\nAdjust.getAdidWithTimeout(5000) // Get ADID with a 5-second timeout\n  .then((adid) => {\n    console.log('Adjust ADID (with timeout):', adid);\n  })\n  .catch((error) => {\n    console.error('Failed to get ADID with timeout:', error);\n  });\n","lang":"typescript","description":"Initializes the Adjust SDK, sets up logging and attribution callbacks, and demonstrates tracking a custom event and retrieving the ADID with a timeout.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}