{"_id":"@capawesome/capacitor-light-sensor","_rev":"4-d7a380600d7b5534070c8e4700c20980","name":"@capawesome/capacitor-light-sensor","dist-tags":{"latest":"0.1.2"},"versions":{"0.0.1":{"name":"@capawesome/capacitor-light-sensor","version":"0.0.1","keywords":["capacitor","plugin","native"],"author":{"name":"Robin Genz","email":"mail@robingenz.dev"},"license":"MIT","_id":"@capawesome/capacitor-light-sensor@0.0.1","maintainers":[{"name":"robingenz","email":"mail@robingenz.dev"}],"homepage":"https://capawesome.io/docs/sdks/capacitor/light-sensor/","bugs":{"url":"https://github.com/capawesome-team/capacitor-plugins/issues"},"dist":{"shasum":"f4c5ac3fdcaf61b5052298f1dc2e8c8fd05e2156","tarball":"https://registry.npmjs.org/@capawesome/capacitor-light-sensor/-/capacitor-light-sensor-0.0.1.tgz","fileCount":33,"integrity":"sha512-+QTJcnfgT8TWAZXHw/NPJd5WwrX5zTlzwUMlthlUVsny8Ibc2ZOTHYNNPCcBXJWGeT6/u4z0fhCrzdqoRsGETA==","signatures":[{"sig":"MEUCIQCVZhNYs1djD0C7P8Wi31xCXtP/6TNsoYtiwuiyv3bzNgIgWP1rMWA3SmxCv/6BUGflWm0y0ZpU4OT2Udv7hezRKDE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":44803},"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":"a8c9e0f3c4687c6a9f4fc7554f3dc79536ad5154","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 LightSensorPlugin --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 read the device's ambient light sensor.","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-light-sensor_0.0.1_1783449364715_0.20195364754972278","host":"s3://npm-registry-packages-npm-production"}},"0.1.0":{"name":"@capawesome/capacitor-light-sensor","version":"0.1.0","keywords":["capacitor","plugin","native","capacitor-plugin","light sensor","ambient light","ambient light sensor","illuminance","lux","sensor","brightness detection"],"author":{"name":"Robin Genz","email":"mail@robingenz.dev"},"license":"MIT","_id":"@capawesome/capacitor-light-sensor@0.1.0","maintainers":[{"name":"robingenz","email":"mail@robingenz.dev"}],"homepage":"https://capawesome.io/docs/sdks/capacitor/light-sensor/","bugs":{"url":"https://github.com/capawesome-team/capacitor-plugins/issues"},"dist":{"shasum":"cd3531c7085e43643dd2d8b063e7efc3ae7511cc","tarball":"https://registry.npmjs.org/@capawesome/capacitor-light-sensor/-/capacitor-light-sensor-0.1.0.tgz","fileCount":33,"integrity":"sha512-efB0q3vyoAO5jIo6eaZLnmtLYJxIDrAT2sIaIiD1oQVw4FkJtxPMRgrWDIgj+rL+IVr7fGKugRr91gMWAYidRQ==","signatures":[{"sig":"MEUCICFQDZWUvf6qxWt/qCv+balywAlOuFn5Ll+FMXv1daJxAiEA3Cms8+a41LkJTpx6F5U8SbSdtUNRhCoAANZBPVOBiRU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@capawesome%2fcapacitor-light-sensor@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":49371},"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 LightSensorPlugin --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:000ba51b-7c1e-41ca-be22-c45996049894"}},"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 read the device's ambient light sensor on Android.","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-light-sensor_0.1.0_1784015546645_0.006367592552807055","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@capawesome/capacitor-light-sensor","version":"0.1.1","keywords":["capacitor","plugin","native","capacitor-plugin","light sensor","ambient light","ambient light sensor","illuminance","lux","sensor","brightness detection"],"author":{"name":"Robin Genz","email":"mail@robingenz.dev"},"license":"MIT","_id":"@capawesome/capacitor-light-sensor@0.1.1","maintainers":[{"name":"robingenz","email":"mail@robingenz.dev"}],"homepage":"https://capawesome.io/docs/sdks/capacitor/light-sensor/","bugs":{"url":"https://github.com/capawesome-team/capacitor-plugins/issues"},"dist":{"shasum":"5d21d60e14c50e857206803838cfe58af954c788","tarball":"https://registry.npmjs.org/@capawesome/capacitor-light-sensor/-/capacitor-light-sensor-0.1.1.tgz","fileCount":33,"integrity":"sha512-6100FcnUzTXixiFMCmw/VvXXD7YE1xDbvXHaLyAg5uB+NL4EtXla6a4mzVY3fSETWN0dDvST+4W9tva5d+10oQ==","signatures":[{"sig":"MEYCIQDffV0QnDap+NNDxe7CtetlpOItgeUgPF7ncdb/2oyViAIhANkPnht+0aaxNGCLXVVKzw5sJ+yg61HWfSkfdiy5YlkW","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@capawesome%2fcapacitor-light-sensor@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":49380},"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 LightSensorPlugin --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:000ba51b-7c1e-41ca-be22-c45996049894"}},"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 read the device's ambient light sensor on Android.","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-light-sensor_0.1.1_1784103000167_0.6190192088397937","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@capawesome/capacitor-light-sensor","version":"0.1.2","description":"Capacitor plugin to read the device's ambient light sensor on Android.","main":"dist/plugin.cjs.js","module":"dist/esm/index.js","types":"dist/esm/index.d.ts","unpkg":"dist/plugin.js","author":{"name":"Robin Genz","email":"mail@robingenz.dev"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/capawesome-team/capacitor-plugins.git"},"bugs":{"url":"https://github.com/capawesome-team/capacitor-plugins/issues"},"funding":[{"type":"github","url":"https://github.com/sponsors/capawesome-team/"},{"type":"opencollective","url":"https://opencollective.com/capawesome"}],"homepage":"https://capawesome.io/docs/sdks/capacitor/light-sensor/","keywords":["capacitor","plugin","native","capacitor-plugin","light sensor","ambient light","ambient light sensor","illuminance","lux","sensor","brightness detection"],"scripts":{"verify":"npm run verify:ios && npm run verify:android && npm run verify:web","verify:ios":"cd ios && pod install && xcodebuild -workspace Plugin.xcworkspace -scheme Plugin -destination generic/platform=iOS && cd ..","verify:android":"cd android && ./gradlew clean build test && cd ..","verify:web":"npm run build","lint":"npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint","fmt":"npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format","eslint":"eslint . --ext ts","prettier":"prettier \"**/*.{css,html,ts,js,java}\"","swiftlint":"node-swiftlint","docgen":"docgen --api LightSensorPlugin --output-readme README.md --output-json dist/docs.json","build":"npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs","clean":"rimraf ./dist","watch":"tsc --watch","ios:pod:install":"cd ios && pod install --repo-update && cd ..","ios:spm:install":"cd ios && swift package resolve && cd ..","prepublishOnly":"npm run build"},"devDependencies":{"@capacitor/android":"8.0.0","@capacitor/cli":"8.4.2","@capacitor/core":"8.0.0","@capacitor/docgen":"0.3.1","@capacitor/ios":"8.0.0","@ionic/eslint-config":"0.4.0","eslint":"8.57.0","prettier-plugin-java":"2.9.7","rimraf":"6.1.2","rollup":"4.62.3","swiftlint":"2.0.0","typescript":"5.9.3"},"peerDependencies":{"@capacitor/core":">=8.0.0"},"eslintConfig":{"extends":"@ionic/eslint-config/recommended"},"capacitor":{"ios":{"src":"ios"},"android":{"src":"android"}},"publishConfig":{"access":"public"},"gitHead":"7c1937ed10b7de86ca2c1cdc3539a2735fd69a00","_id":"@capawesome/capacitor-light-sensor@0.1.2","_nodeVersion":"24.19.0","_npmVersion":"11.17.0","dist":{"integrity":"sha512-R2hMx/y+FmyobbmxMGEUjhF6kJmdSVZVf93gRKeNvthNH+ns8l5x761nMgbQ1Fkb8mZLPpVn6BOj8kD6XMhXmA==","shasum":"35bb25cb741b3f8a13b4d46551ee03188a66959f","tarball":"https://registry.npmjs.org/@capawesome/capacitor-light-sensor/-/capacitor-light-sensor-0.1.2.tgz","fileCount":33,"unpackedSize":49427,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@capawesome%2fcapacitor-light-sensor@0.1.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCICPwXUdJFMsmUgA8Xk4rlBwnjvylNQSkDpCIHCNJirwkAiEAgfuTLv0K3lY1xtwiXcg2ENaUNEjSDhlBYDw2YJtG1lc="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:000ba51b-7c1e-41ca-be22-c45996049894"}},"directories":{},"maintainers":[{"name":"robingenz","email":"mail@robingenz.dev"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/capacitor-light-sensor_0.1.2_1788337365432_0.9857627391373727"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-07T18:36:04.373Z","modified":"2026-09-02T08:22:45.920Z","0.0.1":"2026-07-07T18:36:04.866Z","0.1.0":"2026-07-14T07:52:26.780Z","0.1.1":"2026-07-15T08:10:00.297Z","0.1.2":"2026-09-02T08:22:45.571Z"},"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/light-sensor/","keywords":["capacitor","plugin","native","capacitor-plugin","light sensor","ambient light","ambient light sensor","illuminance","lux","sensor","brightness detection"],"repository":{"type":"git","url":"git+https://github.com/capawesome-team/capacitor-plugins.git"},"description":"Capacitor plugin to read the device's ambient light sensor on Android.","maintainers":[{"name":"robingenz","email":"mail@robingenz.dev"}],"readme":"# Capacitor Light Sensor Plugin\n\nCapacitor plugin to read the device's ambient light sensor.\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 Light Sensor plugin provides a complete solution for ambient light measurements in Capacitor apps. Here are some of the key features:\n\n- 🌗 **Illuminance**: Read the ambient light level in lux.\n- ⚡ **Real-time measurements**: Continuous light data with event listeners.\n- 🖥️ **Native**: Supports Android.\n- 🤝 **Compatibility**: Works alongside the [Screen Brightness](https://capawesome.io/docs/sdks/capacitor/screen-brightness/) 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 Light Sensor plugin is typically used to react to the lighting conditions around the device, for example:\n\n- **Adaptive theming**: Switch between a light and dark theme based on the ambient light level.\n- **Brightness control**: Combine the illuminance readings with the [Screen Brightness](https://capawesome.io/docs/sdks/capacitor/screen-brightness/) plugin to adjust the screen brightness.\n- **Environment monitoring**: Continuously measure the light level in a room using real-time measurement events.\n- **Reading comfort**: Detect dark environments and suggest a more comfortable display mode to the user.\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 ambient light readings pair with the Proximity Sensor for adaptive UX.\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-light-sensor` 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-light-sensor\nnpx cap sync\n```\n\n### Android\n\n#### Proguard\n\nIf you are using Proguard, you need to add the following rules to your `proguard-rules.pro` file:\n\n```\n-keep class io.capawesome.capacitorjs.plugins.** { *; }\n```\n\n### iOS\n\niOS does not provide a public API to read the ambient light sensor, so the plugin is not implemented on this platform. The closest available signal is the screen brightness, which you can read using the [Screen Brightness](https://capawesome.io/docs/sdks/capacitor/screen-brightness/) plugin.\n\n## Configuration\n\nNo configuration required for this plugin.\n\n## Usage\n\nThe following examples show how to check whether an ambient light sensor is available, read the current light level, and receive or stop continuous measurement updates.\n\n### Check if the light sensor is available\n\nCheck whether the device has an ambient light sensor before using the other methods. Only available on Android:\n\n```typescript\nimport { LightSensor } from '@capawesome/capacitor-light-sensor';\n\nconst isAvailable = async () => {\n  const result = await LightSensor.isAvailable();\n  return result.available;\n};\n```\n\n### Read the current light level\n\nGet the most recent measurement from the ambient light sensor in lux. Only available on Android:\n\n```typescript\nimport { LightSensor } from '@capawesome/capacitor-light-sensor';\n\nconst getMeasurement = async () => {\n  const measurement = await LightSensor.getMeasurement();\n  console.log('Illuminance: ', measurement.illuminance);\n};\n```\n\n### Receive continuous measurements\n\nAdd a listener for the `measurement` event and start the measurement updates to receive real-time light data. Only available on Android:\n\n```typescript\nimport { LightSensor } from '@capawesome/capacitor-light-sensor';\n\nconst startMeasurementUpdates = async () => {\n  await LightSensor.addListener('measurement', measurement => {\n    console.log('Illuminance: ', measurement.illuminance);\n  });\n  await LightSensor.startMeasurementUpdates();\n};\n```\n\n### Stop receiving measurements\n\nStop the measurement updates and remove the listeners when you no longer need them:\n\n```typescript\nimport { LightSensor } from '@capawesome/capacitor-light-sensor';\n\nconst stopMeasurementUpdates = async () => {\n  await LightSensor.stopMeasurementUpdates();\n};\n\nconst removeAllListeners = async () => {\n  await LightSensor.removeAllListeners();\n};\n```\n\n## API\n\n<docgen-index>\n\n* [`getMeasurement()`](#getmeasurement)\n* [`isAvailable()`](#isavailable)\n* [`startMeasurementUpdates()`](#startmeasurementupdates)\n* [`stopMeasurementUpdates()`](#stopmeasurementupdates)\n* [`addListener('measurement', ...)`](#addlistenermeasurement-)\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### getMeasurement()\n\n```typescript\ngetMeasurement() => Promise<GetMeasurementResult>\n```\n\nGet the latest measurement.\n\nThis method returns the most recent measurement from the ambient light sensor.\n\nOnly available on Android.\n\n**Returns:** <code>Promise&lt;<a href=\"#measurement\">Measurement</a>&gt;</code>\n\n**Since:** 0.1.0\n\n--------------------\n\n\n### isAvailable()\n\n```typescript\nisAvailable() => Promise<IsAvailableResult>\n```\n\nCheck if the ambient light sensor is available on the device.\n\nOnly available on Android.\n\n**Returns:** <code>Promise&lt;<a href=\"#isavailableresult\">IsAvailableResult</a>&gt;</code>\n\n**Since:** 0.1.0\n\n--------------------\n\n\n### startMeasurementUpdates()\n\n```typescript\nstartMeasurementUpdates() => Promise<void>\n```\n\nStart emitting `measurement` events.\n\nOnly available on Android.\n\n**Since:** 0.1.0\n\n--------------------\n\n\n### stopMeasurementUpdates()\n\n```typescript\nstopMeasurementUpdates() => Promise<void>\n```\n\nStop emitting `measurement` events.\n\nOnly available on Android.\n\n**Since:** 0.1.0\n\n--------------------\n\n\n### addListener('measurement', ...)\n\n```typescript\naddListener(eventName: 'measurement', listenerFunc: (event: MeasurementEvent) => void) => Promise<PluginListenerHandle>\n```\n\nCalled when a new measurement is available.\n\nOnly available on Android.\n\n| Param              | Type                                                                    |\n| ------------------ | ----------------------------------------------------------------------- |\n| **`eventName`**    | <code>'measurement'</code>                                              |\n| **`listenerFunc`** | <code>(event: <a href=\"#measurement\">Measurement</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#### Measurement\n\n| Prop              | Type                | Description                          | Since |\n| ----------------- | ------------------- | ------------------------------------ | ----- |\n| **`illuminance`** | <code>number</code> | The ambient light level in lux (lx). | 0.1.0 |\n\n\n#### IsAvailableResult\n\n| Prop            | Type                 | Description                                                  | Since |\n| --------------- | -------------------- | ------------------------------------------------------------ | ----- |\n| **`available`** | <code>boolean</code> | Whether the ambient light sensor is available on the device. | 0.1.0 |\n\n\n#### PluginListenerHandle\n\n| Prop         | Type                                      |\n| ------------ | ----------------------------------------- |\n| **`remove`** | <code>() =&gt; Promise&lt;void&gt;</code> |\n\n\n### Type Aliases\n\n\n#### GetMeasurementResult\n\n<code><a href=\"#measurement\">Measurement</a></code>\n\n\n#### MeasurementEvent\n\n<code><a href=\"#measurement\">Measurement</a></code>\n\n</docgen-api>\n\n## FAQ\n\n### How is this plugin different from other similar plugins?\n\nIt reads the Android ambient light sensor in lux through a fully typed API, offering both a one-time reading and continuous real-time `measurement` events, plus an availability check so you can gracefully handle devices without the sensor. It pairs naturally with the Screen Brightness plugin for adaptive theming and brightness control, and is kept current with the latest Capacitor version. If a rough light signal is enough, screen brightness may cover it; if you need true illuminance values in lux, this plugin is built for exactly that.\n\n### Why is this plugin not available on iOS?\n\niOS does not provide a public API to read the ambient light sensor, so the plugin is not implemented on this platform. The closest available signal is the screen brightness, which you can read using the [Screen Brightness](https://capawesome.io/docs/sdks/capacitor/screen-brightness/) plugin.\n\n### What unit are the measurements in?\n\nThe `illuminance` property of a measurement contains the ambient light level in lux (lx).\n\n### How do I know if the device has a light sensor?\n\nCall the `isAvailable()` method, which returns whether the ambient light sensor is available on the device. It is recommended to check this before calling the other methods.\n\n### What is the difference between `getMeasurement` and the `measurement` event?\n\nThe `getMeasurement()` method returns the most recent measurement from the ambient light sensor as a one-time value. The `measurement` event, in combination with `startMeasurementUpdates()`, delivers continuous real-time measurements until you call `stopMeasurementUpdates()`. See the [usage examples](#usage) above.\n\n### Do I need any permissions or configuration on Android?\n\nNo permissions are required. However, if you are using Proguard, you need to add a keep rule for the plugin classes to your `proguard-rules.pro` file, as described in the [Installation](#installation) section.\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- [Accelerometer](https://capawesome.io/docs/sdks/capacitor/accelerometer/): Capture the acceleration force along the x, y, and z axes.\n- [Barometer](https://capawesome.io/docs/sdks/capacitor/barometer/): Obtain the static air pressure in hectopascals (hPa).\n- [Proximity Sensor](https://capawesome.io/docs/sdks/capacitor/proximity-sensor/): Read the device's proximity sensor.\n- [Screen Brightness](https://capawesome.io/docs/sdks/capacitor/screen-brightness/): Read and control the screen brightness.\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/light-sensor/CHANGELOG.md).\n\n## License\n\nSee [LICENSE](https://github.com/capawesome-team/capacitor-plugins/blob/main/packages/light-sensor/LICENSE).\n","readmeFilename":"README.md"}