@capgo/capacitor-device-info

June 16, 2026 ยท View on GitHub

Capgo - Instant updates for Capacitor

Get Instant updates for your App with Capgo

Missing a feature? We build Capacitor plugins

Production-ready Capacitor plugin for device diagnostics, support screens, QA tools, and in-app performance dashboards. Read CPU, memory, GPU, storage, thermal, low-power-mode, and onboard sensor data from iOS, Android, and Web with one snapshot call or a live interval stream.

@capgo/capacitor-device-info example app streaming CPU, memory, storage, GPU, and onboard sensor metrics

Features

  • One API for instant snapshots and live monitoring streams.
  • No runtime permissions for the metrics currently exposed.
  • Built for support/debug dashboards: identify low memory, storage pressure, low power mode, thermal state, GPU renderer, and hardware sensor availability.
  • Listener-first streaming for charts: deviceInfoUpdate emits CPU, memory, storage, GPU, thermal, and sensor snapshots on a configurable interval.
  • Auto-stop streams by durationMs or sampleCount.
  • Onboard sensor catalog with common readings when hardware exposes them: battery temperature, ambient temperature, relative humidity, pressure, light, and proximity.
  • Native implementations: Metal, Mach, and CoreMotion availability on iOS; ActivityManager, StatFs, /proc, OpenGL ES, SensorManager, and thermal zones on Android.

What You Can Read

AreaData
CPUCore count, active cores, architecture, model, usage percent, max frequency, Android best-effort CPU temperature
MemoryTotal/free/used bytes, used percent, app heap usage/limit, low-memory flag, pressure state
StorageTotal/free/used bytes and used percent for the app data volume
GPUAPI, vendor, renderer, version, max texture size, Android best-effort GPU temperature
PowerLow power mode / battery saver state
ThermalPlatform thermal state: nominal, fair, serious, critical, or unknown
SensorsFull onboard sensor list plus sampled readings for supported environmental/proximity sensors
Stream metadataSequence number, stream start timestamp, elapsed milliseconds

Sensor Coverage

ReadingiOSAndroidWeb
Sensor availability listCoreMotion sensor availabilitySensorManager full sensor listEmpty fallback
CPU/GPU temperatureNot exposed by public iOS APIsBest-effort thermal-zone readsNot exposed
Battery temperatureNot exposed by public iOS APIsACTION_BATTERY_CHANGEDNot exposed
Ambient temperatureNot exposedSampled when TYPE_AMBIENT_TEMPERATURE existsNot exposed
Relative humidityNot exposedSampled when TYPE_RELATIVE_HUMIDITY existsNot exposed
PressureBarometer availabilitySampled when TYPE_PRESSURE existsNot exposed
LightNot exposedSampled when TYPE_LIGHT existsNot exposed
ProximityNot exposedSampled when TYPE_PROXIMITY existsNot exposed

Sensor data is onboard-only. This plugin does not call weather services or fetch outside temperature/humidity from the network.

Common Use Cases

  • Add a diagnostics panel to support tickets.
  • Stream device metrics into an in-app performance graph.
  • Detect low-memory or low-storage conditions before heavy work.
  • Show hardware/GPU details when debugging device-specific rendering bugs.
  • Log thermal and low-power state around slow sessions.
  • Discover available sensors before enabling sensor-heavy features.

Compatibility

Plugin versionCapacitor compatibilityMaintained
v8.*.*v8.*.*Yes
v7.*.*v7.*.*On demand
v6.*.*v6.*.*On demand

Install

You can use our AI-Assisted Setup to install the plugin. Add the Capgo skills to your AI tool using the following command:

npx skills add https://github.com/cap-go/capacitor-skills --skill capacitor-plugins

Then use the following prompt:

Use the `capacitor-plugins` skill from `cap-go/capacitor-skills` to install the `@capgo/capacitor-device-info` plugin in my project.

If you prefer Manual Setup, install the plugin by running the following commands and follow the platform-specific instructions below:

npm install @capgo/capacitor-device-info
npx cap sync

Usage

import { DeviceInfo } from '@capgo/capacitor-device-info';

const snapshot = await DeviceInfo.getInfo();
console.log(snapshot.cpu.cores, snapshot.memory.usedPercent);

const handle = await DeviceInfo.addListener('deviceInfoUpdate', (sample) => {
  console.log(sample.sequence, sample.cpu.usagePercent, sample.memory.usedPercent);
});

await DeviceInfo.startMonitoring({
  intervalMs: 1000,
  durationMs: 60_000,
  emitImmediately: true,
});

await DeviceInfo.stopMonitoring();
await handle.remove();

CPU usage is calculated from deltas, so the first native sample may omit cpu.usagePercent. Periodic monitoring fills it after the second sample when the platform exposes CPU ticks.

Platform Notes

  • iOS requires no permissions for the metrics exposed here. GPU data comes from Metal, CPU and memory data comes from Mach APIs, and sensor availability comes from CoreMotion checks. iOS public APIs do not expose raw CPU/GPU temperature.
  • Android requires no permissions. GPU data is queried from a short-lived OpenGL ES context and then cached. CPU/GPU temperatures are best-effort thermal-zone reads and may be omitted on restricted devices.
  • Web support is best effort. Browser APIs expose CPU cores, storage quota, JS heap on Chromium, and WebGL GPU strings when allowed.

Example App

The example-app/ folder links to the plugin with file:.. and includes an interval listener chart.

cd example-app
npm install
npm run start

API

Capacitor plugin contract for reading device CPU, memory, GPU, storage, and onboard sensor metrics.

getInfo()

getInfo() => Promise<DeviceInfoSnapshot>

Read one CPU, memory, GPU, storage, thermal, and onboard sensor snapshot.

Returns: Promise<DeviceInfoSnapshot>

Since: 8.0.0


startMonitoring(...)

startMonitoring(options?: MonitoringOptions | undefined) => Promise<StartMonitoringResult>

Start periodic device snapshots.

Listen to deviceInfoUpdate to receive samples. Calling this while monitoring is already active restarts monitoring with the new options.

ParamType
optionsMonitoringOptions

Returns: Promise<StartMonitoringResult>

Since: 8.0.0


stopMonitoring()

stopMonitoring() => Promise<StopMonitoringResult>

Stop periodic device snapshots.

Returns: Promise<StopMonitoringResult>

Since: 8.0.0


isMonitoring()

isMonitoring() => Promise<MonitoringState>

Return current periodic monitoring state.

Returns: Promise<MonitoringState>

Since: 8.0.0


addListener('deviceInfoUpdate', ...)

addListener(eventName: 'deviceInfoUpdate', listenerFunc: (event: DeviceInfoUpdate) => void) => Promise<PluginListenerHandle>

Listen for periodic device snapshots.

ParamTypeDescription
eventName'deviceInfoUpdate'Only the deviceInfoUpdate event is supported.
listenerFunc(event: DeviceInfoUpdate) => voidCallback invoked with each snapshot.

Returns: Promise<PluginListenerHandle>

Since: 8.0.0


removeAllListeners()

removeAllListeners() => Promise<void>

Remove all listeners that have been registered on the plugin.

Since: 8.0.0


getPluginVersion()

getPluginVersion() => Promise<PluginVersionResult>

Get the native Capacitor plugin version.

Returns: Promise<PluginVersionResult>

Since: 8.0.0


Interfaces

DeviceInfoSnapshot

Instant device snapshot returned by {@link DeviceInfoPlugin.getInfo}.

PropTypeDescriptionSince
timestampnumberSnapshot timestamp as Unix epoch milliseconds.8.0.0
platform'ios' | 'android' | 'web'Platform implementation that produced the snapshot.8.0.0
cpuCpuInfoCPU information and usage.8.0.0
memoryMemoryInfoMemory information and usage.8.0.0
storageStorageInfoStorage information and usage.8.0.0
gpuGpuInfoGPU information when the platform exposes it.8.0.0
thermalStateThermalStateThermal state when the platform exposes it.8.0.0
lowPowerModebooleanLow-power mode state when the platform exposes it.8.0.0
sensorsOnboardSensorsInfoOnboard sensor availability and readings.8.0.0

CpuInfo

CPU snapshot for the current device.

All frequency values are reported in hertz. usagePercent is null when a platform needs at least two samples to calculate CPU usage.

PropTypeDescriptionSince
coresnumberTotal logical CPU cores visible to the app.8.0.0
activeCoresnumberLogical CPU cores currently active, when the platform exposes it.8.0.0
architecturestringCPU architecture, for example arm64 or x86_64.8.0.0
modelstringCPU or SoC model identifier when available.8.0.0
usagePercentnumber | nullSystem CPU usage from 0 to 100.8.0.0
maxFrequencyHznumberHighest CPU frequency exposed by the platform.8.0.0
temperatureCelsiusnumberCPU temperature in Celsius when the platform exposes an onboard thermal sensor. Android reads this as a best-effort value from device thermal zones. iOS does not expose raw CPU temperature through public APIs.8.0.0

MemoryInfo

Memory snapshot for the current device and app process.

All size values are reported in bytes.

PropTypeDescriptionSince
totalBytesnumberTotal physical memory on the device.8.0.0
freeBytesnumberMemory available to the system.8.0.0
usedBytesnumberMemory currently used by the system.8.0.0
usedPercentnumberMemory usage from 0 to 100.8.0.0
appUsedBytesnumberMemory used by the current app process.8.0.0
appLimitBytesnumberHeap limit visible to the current app process.8.0.0
lowMemorybooleanWhether the OS currently reports low-memory pressure.8.0.0
pressure'normal' | 'warning' | 'critical' | 'unknown'Platform memory pressure label.8.0.0

StorageInfo

Storage snapshot for the app data volume.

All size values are reported in bytes.

PropTypeDescriptionSince
totalBytesnumberTotal bytes on the app data volume.8.0.0
freeBytesnumberFree bytes on the app data volume.8.0.0
usedBytesnumberUsed bytes on the app data volume.8.0.0
usedPercentnumberStorage usage from 0 to 100.8.0.0

GpuInfo

GPU snapshot for the primary graphics device.

PropTypeDescriptionSince
api'unknown' | 'metal' | 'opengl' | 'webgl'Graphics API used to query the GPU.8.0.0
vendorstringGPU vendor when available.8.0.0
rendererstringGPU renderer or model name when available.8.0.0
versionstringGraphics API version string when available.8.0.0
maxTextureSizenumberMaximum texture size reported by the graphics API.8.0.0
temperatureCelsiusnumberGPU temperature in Celsius when the platform exposes an onboard thermal sensor. Android reads this as a best-effort value from device thermal zones. iOS does not expose raw GPU temperature through public APIs.8.0.0

OnboardSensorsInfo

Onboard sensors snapshot.

This only reports hardware sensors exposed by the device or operating system. It does not fetch weather data or any external temperature/humidity source.

PropTypeDescriptionSince
availableSensorsOnboardSensorDescriptor[]Sensors available to the app.8.0.0
readingsOnboardSensorReading[]Instant sensor readings captured for common environmental sensors.8.0.0
batteryTemperatureCelsiusnumberBattery temperature in Celsius when available.8.0.0
ambientTemperatureCelsiusnumberAmbient air temperature from an onboard sensor in Celsius when available.8.0.0
relativeHumidityPercentnumberRelative humidity from an onboard sensor as a percentage when available.8.0.0
pressureHpanumberAtmospheric pressure from an onboard barometer in hectopascals when available.8.0.0
illuminanceLuxnumberAmbient light from an onboard light sensor in lux when available.8.0.0
proximityDistanceCmnumberProximity distance from an onboard proximity sensor in centimeters when available.8.0.0

OnboardSensorDescriptor

Description of an onboard hardware sensor exposed by the platform.

PropTypeDescriptionSince
typestringStable sensor type label, for example pressure, ambientTemperature, or accelerometer.8.0.0
namestringPlatform sensor name when available.8.0.0
vendorstringSensor vendor when available.8.0.0
platformTypenumberAndroid sensor type id when available.8.0.0
maximumRangenumberMaximum sensor range when available.8.0.0
resolutionnumberSensor resolution when available.8.0.0
powerMilliampnumberSensor power draw in milliamps when available.8.0.0
minDelayMicrosecondsnumberMinimum sensor delay in microseconds when available.8.0.0
wakeUpbooleanWhether this is a wake-up sensor when available.8.0.0

OnboardSensorReading

Instant onboard sensor reading.

PropTypeDescriptionSince
typestringStable sensor type label.8.0.0
unitstringHuman-readable unit, for example celsius, percent, hPa, lux, or cm.8.0.0
valuenumberSensor value.8.0.0
namestringPlatform sensor name when available.8.0.0
timestampnumberReading timestamp as Unix epoch milliseconds.8.0.0

StartMonitoringResult

Result returned when monitoring starts.

PropTypeDescriptionSince
monitoringbooleanWhether monitoring is active.8.0.0
intervalMsnumberEffective interval in milliseconds.8.0.0
startedAtnumberMonitoring start timestamp as Unix epoch milliseconds.8.0.0

MonitoringOptions

Options used to start periodic device snapshots.

PropTypeDescriptionSince
intervalMsnumberTime between samples in milliseconds. Values below 250ms are clamped to 250ms to avoid excessive native work. Defaults to 1000ms.8.0.0
durationMsnumberStop automatically after this duration in milliseconds.8.0.0
sampleCountnumberStop automatically after this number of emitted samples.8.0.0
emitImmediatelybooleanEmit one sample immediately when monitoring starts. Defaults to true.8.0.0

StopMonitoringResult

Result returned by {@link DeviceInfoPlugin.stopMonitoring}.

PropTypeDescriptionSince
monitoringbooleanWhether monitoring remains active after the stop request.8.0.0

MonitoringState

Current monitoring state.

PropTypeDescriptionSince
monitoringbooleanWhether monitoring is active.8.0.0
intervalMsnumberEffective interval in milliseconds when monitoring is active.8.0.0
startedAtnumberMonitoring start timestamp as Unix epoch milliseconds.8.0.0
samplesEmittednumberNumber of samples emitted by the active monitoring session.8.0.0

PluginListenerHandle

PropType
remove() => Promise<void>

DeviceInfoUpdate

Periodic event payload emitted while monitoring is active.

PropTypeDescriptionSince
sequencenumberOne-based sample sequence for the active monitoring session.8.0.0
startedAtnumberMonitoring start timestamp as Unix epoch milliseconds.8.0.0
elapsedMsnumberElapsed milliseconds since monitoring started.8.0.0

PluginVersionResult

Plugin version payload.

PropTypeDescriptionSince
versionstringVersion identifier returned by the platform implementation.8.0.0

Type Aliases

ThermalState

Thermal state reported by the platform.

'nominal' | 'fair' | 'serious' | 'critical' | 'unknown'