
Security News
Insecure Agents Podcast: Certified Patches, Supply Chain Security, and AI Agents
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.
@capacitor-community/device
Advanced tools
This plugin offers the API which has been removed from @capacitor/device plugin in v7.0 (getInfo() no longer returns diskFree, diskTotal, realDiskFree and realDiskTotal)

@capacitor-community/device
Capacitor community plugin to obtain internal information about the device (e.g. disk space, etc.)
| Maintainer | GitHub | Active |
|---|---|---|
| ryaa | ryaa | yes |
This plugin offers the API which has been removed from @capacitor/device plugin in v7.0 (getInfo() no longer returns diskFree, diskTotal, realDiskFree and realDiskTotal). For more details also see https://capacitorjs.com/docs/updating/7-0#device
This plugin contains code derived from or inspired by @capacitor/device plugin. Please note that it is a community plugin, not maintained by the Capacitor team.
Features:
NOTE: The plugin version 7.0.0 is compatible with Capacitor 7
| Capacitor version | Plugin version |
|---|---|
| 7.x | 7.x |
npm install @capacitor-community/device
npx cap sync
Apple mandates that app developers now specify approved reasons for API usage to enhance user privacy. By May 1st, 2024, it's required to include these reasons when submitting apps to the App Store Connect.
When using this specific plugin in your app, you must create a PrivacyInfo.xcprivacy file in /ios/App or use the VS Code Extension to generate it, specifying the usage reasons.
For detailed steps on how to do this, please see the Capacitor Docs.
For this plugin, the required dictionary key is NSPrivacyAccessedAPICategoryDiskSpace and the recommended reason is 85F4.1.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSPrivacyAccessedAPITypes</key>
<array>
<!-- Add this dict entry to the array if the PrivacyInfo file already exists -->
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryDiskSpace</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>85F4.1</string>
</array>
</dict>
</array>
</dict>
</plist>
import { CommunityDevice } from '@capacitor-community/device';
const logDeviceInfo = async () => {
const info = await CommunityDevice.getInfo();
console.log(info);
};
getInfo() => Promise<CommunityDeviceInfo>
Return information about the underlying device/os/platform.
Returns: Promise<CommunityDeviceInfo>
Since: 7.0.0
| Prop | Type | Description | Since |
|---|---|---|---|
diskFree | number | How much free disk space is available on the normal data storage path for the os, in bytes. On Android it returns the free disk space on the "system" partition holding the core Android OS. On iOS this value is not accurate. | 7.0.0 |
diskTotal | number | The total size of the normal data storage path for the OS, in bytes. On Android it returns the disk space on the "system" partition holding the core Android OS. | 7.0.0 |
realDiskFree | number | How much free disk space is available on the normal data storage, in bytes. | 7.0.0 |
realDiskTotal | number | The total size of the normal data storage path, in bytes. | 7.0.0 |
FAQs
This plugin offers the API which has been removed from @capacitor/device plugin in v7.0 (getInfo() no longer returns diskFree, diskTotal, realDiskFree and realDiskTotal)
The npm package @capacitor-community/device receives a total of 1,249 weekly downloads. As such, @capacitor-community/device popularity was classified as popular.
We found that @capacitor-community/device demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 45 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.

Security News
The planned feature introduces a review step before releases go live, following the Shai-Hulud attacks and a rocky migration off classic tokens that disrupted maintainer workflows.