Skip to main content
@capgo/capacitor-device-info Device APIs Open source

Device Info Capacitor plugin

Read CPU, memory, GPU, storage, thermal state, and onboard sensor metrics from Capacitor apps

Install

bun add @capgo/capacitor-device-info bunx cap sync
npm, pnpm or yarn
  • npm install @capgo/capacitor-device-info
  • pnpm add @capgo/capacitor-device-info
  • yarn add @capgo/capacitor-device-info

Guide

How to use Device Info in Capacitor

Using @capgo/capacitor-device-info

Read CPU, memory, GPU, storage, thermal, low-power, and onboard sensor metrics from a Capacitor app.

Compatibility

This plugin requires Capacitor 8 or later (@capacitor/core >=8.0.0).

Install

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

What this plugin exposes

  • getInfo - Read one snapshot with CPU, memory, GPU, storage, thermal state, low-power mode, and onboard sensors.
  • startMonitoring - Start periodic snapshots for charts and diagnostics dashboards.
  • stopMonitoring - Stop the active stream.
  • isMonitoring - Check stream status and emitted sample count.
  • removeAllListeners - Remove every listener registered on the plugin.
  • deviceInfoUpdate - Listener event emitted for each periodic sample.

Example usage

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

const snapshot = await DeviceInfo.getInfo();

console.log(snapshot.cpu.cores);
console.log(snapshot.memory.usedPercent);
console.log(snapshot.gpu?.renderer);
console.log(snapshot.sensors?.pressureHpa);

Stream metrics into a chart

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

const samples: number[] = [];

const handle = await DeviceInfo.addListener('deviceInfoUpdate', (sample) => {
  if (typeof sample.cpu.usagePercent === 'number') {
    samples.push(sample.cpu.usagePercent);
  }
});

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

// Later:
await DeviceInfo.stopMonitoring();
await handle.remove();

Monitoring defaults to a 1000 ms interval, clamps intervals below 250 ms, and emits an immediate sample unless you set emitImmediately: false. Calling startMonitoring() again restarts the active session with the new options. Each event includes its sequence, startedAt, and elapsedMs.

Use durationMs or sampleCount to stop automatically. If you no longer need any listener, call await DeviceInfo.removeAllListeners().

Onboard sensor notes

Sensor readings are optional because devices expose different hardware. Android can report battery temperature, ambient temperature, humidity, barometric pressure, light, proximity, and best-effort CPU/GPU thermal-zone values when available. iOS reports CoreMotion sensor availability, thermal state, and low-power state, but public iOS APIs do not expose raw CPU or GPU temperature.

The plugin does not fetch weather data. Outside temperature and humidity require a separate location and weather API integration.

Full reference

Keep going

If you are using @capgo/capacitor-device-info to build diagnostics or monitoring screens, connect it with @capgo/capacitor-device-info for the overview, Getting Started for install and API examples, Using @capgo/capacitor-barometer for dedicated pressure streaming, and Using @capgo/capacitor-light-sensor for dedicated light readings.

FAQ

Device Info plugin FAQ

How do I install the Device Info plugin in a Capacitor app?

Run "bun add @capgo/capacitor-device-info" (or "npm install @capgo/capacitor-device-info"), then run "bunx cap sync" so the iOS and Android projects pick up the native code. Import it from "@capgo/capacitor-device-info" in your app code.

Does @capgo/capacitor-device-info work with React, Vue and Angular?

Yes. Device Info is a Capacitor package, so it works with any web framework that runs inside Capacitor, including Ionic, React, Vue, Angular, Svelte and plain JavaScript.

Which Capacitor version does @capgo/capacitor-device-info support?

Capgo plugins follow Capacitor's major version: use the plugin major version that matches your Capacitor major version (for example plugin v8 with Capacitor 8). The compatibility table in the GitHub README lists the maintained versions.

Is @capgo/capacitor-device-info free and open source?

Yes. The source code is public on GitHub at https://github.com/Cap-go/capacitor-device-info/ and the package is free to install from npm. Bug reports and pull requests are welcome.

Can I update code that uses Device Info without an App Store review?

Installing or upgrading the plugin changes native code, so it needs a new store build. After that, JavaScript, HTML and CSS changes that call the plugin can ship instantly with Capgo live updates.

Ship Device Info changes without waiting for app review

Once the plugin is in your store build, Capgo live updates push your JavaScript, HTML and CSS changes to users in minutes.

Start with Capgo