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
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
mainthat 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.
For the remaining members, see the complete DeviceInfo reference.
Call and return contracts
- Property: Read without parentheses. A property can query the OS;
readonlydoes 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.
