npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@capgo/capacitor-proximity

v8.1.2

Published

Capacitor plugin for enabling proximity monitoring in mobile apps.

Readme

@capgo/capacitor-proximity

Capacitor plugin for enabling proximity monitoring in mobile apps.

Why this plugin

This plugin wraps the native proximity APIs used by iOS and Android so a Capacitor app can:

  • Enable proximity monitoring when a screen should react to the user's face or hand.
  • Disable it cleanly when the flow ends.
  • Check whether the current device supports the sensor.
  • Read the plugin version from native code.

On iOS, the plugin forwards directly to UIDevice.isProximityMonitoringEnabled. On Android, it listens to the device proximity sensor and dims the active app window while the sensor is covered.

Platform support

| Platform | Support | |----------|---------| | iOS | ✅ Uses native proximity monitoring | | Android | ✅ Uses Sensor.TYPE_PROXIMITY and dims the current app window | | Web | ❌ Not available |

Compatibility

| Plugin version | Capacitor compatibility | Maintained | | -------------- | ----------------------- | ---------- | | v8.. | v8.. | ✅ | | v7.. | v7.. | On demand | | v6.. | v6.. | ❌ | | v5.. | v5.. | ❌ |

The plugin major version follows the Capacitor major version.

Install

bun add @capgo/capacitor-proximity
bunx cap sync

Usage

import { CapacitorProximity } from '@capgo/capacitor-proximity';

const status = await CapacitorProximity.getStatus();

if (status.available) {
  await CapacitorProximity.enable();

  // ...run your near-ear or face-down flow...

  await CapacitorProximity.disable();
}

Notes

  • Test on a real device. Simulators and most desktop browsers do not expose a proximity sensor.
  • On Android, the plugin only affects the current app window. It does not control the full system display outside your app.
  • On iOS, Apple controls the exact screen-off behavior once proximity monitoring is enabled.

Example app

The example-app/ folder contains a small Vite demo for checking status, enabling the plugin, disabling it, and reading the native version.

API

Capacitor plugin for enabling proximity monitoring in mobile apps.

enable()

enable() => Promise<void>

Enable proximity monitoring.

On iOS this enables UIDevice.isProximityMonitoringEnabled. On Android this starts listening to TYPE_PROXIMITY and dims the current app window while the sensor is covered.

Since: 0.0.1


disable()

disable() => Promise<void>

Disable proximity monitoring.

This restores the default app window behavior and stops sensor monitoring.

Since: 0.0.1


getStatus()

getStatus() => Promise<ProximityStatusResult>

Get the current sensor availability and plugin enabled state.

Returns: Promise<ProximityStatusResult>

Since: 0.0.1


getPluginVersion()

getPluginVersion() => Promise<PluginVersionResult>

Get the current native plugin version.

Returns: Promise<PluginVersionResult>

Since: 0.0.1


Interfaces

ProximityStatusResult

Result returned by getStatus().

| Prop | Type | Description | Since | | --------------- | ---------------------------------------- | ---------------------------------------------------------------- | ----- | | available | boolean | Whether the current device exposes a usable proximity sensor. | 0.0.1 | | enabled | boolean | Whether proximity monitoring is currently enabled by the plugin. | 0.0.1 | | platform | 'ios' | 'android' | 'web' | Platform label returned by the native or web implementation. | 0.0.1 |

PluginVersionResult

Result returned when requesting the plugin version.

| Prop | Type | Description | Since | | ------------- | ------------------- | ----------------------------- | ----- | | version | string | Native plugin version string. | 0.0.1 |