For AI agents: the complete documentation index is available at /react-native-nitro-device-info/llms.txt, the full documentation bundle is available at /react-native-nitro-device-info/llms-full.txt, and this page is available as Markdown at /react-native-nitro-device-info/api/index.md.

API Reference Overview

Choose the API entry point before copying an example. The root API and /compat API have different names and return types.

Entry points

ImportPurposeExample
{ DeviceInfoModule } from react-native-nitro-device-infoNative properties and methodsDeviceInfoModule.model
DeviceInfo from react-native-nitro-device-info/compatreact-native-device-info 15.x-style functionsDeviceInfo.getModel()
{ useBatteryLevel } from react-native-nitro-device-infoReact hook returning a valuenumber | null
{ useIsHeadphonesConnected } from react-native-nitro-device-info/compatCompatibility hook result{ loading, result }
{ DeviceIntegrityModule } from react-native-nitro-device-integrityDevice attestation with backend verificationSee Device Attestation

DeviceInfo from the root is a TypeScript type. It is not a default runtime object. See Migration for compatibility caveats.

Availability badges

Each API section shows its introduction version and current platform behavior. Grouped properties have badges in their table rows.

Since v1.3.0 iOS 15.1+ Android API 24+ Web: fallback

  • Since identifies the first published release with this member name and property or method form. Earlier releases may have different return types or behavior. It does not mean that every platform implemented the feature in that release.
  • iOS / Android identifies a functional native implementation. The number is an OS minimum, not a package version. A separate since v… inside the platform badge identifies a later functional implementation. The current core package requires iOS 15.1+ and Android API 24+; dependencies can raise these minimums.
  • Limited identifies an estimate, restricted implementation, or browser API dependency. Read the section's limitations before using the result.
  • Fallback identifies an unsupported operation that returns a fixed default. Rejects identifies a method that fails on that platform.
  • Unreleased identifies an implementation on main that has not reached a published npm release. It is not a version number.

Web entry points and their fallback values are available from v1.8.0. A Web: limited badge identifies browser-derived values. Browser permissions, API availability, and SSR can still produce fallbacks. A fallback does not provide the native feature.

The iOS camera and device-authentication implementations are available from v1.9.0. Core releases through v1.8.3 expose those names but return constants on iOS.

Version evidence

Introduction versions were checked against published npm versions and their gitHead values. These source snapshots show the relevant member declarations:

Native API by task

These members belong to DeviceInfoModule. Parentheses identify methods; entries without parentheses are properties.

TaskExample membersReference
Identify the model and OSdeviceId, model, systemVersion, deviceTypeCore Device Information
Read identifiersuniqueId, manufacturer, deviceNameCore Device Information
Check hardwareisTablet, isEmulator, isCameraPresent, isPinOrFingerprintSetDevice Capabilities
Read display informationgetHasNotch(), getHasDynamicIsland(), getIsLandscape(), getBrightness()Display & Screen
Read memory and storagetotalMemory, getUsedMemory(), totalDiskCapacity, getFreeDiskStorage()System Resources
Read battery stategetBatteryLevel(), getPowerState(), getIsBatteryCharging()Battery & Power
Read app metadataversion, buildNumber, bundleId, getFirstInstallTime()Application Metadata
Read network informationgetIpAddress(), getIpAddressSync(), getMacAddress()Network
Read carrier informationgetCarrier(), getCarrierSync(), mobileCountryCodeCarrier Information
Check audio outputsisHeadphonesConnected(), getIsWiredHeadphonesConnected()Audio Accessories
Check location servicesisLocationEnabled(), getIsLocationEnabled(), getAvailableLocationProviders()Location Services
Check Android featuresapiLevel, getHasGms(), getHasHms(), hasSystemFeature(feature)Android Platform
Request Apple DeviceCheck or write an ID to KeychaingetDeviceToken(), syncUniqueId()iOS Platform
Read installation informationinstallerPackageName, getInstallReferrer(), isSideLoadingEnabled()Installation & Distribution

For the remaining members, see the complete DeviceInfo reference.

Call and return contracts

import { DeviceInfoModule } from 'react-native-nitro-device-info';

const model: string = DeviceInfoModule.model;
const battery: number = DeviceInfoModule.getBatteryLevel();

async function readIpAddress(): Promise<string> {
  return await DeviceInfoModule.getIpAddress();
}
  • Property: Read without parentheses. A property can query the OS; readonly does not mean that the value is constant.
  • Synchronous method: Call directly. Synchronous execution does not guarantee a fixed latency.
  • Promise-based method: Await inside an async function and handle rejection where the API can fail.
  • React hook: Call inside a React component or custom hook. See Hooks API for loading values and polling intervals.

Memory and storage use bytes. Battery and brightness use fractions from 0 to 1 when available. For example, getBatteryLevel() returns -1 when unavailable, while useBatteryLevel() returns null.

Platform and security limits

An unsupported API may return a placeholder or reject. A false result can mean that a platform has no implementation. Check the individual API and the Web Support guide.

Local device integrity checks in this package are bypassable heuristics. Device attestation requires the separate react-native-nitro-device-integrity package and backend verification.

Types and source

Import DeviceInfo, PowerState, BatteryState, DeviceType, and NavigationMode with import type. See Type Definitions.

The current website follows the repository's main branch. For an older installed release, check that release's declarations. The signature source is DeviceInfo.nitro.ts; native implementations define platform behavior.