| Crates.io | tauri-plugin-device-info |
| lib.rs | tauri-plugin-device-info |
| version | 1.0.0 |
| created_at | 2026-01-25 16:26:17.357759+00 |
| updated_at | 2026-01-25 16:26:17.357759+00 |
| description | A Tauri plugin to access device information. |
| homepage | https://github.com/edisdev/tauri-plugin-device-info |
| repository | https://github.com/edisdev/tauri-plugin-device-info |
| max_upload_size | |
| id | 2069024 |
| size | 271,124 |
A comprehensive Tauri plugin to access device information including Battery, Network, Storage, Display, and System Details.
Example Dashboard Application across platforms
| Platform | Support |
|---|---|
| Windows | ✅ |
| macOS | ✅ |
| Linux | ✅ |
| iOS | ✅ |
| Android | ✅ |
npm run tauri add device-info
# or
yarn tauri add device-info
Cargo.toml:
[dependencies]
tauri-plugin-device-info = "0.1.0"
# or from git
tauri-plugin-device-info = { git = "https://github.com/edisdev/tauri-plugin-device-info" }
package.json:
{
"dependencies": {
"tauri-plugin-device-info-api": "latest"
}
}
Register the plugin in your Tauri app:
src-tauri/src/lib.rs:
fn main() {
tauri::Builder::default()
.plugin(tauri_plugin_device_info::init())
.run(tauri::generate_context!())
.expect("error while running tauri application");
}
import {
getDeviceInfo,
getBatteryInfo,
getNetworkInfo,
getStorageInfo,
getDisplayInfo
} from 'tauri-plugin-device-info-api';
// Get device information
const device = await getDeviceInfo();
console.log(device);
// Get battery status
const battery = await getBatteryInfo();
console.log(battery);
// Get network information
const network = await getNetworkInfo();
console.log(network);
// Get storage information
const storage = await getStorageInfo();
console.log(storage);
// Get display information
const display = await getDisplayInfo();
console.log(display);
Returns device identification and hardware information.
| Field | Type | Description |
|---|---|---|
uuid |
string? |
Unique device identifier |
manufacturer |
string? |
Device manufacturer (e.g., "Apple Inc.") |
model |
string? |
Device model (e.g., "MacBookPro16,1") |
serial |
string? |
Serial number (restricted on some platforms) |
android_id |
string? |
Android-specific ID (Android only) |
device_name |
string? |
User-assigned device name |
Returns battery status and health information.
| Field | Type | Description |
|---|---|---|
level |
number? |
Battery percentage (0-100) |
isCharging |
boolean? |
Whether the device is charging |
health |
string? |
Battery health status |
Returns network connection details.
| Field | Type | Description |
|---|---|---|
ipAddress |
string? |
Local IP address |
networkType |
string? |
Connection type: "wifi", "cellular", "ethernet", "unknown" |
macAddress |
string? |
MAC address (unavailable on iOS/Android due to privacy) |
Returns storage capacity information.
| Field | Type | Description |
|---|---|---|
totalSpace |
number? |
Total storage in bytes |
freeSpace |
number? |
Available storage in bytes |
storageType |
string? |
Storage type: "SSD", "HDD", "internal" |
Returns display/screen information.
| Field | Type | Description |
|---|---|---|
width |
number? |
Screen width in pixels |
height |
number? |
Screen height in pixels |
scaleFactor |
number? |
Display scale factor (e.g., 2.0 for Retina) |
refreshRate |
number? |
Screen refresh rate in Hz |
All types are exported and can be imported:
import type {
DeviceInfoResponse,
BatteryInfo,
NetworkInfo,
StorageInfo,
DisplayInfo
} from 'tauri-plugin-device-info-api';
Add the required permissions in your capabilities configuration:
{
"permissions": [
"device-info:default"
]
}
Or individually:
device-info:allow-get-device-infodevice-info:allow-get-battery-infodevice-info:allow-get-network-infodevice-info:allow-get-storage-infodevice-info:allow-get-display-info/sys/class/dmi/id/MIT