{"_id":"@capawesome/capacitor-battery","_rev":"4-def0d02ba17742cdd30fe6465ff1bdf3","name":"@capawesome/capacitor-battery","dist-tags":{"latest":"0.1.2"},"versions":{"0.0.1":{"name":"@capawesome/capacitor-battery","version":"0.0.1","keywords":["capacitor","plugin","native"],"author":{"name":"Robin Genz","email":"mail@robingenz.dev"},"license":"MIT","_id":"@capawesome/capacitor-battery@0.0.1","maintainers":[{"name":"robingenz","email":"mail@robingenz.dev"}],"homepage":"https://capawesome.io/docs/plugins/battery/","bugs":{"url":"https://github.com/capawesome-team/capacitor-plugins/issues"},"dist":{"shasum":"a17f2d6925cf94499de9fb753faef70c7e95e88b","tarball":"https://registry.npmjs.org/@capawesome/capacitor-battery/-/capacitor-battery-0.0.1.tgz","fileCount":46,"integrity":"sha512-Q7vOd6OemkxcQJRR86m+viGfP0XT8czKM00M99BvbwfQhgayhBqTFWmVe+1T7kgAeSlKes5IfKS7KJBu+PTVBQ==","signatures":[{"sig":"MEUCIQCdELApkYF/vFyryMpQDQpqcIqKkRRnEjf/jZAm1pJ5/QIgMa7Y+2v8hsz9qpGGYrt+3YYzXn+rA65XiBySgBKEQeA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":89606},"main":"dist/plugin.cjs.js","types":"dist/esm/index.d.ts","unpkg":"dist/plugin.js","module":"dist/esm/index.js","funding":[{"url":"https://github.com/sponsors/capawesome-team/","type":"github"},{"url":"https://opencollective.com/capawesome","type":"opencollective"}],"gitHead":"8dd31ce5d3f16f94fb71d033f47512e99908f4e4","scripts":{"fmt":"npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format","lint":"npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint","build":"npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs","clean":"rimraf ./dist","watch":"tsc --watch","docgen":"docgen --api BatteryPlugin --output-readme README.md --output-json dist/docs.json","eslint":"eslint . --ext ts","verify":"npm run verify:ios && npm run verify:android && npm run verify:web","prettier":"prettier \"**/*.{css,html,ts,js,java}\"","swiftlint":"node-swiftlint","verify:ios":"cd ios && pod install && xcodebuild -workspace Plugin.xcworkspace -scheme Plugin -destination generic/platform=iOS && cd ..","verify:web":"npm run build","prepublishOnly":"npm run build","verify:android":"cd android && ./gradlew clean build test && cd ..","ios:pod:install":"cd ios && pod install --repo-update && cd ..","ios:spm:install":"cd ios && swift package resolve && cd .."},"_npmUser":{"name":"robingenz","email":"mail@robingenz.dev"},"capacitor":{"ios":{"src":"ios"},"android":{"src":"android"}},"repository":{"url":"git+https://github.com/capawesome-team/capacitor-plugins.git","type":"git"},"_npmVersion":"11.13.0","description":"Capacitor plugin to access battery information.","directories":{},"_nodeVersion":"24.16.0","eslintConfig":{"extends":"@ionic/eslint-config/recommended"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"8.57.0","rimraf":"6.1.2","rollup":"4.53.3","swiftlint":"2.0.0","typescript":"5.9.3","@capacitor/cli":"8.0.0","@capacitor/ios":"8.0.0","@capacitor/core":"8.0.0","@capacitor/docgen":"0.3.1","@capacitor/android":"8.0.0","@ionic/eslint-config":"0.4.0","prettier-plugin-java":"2.6.7"},"peerDependencies":{"@capacitor/core":">=8.0.0"},"_npmOperationalInternal":{"tmp":"tmp/capacitor-battery_0.0.1_1783405237006_0.9513225274892023","host":"s3://npm-registry-packages-npm-production"}},"0.1.0":{"name":"@capawesome/capacitor-battery","version":"0.1.0","keywords":["capacitor","plugin","native","capacitor-plugin","battery","battery level","battery status","battery state","low power mode","power saver","charging state"],"author":{"name":"Robin Genz","email":"mail@robingenz.dev"},"license":"MIT","_id":"@capawesome/capacitor-battery@0.1.0","maintainers":[{"name":"robingenz","email":"mail@robingenz.dev"}],"homepage":"https://capawesome.io/docs/sdks/capacitor/battery/","bugs":{"url":"https://github.com/capawesome-team/capacitor-plugins/issues"},"dist":{"shasum":"6c8f3a54b9f4ea04e0dd01f98bfaed998946eada","tarball":"https://registry.npmjs.org/@capawesome/capacitor-battery/-/capacitor-battery-0.1.0.tgz","fileCount":46,"integrity":"sha512-tQqA/dgs0VtnPbEZYPipAggiCim7aHE0ig+UzXRz9c1fkX5Mqr/aQHnaw4YPguB4EtPR6j8/9A2CsQkEXXr0Yg==","signatures":[{"sig":"MEQCIHAIWO5kSFafChvQj9ExWjHF/LKhAj65hkdreEtaDEe+AiBo8R8A88vBrWywYpYUxonRLG4spWGSoZaQ0Yhr2L4vqg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@capawesome%2fcapacitor-battery@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":94435},"main":"dist/plugin.cjs.js","types":"dist/esm/index.d.ts","unpkg":"dist/plugin.js","module":"dist/esm/index.js","funding":[{"url":"https://github.com/sponsors/capawesome-team/","type":"github"},{"url":"https://opencollective.com/capawesome","type":"opencollective"}],"gitHead":"1ce17b1fd14c43b2f1d5d3c2da82221e1d1dca37","scripts":{"fmt":"npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format","lint":"npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint","build":"npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs","clean":"rimraf ./dist","watch":"tsc --watch","docgen":"docgen --api BatteryPlugin --output-readme README.md --output-json dist/docs.json","eslint":"eslint . --ext ts","verify":"npm run verify:ios && npm run verify:android && npm run verify:web","prettier":"prettier \"**/*.{css,html,ts,js,java}\"","swiftlint":"node-swiftlint","verify:ios":"cd ios && pod install && xcodebuild -workspace Plugin.xcworkspace -scheme Plugin -destination generic/platform=iOS && cd ..","verify:web":"npm run build","prepublishOnly":"npm run build","verify:android":"cd android && ./gradlew clean build test && cd ..","ios:pod:install":"cd ios && pod install --repo-update && cd ..","ios:spm:install":"cd ios && swift package resolve && cd .."},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:c88c2c24-c57f-466c-9455-a7cbe7c478ba"}},"capacitor":{"ios":{"src":"ios"},"android":{"src":"android"}},"repository":{"url":"git+https://github.com/capawesome-team/capacitor-plugins.git","type":"git"},"_npmVersion":"11.16.0","description":"Capacitor plugin to access battery information on Android, iOS, and Web.","directories":{},"_nodeVersion":"24.18.0","eslintConfig":{"extends":"@ionic/eslint-config/recommended"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"8.57.0","rimraf":"6.1.2","rollup":"4.53.3","swiftlint":"2.0.0","typescript":"5.9.3","@capacitor/cli":"8.0.0","@capacitor/ios":"8.0.0","@capacitor/core":"8.0.0","@capacitor/docgen":"0.3.1","@capacitor/android":"8.0.0","@ionic/eslint-config":"0.4.0","prettier-plugin-java":"2.6.7"},"peerDependencies":{"@capacitor/core":">=8.0.0"},"_npmOperationalInternal":{"tmp":"tmp/capacitor-battery_0.1.0_1784015517503_0.5844421806704632","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@capawesome/capacitor-battery","version":"0.1.1","keywords":["capacitor","plugin","native","capacitor-plugin","battery","battery level","battery status","battery state","low power mode","power saver","charging state"],"author":{"name":"Robin Genz","email":"mail@robingenz.dev"},"license":"MIT","_id":"@capawesome/capacitor-battery@0.1.1","maintainers":[{"name":"robingenz","email":"mail@robingenz.dev"}],"homepage":"https://capawesome.io/docs/sdks/capacitor/battery/","bugs":{"url":"https://github.com/capawesome-team/capacitor-plugins/issues"},"dist":{"shasum":"e57c5f776659b5911b73918ea95ef4ba75345ab2","tarball":"https://registry.npmjs.org/@capawesome/capacitor-battery/-/capacitor-battery-0.1.1.tgz","fileCount":46,"integrity":"sha512-s1hoiYb3cTcipx5QfgERZYykITzv5jzsBCHZxoIBeIZeIfuOXBGYJcueQhGRJl4BuOC05nH1f0i8LFWvYrSSYg==","signatures":[{"sig":"MEUCIEVsQr1ImJunEkQ8Fx4wT+5WZFEDwmuFOu9cPg1oC1W8AiEAqHKpNvjHTVmvjs6yLkFsWpIy2QLBGeMuB/5Xqbunw7s=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@capawesome%2fcapacitor-battery@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":94444},"main":"dist/plugin.cjs.js","types":"dist/esm/index.d.ts","unpkg":"dist/plugin.js","module":"dist/esm/index.js","funding":[{"url":"https://github.com/sponsors/capawesome-team/","type":"github"},{"url":"https://opencollective.com/capawesome","type":"opencollective"}],"gitHead":"3e61f4b412f9f3f512c21169bb135bbb23a67e6d","scripts":{"fmt":"npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format","lint":"npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint","build":"npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs","clean":"rimraf ./dist","watch":"tsc --watch","docgen":"docgen --api BatteryPlugin --output-readme README.md --output-json dist/docs.json","eslint":"eslint . --ext ts","verify":"npm run verify:ios && npm run verify:android && npm run verify:web","prettier":"prettier \"**/*.{css,html,ts,js,java}\"","swiftlint":"node-swiftlint","verify:ios":"cd ios && pod install && xcodebuild -workspace Plugin.xcworkspace -scheme Plugin -destination generic/platform=iOS && cd ..","verify:web":"npm run build","prepublishOnly":"npm run build","verify:android":"cd android && ./gradlew clean build test && cd ..","ios:pod:install":"cd ios && pod install --repo-update && cd ..","ios:spm:install":"cd ios && swift package resolve && cd .."},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:c88c2c24-c57f-466c-9455-a7cbe7c478ba"}},"capacitor":{"ios":{"src":"ios"},"android":{"src":"android"}},"repository":{"url":"git+https://github.com/capawesome-team/capacitor-plugins.git","type":"git"},"_npmVersion":"11.16.0","description":"Capacitor plugin to access battery information on Android, iOS, and Web.","directories":{},"_nodeVersion":"24.18.0","eslintConfig":{"extends":"@ionic/eslint-config/recommended"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"8.57.0","rimraf":"6.1.2","rollup":"4.53.3","swiftlint":"2.0.0","typescript":"5.9.3","@capacitor/cli":"8.0.0","@capacitor/ios":"8.0.0","@capacitor/core":"8.0.0","@capacitor/docgen":"0.3.1","@capacitor/android":"8.0.0","@ionic/eslint-config":"0.4.0","prettier-plugin-java":"2.6.7"},"peerDependencies":{"@capacitor/core":">=8.0.0"},"_npmOperationalInternal":{"tmp":"tmp/capacitor-battery_0.1.1_1784102971016_0.9210745829797475","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"_id":"@capawesome/capacitor-battery@0.1.2","bugs":{"url":"https://github.com/capawesome-team/capacitor-plugins/issues"},"dist":{"shasum":"a2c2a38dd1d52b5f9c927acc0c735010849e3748","tarball":"https://registry.npmjs.org/@capawesome/capacitor-battery/-/capacitor-battery-0.1.2.tgz","fileCount":46,"integrity":"sha512-VskhoFz0rkpWvTlj1Zsdl+AbjTAQi/1VhWb4bgoy+jA97YGuF/4PehvEUbR4XnGD1cBqPQS0OvsYn/rOvO4CIw==","signatures":[{"sig":"MEYCIQDVvh9jc++wk5RQy7ZnYxd3ZbucgyjaNiQr+X2WNyyA+AIhAMRNKfxxPWf00HDvJk9QIeBqzOPR+ZQM1OO4Dh7V+3Va","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDz8k/ChYOXySC73G9jyucN7fi2NDpqipYSi+lrjuea8QIhALGkl7WoaMC55xiEnvjUdEyQNlg0JmRsKyvFirYCHT7R"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@capawesome%2fcapacitor-battery@0.1.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":94503},"main":"dist/plugin.cjs.js","name":"@capawesome/capacitor-battery","types":"dist/esm/index.d.ts","unpkg":"dist/plugin.js","author":{"name":"Robin Genz","email":"mail@robingenz.dev"},"module":"dist/esm/index.js","funding":[{"url":"https://github.com/sponsors/capawesome-team/","type":"github"},{"url":"https://opencollective.com/capawesome","type":"opencollective"}],"gitHead":"7c1937ed10b7de86ca2c1cdc3539a2735fd69a00","license":"MIT","scripts":{"fmt":"npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format","lint":"npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint","build":"npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs","clean":"rimraf ./dist","watch":"tsc --watch","docgen":"docgen --api BatteryPlugin --output-readme README.md --output-json dist/docs.json","eslint":"eslint . --ext ts","verify":"npm run verify:ios && npm run verify:android && npm run verify:web","prettier":"prettier \"**/*.{css,html,ts,js,java}\"","swiftlint":"node-swiftlint","verify:ios":"cd ios && pod install && xcodebuild -workspace Plugin.xcworkspace -scheme Plugin -destination generic/platform=iOS && cd ..","verify:web":"npm run build","prepublishOnly":"npm run build","verify:android":"cd android && ./gradlew clean build test && cd ..","ios:pod:install":"cd ios && pod install --repo-update && cd ..","ios:spm:install":"cd ios && swift package resolve && cd .."},"version":"0.1.2","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:c88c2c24-c57f-466c-9455-a7cbe7c478ba"}},"homepage":"https://capawesome.io/docs/sdks/capacitor/battery/","keywords":["capacitor","plugin","native","capacitor-plugin","battery","battery level","battery status","battery state","low power mode","power saver","charging state"],"capacitor":{"ios":{"src":"ios"},"android":{"src":"android"}},"repository":{"url":"git+https://github.com/capawesome-team/capacitor-plugins.git","type":"git"},"_npmVersion":"11.17.0","description":"Capacitor plugin to access battery information on Android, iOS, and Web.","directories":{},"maintainers":[{"name":"robingenz","email":"mail@robingenz.dev"}],"_nodeVersion":"24.19.0","eslintConfig":{"extends":"@ionic/eslint-config/recommended"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"8.57.0","rimraf":"6.1.2","rollup":"4.62.3","swiftlint":"2.0.0","typescript":"5.9.3","@capacitor/cli":"8.4.2","@capacitor/ios":"8.0.0","@capacitor/core":"8.0.0","@capacitor/docgen":"0.3.1","@capacitor/android":"8.0.0","@ionic/eslint-config":"0.4.0","prettier-plugin-java":"2.9.7"},"peerDependencies":{"@capacitor/core":">=8.0.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/capacitor-battery_0.1.2_1788337370780_0.45540383906220394"}}},"time":{"created":"2026-07-07T06:20:36.796Z","modified":"2026-09-02T08:22:51.336Z","0.0.1":"2026-07-07T06:20:37.153Z","0.1.0":"2026-07-14T07:51:57.648Z","0.1.1":"2026-07-15T08:09:31.148Z","0.1.2":"2026-09-02T08:22:50.876Z"},"bugs":{"url":"https://github.com/capawesome-team/capacitor-plugins/issues"},"author":{"name":"Robin Genz","email":"mail@robingenz.dev"},"license":"MIT","homepage":"https://capawesome.io/docs/sdks/capacitor/battery/","keywords":["capacitor","plugin","native","capacitor-plugin","battery","battery level","battery status","battery state","low power mode","power saver","charging state"],"repository":{"url":"git+https://github.com/capawesome-team/capacitor-plugins.git","type":"git"},"description":"Capacitor plugin to access battery information on Android, iOS, and Web.","maintainers":[{"name":"robingenz","email":"mail@robingenz.dev"}],"readme":"# Capacitor Battery Plugin\n\nCapacitor plugin to access battery information.\n\n<div class=\"capawesome-z29o10a\">\n  <a href=\"https://cloud.capawesome.io/\" target=\"_blank\">\n    <img alt=\"Deliver Live Updates to your Capacitor app with Capawesome Cloud\" src=\"https://cloud.capawesome.io/assets/banners/cloud-build-and-deploy-capacitor-apps.png?t=1\" />\n  </a>\n</div>\n\n## Features\n\nThe Capacitor Battery plugin is one of the most complete battery monitoring solutions for Capacitor apps. Here are some of the key features:\n\n- 🔋 **Battery level**: Read the current battery level of the device.\n- ⚡ **Battery state**: Read whether the device is charging, full or unplugged.\n- 🪫 **Low power mode**: Read whether the low power mode is enabled.\n- 👂 **Change events**: Listen for changes to the battery level, state and low power mode.\n- 🌐 **Web support**: Read the battery level and state on supported browsers.\n- 🤝 **Compatibility**: Works alongside the [Android Battery Optimization](https://capawesome.io/docs/sdks/capacitor/android-battery-optimization/) plugin.\n- 📦 **CocoaPods & SPM**: Supports CocoaPods and Swift Package Manager for iOS.\n- 🔁 **Up-to-date**: Always supports the latest Capacitor version.\n\nMissing a feature? Just [open an issue](https://github.com/capawesome-team/capacitor-plugins/issues) and we'll take a look!\n\n## Use Cases\n\nThe Battery plugin is typically used whenever an app should adapt its behavior to the device's power situation, for example:\n\n- **Energy-aware features**: Reduce background work, animations, or sync frequency when the battery level is low.\n- **Low power mode handling**: Disable power-hungry features when the user has enabled low power mode.\n- **Charging-dependent tasks**: Only start heavy tasks such as large downloads while the device is charging.\n- **Status display**: Show the current battery level and charging state inside your app, for example in a kiosk or fleet app.\n- **Reacting to changes**: Warn the user when the battery level drops by listening for change events.\n\n## Compatibility\n\n| Plugin Version | Capacitor Version | Status         |\n| -------------- | ----------------- | -------------- |\n| 0.x.x          | >=8.x.x           | Active support |\n\n## Guides\n\n- [The Complete Guide to Capacitor Device Sensors](https://capawesome.io/blog/capacitor-device-sensors-guide/): How battery state pairs with the Thermal State plugin to gate background work.\n\n## Installation\n\nYou can use our **AI-Assisted Setup** to install the plugin.\nAdd the [Capawesome Skills](https://github.com/capawesome-team/skills) to your AI tool using the following command:\n\n```bash\nnpx skills add capawesome-team/skills --skill capacitor-plugins\n```\n\nThen use the following prompt:\n\n```\n Use the `capacitor-plugins` skill from `capawesome-team/skills` to install the `@capawesome/capacitor-battery` plugin in my project.\n```\n\nIf you prefer **Manual Setup**, install the plugin by running the following commands and follow the platform-specific instructions below:\n\n```bash\nnpm install @capawesome/capacitor-battery\nnpx cap sync\n```\n\nThis plugin does not require any additional configuration or permissions on Android or iOS.\n\nOn the **Web**, the battery level and state are only available in browsers that implement the [Battery Status API](https://developer.mozilla.org/en-US/docs/Web/API/Battery_Status_API) (Chromium-based browsers). The low power mode is not available on the Web.\n\n## Configuration\n\nNo configuration required for this plugin.\n\n## Usage\n\nThe following examples show how to get the current battery level and state, check if low power mode is enabled, listen for battery changes, and remove all listeners.\n\n### Get the current battery level\n\nRead the current battery level of the device as a value between `0.0` and `1.0`:\n\n```typescript\nimport { Battery } from '@capawesome/capacitor-battery';\n\nconst getBatteryLevel = async () => {\n  const { level } = await Battery.getBatteryLevel();\n  return level;\n};\n```\n\n### Get the current battery state\n\nCheck whether the device is charging, full or unplugged:\n\n```typescript\nimport { Battery } from '@capawesome/capacitor-battery';\n\nconst getBatteryState = async () => {\n  const { state } = await Battery.getBatteryState();\n  return state;\n};\n```\n\n### Check if low power mode is enabled\n\nRead whether the low power mode (power saver mode on Android, Low Power Mode on iOS) is currently enabled. Only available on Android and iOS:\n\n```typescript\nimport { Battery } from '@capawesome/capacitor-battery';\n\nconst isLowPowerModeEnabled = async () => {\n  const { enabled } = await Battery.isLowPowerModeEnabled();\n  return enabled;\n};\n```\n\n### Listen for battery changes\n\nGet notified when the battery level, battery state or low power mode changes. The device is only observed while at least one listener is attached. The `lowPowerModeChange` event is only available on Android and iOS:\n\n```typescript\nimport { Battery } from '@capawesome/capacitor-battery';\n\nconst addBatteryLevelChangeListener = async () => {\n  await Battery.addListener('batteryLevelChange', event => {\n    console.log('Battery level changed:', event.level);\n  });\n};\n\nconst addBatteryStateChangeListener = async () => {\n  await Battery.addListener('batteryStateChange', event => {\n    console.log('Battery state changed:', event.state);\n  });\n};\n\nconst addLowPowerModeChangeListener = async () => {\n  await Battery.addListener('lowPowerModeChange', event => {\n    console.log('Low power mode changed:', event.enabled);\n  });\n};\n```\n\n### Remove all listeners\n\nRemove all listeners that were registered for this plugin:\n\n```typescript\nimport { Battery } from '@capawesome/capacitor-battery';\n\nconst removeAllListeners = async () => {\n  await Battery.removeAllListeners();\n};\n```\n\n## API\n\n<docgen-index>\n\n* [`getBatteryLevel()`](#getbatterylevel)\n* [`getBatteryState()`](#getbatterystate)\n* [`isLowPowerModeEnabled()`](#islowpowermodeenabled)\n* [`addListener('batteryLevelChange', ...)`](#addlistenerbatterylevelchange-)\n* [`addListener('batteryStateChange', ...)`](#addlistenerbatterystatechange-)\n* [`addListener('lowPowerModeChange', ...)`](#addlistenerlowpowermodechange-)\n* [`removeAllListeners()`](#removealllisteners)\n* [Interfaces](#interfaces)\n* [Type Aliases](#type-aliases)\n\n</docgen-index>\n\n<docgen-api>\n<!--Update the source file JSDoc comments and rerun docgen to update the docs below-->\n\n### getBatteryLevel()\n\n```typescript\ngetBatteryLevel() => Promise<GetBatteryLevelResult>\n```\n\nGet the current battery level of the device.\n\nOn the web, this is only supported in browsers that implement the\n[Battery Status API](https://developer.mozilla.org/en-US/docs/Web/API/Battery_Status_API)\n(Chromium-based browsers).\n\nOnly available on Android, iOS and Web.\n\n**Returns:** <code>Promise&lt;<a href=\"#getbatterylevelresult\">GetBatteryLevelResult</a>&gt;</code>\n\n**Since:** 0.1.0\n\n--------------------\n\n\n### getBatteryState()\n\n```typescript\ngetBatteryState() => Promise<GetBatteryStateResult>\n```\n\nGet the current battery state of the device.\n\nOn the web, this is only supported in browsers that implement the\n[Battery Status API](https://developer.mozilla.org/en-US/docs/Web/API/Battery_Status_API)\n(Chromium-based browsers).\n\nOnly available on Android, iOS and Web.\n\n**Returns:** <code>Promise&lt;<a href=\"#getbatterystateresult\">GetBatteryStateResult</a>&gt;</code>\n\n**Since:** 0.1.0\n\n--------------------\n\n\n### isLowPowerModeEnabled()\n\n```typescript\nisLowPowerModeEnabled() => Promise<IsLowPowerModeEnabledResult>\n```\n\nGet whether the low power mode is currently enabled.\n\nOn Android, this refers to the power saver mode. On iOS, this refers to\nthe Low Power Mode.\n\nOnly available on Android and iOS.\n\n**Returns:** <code>Promise&lt;<a href=\"#islowpowermodeenabledresult\">IsLowPowerModeEnabledResult</a>&gt;</code>\n\n**Since:** 0.1.0\n\n--------------------\n\n\n### addListener('batteryLevelChange', ...)\n\n```typescript\naddListener(eventName: 'batteryLevelChange', listenerFunc: (event: BatteryLevelChangeEvent) => void) => Promise<PluginListenerHandle>\n```\n\nListen for changes to the battery level of the device.\n\nThe device is only observed while at least one listener is attached.\n\nOn the web, this is only supported in browsers that implement the\n[Battery Status API](https://developer.mozilla.org/en-US/docs/Web/API/Battery_Status_API)\n(Chromium-based browsers).\n\nOnly available on Android, iOS and Web.\n\n| Param              | Type                                                                                            |\n| ------------------ | ----------------------------------------------------------------------------------------------- |\n| **`eventName`**    | <code>'batteryLevelChange'</code>                                                               |\n| **`listenerFunc`** | <code>(event: <a href=\"#batterylevelchangeevent\">BatteryLevelChangeEvent</a>) =&gt; void</code> |\n\n**Returns:** <code>Promise&lt;<a href=\"#pluginlistenerhandle\">PluginListenerHandle</a>&gt;</code>\n\n**Since:** 0.1.0\n\n--------------------\n\n\n### addListener('batteryStateChange', ...)\n\n```typescript\naddListener(eventName: 'batteryStateChange', listenerFunc: (event: BatteryStateChangeEvent) => void) => Promise<PluginListenerHandle>\n```\n\nListen for changes to the battery state of the device.\n\nThe device is only observed while at least one listener is attached.\n\nOn the web, this is only supported in browsers that implement the\n[Battery Status API](https://developer.mozilla.org/en-US/docs/Web/API/Battery_Status_API)\n(Chromium-based browsers).\n\nOnly available on Android, iOS and Web.\n\n| Param              | Type                                                                                            |\n| ------------------ | ----------------------------------------------------------------------------------------------- |\n| **`eventName`**    | <code>'batteryStateChange'</code>                                                               |\n| **`listenerFunc`** | <code>(event: <a href=\"#batterystatechangeevent\">BatteryStateChangeEvent</a>) =&gt; void</code> |\n\n**Returns:** <code>Promise&lt;<a href=\"#pluginlistenerhandle\">PluginListenerHandle</a>&gt;</code>\n\n**Since:** 0.1.0\n\n--------------------\n\n\n### addListener('lowPowerModeChange', ...)\n\n```typescript\naddListener(eventName: 'lowPowerModeChange', listenerFunc: (event: LowPowerModeChangeEvent) => void) => Promise<PluginListenerHandle>\n```\n\nListen for changes to the low power mode of the device.\n\nThe device is only observed while at least one listener is attached.\n\nOnly available on Android and iOS.\n\n| Param              | Type                                                                                            |\n| ------------------ | ----------------------------------------------------------------------------------------------- |\n| **`eventName`**    | <code>'lowPowerModeChange'</code>                                                               |\n| **`listenerFunc`** | <code>(event: <a href=\"#lowpowermodechangeevent\">LowPowerModeChangeEvent</a>) =&gt; void</code> |\n\n**Returns:** <code>Promise&lt;<a href=\"#pluginlistenerhandle\">PluginListenerHandle</a>&gt;</code>\n\n**Since:** 0.1.0\n\n--------------------\n\n\n### removeAllListeners()\n\n```typescript\nremoveAllListeners() => Promise<void>\n```\n\nRemove all listeners for this plugin.\n\n**Since:** 0.1.0\n\n--------------------\n\n\n### Interfaces\n\n\n#### GetBatteryLevelResult\n\n| Prop        | Type                | Description                                                                 | Since |\n| ----------- | ------------------- | --------------------------------------------------------------------------- | ----- |\n| **`level`** | <code>number</code> | The current battery level of the device as a value between `0.0` and `1.0`. | 0.1.0 |\n\n\n#### GetBatteryStateResult\n\n| Prop        | Type                                                  | Description                              | Since |\n| ----------- | ----------------------------------------------------- | ---------------------------------------- | ----- |\n| **`state`** | <code><a href=\"#batterystate\">BatteryState</a></code> | The current battery state of the device. | 0.1.0 |\n\n\n#### IsLowPowerModeEnabledResult\n\n| Prop          | Type                 | Description                                      | Since |\n| ------------- | -------------------- | ------------------------------------------------ | ----- |\n| **`enabled`** | <code>boolean</code> | Whether the low power mode is currently enabled. | 0.1.0 |\n\n\n#### PluginListenerHandle\n\n| Prop         | Type                                      |\n| ------------ | ----------------------------------------- |\n| **`remove`** | <code>() =&gt; Promise&lt;void&gt;</code> |\n\n\n#### BatteryLevelChangeEvent\n\n| Prop        | Type                | Description                                                                 | Since |\n| ----------- | ------------------- | --------------------------------------------------------------------------- | ----- |\n| **`level`** | <code>number</code> | The current battery level of the device as a value between `0.0` and `1.0`. | 0.1.0 |\n\n\n#### BatteryStateChangeEvent\n\n| Prop        | Type                                                  | Description                              | Since |\n| ----------- | ----------------------------------------------------- | ---------------------------------------- | ----- |\n| **`state`** | <code><a href=\"#batterystate\">BatteryState</a></code> | The current battery state of the device. | 0.1.0 |\n\n\n#### LowPowerModeChangeEvent\n\n| Prop          | Type                 | Description                                      | Since |\n| ------------- | -------------------- | ------------------------------------------------ | ----- |\n| **`enabled`** | <code>boolean</code> | Whether the low power mode is currently enabled. | 0.1.0 |\n\n\n### Type Aliases\n\n\n#### BatteryState\n\nThe battery state of the device.\n\n- `charging`: The device is plugged into power and the battery is charging.\n- `full`: The device is plugged into power and the battery is fully charged.\n- `unplugged`: The device is not plugged into power and the battery is\n  discharging.\n- `unknown`: The battery state could not be determined.\n\n<code>'charging' | 'full' | 'unplugged' | 'unknown'</code>\n\n</docgen-api>\n\n## Battery Information\n\nKeep the following platform differences in mind when accessing battery information:\n\n- **Android**: The battery level and state are read from the sticky [`ACTION_BATTERY_CHANGED`](https://developer.android.com/reference/android/content/Intent#ACTION_BATTERY_CHANGED) broadcast. The low power mode reflects the [power saver mode](https://developer.android.com/reference/android/os/PowerManager#isPowerSaveMode()) of the device.\n- **iOS**: The battery level is not available on the iOS Simulator, so `getBatteryLevel()` rejects with an error there. Use a real device to test this method. The low power mode reflects the [Low Power Mode](https://support.apple.com/en-us/101604) of the device.\n- **Web**: The battery level and state are only available in browsers that implement the [Battery Status API](https://developer.mozilla.org/en-US/docs/Web/API/Battery_Status_API) (Chromium-based browsers). The low power mode is not available on the Web.\n\n## FAQ\n\n### How is this plugin different from other similar plugins?\n\nIt reports the full battery picture — level, charging state, and low power mode — plus change events that observe the device only while a listener is attached, all through a fully typed API that works across Android, iOS, and supported browsers on the Web. If you just need a one-off battery reading, that's a quick call; if you want to react to charging and low-power changes over time without wasting energy, this plugin is built for exactly that.\n\n### Why does `getBatteryLevel` fail on the iOS Simulator?\n\nThe battery level is not available on the iOS Simulator, so `getBatteryLevel()` rejects with an error there. Use a real device to test this method.\n\n### Does this plugin work in all browsers?\n\nNo, on the Web the battery level and state are only available in browsers that implement the [Battery Status API](https://developer.mozilla.org/en-US/docs/Web/API/Battery_Status_API), which are Chromium-based browsers. The low power mode is not available on the Web at all.\n\n### What is the range of the battery level value?\n\nThe battery level is returned as a value between `0.0` and `1.0`, where `0.0` means the battery is empty and `1.0` means it is fully charged. Multiply the value by 100 if you want to display it as a percentage.\n\n### What does low power mode mean on Android and iOS?\n\nOn Android, it refers to the [power saver mode](https://developer.android.com/reference/android/os/PowerManager#isPowerSaveMode()) of the device. On iOS, it refers to the [Low Power Mode](https://support.apple.com/en-us/101604). The `isLowPowerModeEnabled()` method and the `lowPowerModeChange` event are only available on Android and iOS.\n\n### Does listening for battery changes drain the battery?\n\nThe device is only observed while at least one listener is attached. As soon as you remove all listeners, for example with `removeAllListeners()`, the plugin stops observing the device.\n\n### Can I use this plugin with Ionic, React, Vue or Angular?\n\nYes, the plugin is framework-agnostic. It works in any Capacitor app regardless of the web framework, including Ionic with Angular, React, or Vue, as well as plain JavaScript projects.\n\n## Related Plugins\n\n- [Android Battery Optimization](https://capawesome.io/docs/sdks/capacitor/android-battery-optimization/): Manage battery optimization settings and request exemptions on Android.\n- [Device Info](https://capawesome.io/docs/sdks/capacitor/device-info/): Read device information, such as the model, manufacturer, operating system, and memory.\n- [Thermal State](https://capawesome.io/docs/sdks/capacitor/thermal-state/): Read the device thermal state and react before the operating system throttles your app.\n\n## Newsletter\n\nStay up to date with the latest news and updates about the Capawesome, Capacitor, and Ionic ecosystem by subscribing to our [Capawesome Newsletter](https://cloud.capawesome.io/newsletter/).\n\n## Changelog\n\nSee [CHANGELOG.md](https://github.com/capawesome-team/capacitor-plugins/blob/main/packages/battery/CHANGELOG.md).\n\n## License\n\nSee [LICENSE](https://github.com/capawesome-team/capacitor-plugins/blob/main/packages/battery/LICENSE).\n","readmeFilename":"README.md"}