
Security News
GitHub Actions Adds cache-mode to Limit Cache Poisoning Risk
GitHub Actions now supports cache-mode, a least-privilege control on the Actions cache aimed at the cache poisoning technique behind recent compromises.
@capgo/capacitor-accelerometer
Advanced tools
Access raw accelerometer measurements across iOS, Android, and the Web.
The only free and maintained Capacitor plugin for accelerometer access. Other plugins are either paid or no longer updated. This plugin provides:
Perfect for fitness apps, games, gesture detection, and motion-based interfaces.
The most complete doc is available here: https://capgo.app/docs/plugins/accelerometer/
| Plugin version | Capacitor compatibility | Maintained |
|---|---|---|
| v8.*.* | v8.*.* | ✅ |
| v7.*.* | v7.*.* | On demand |
| v6.*.* | v6.*.* | ❌ |
| v5.*.* | v5.*.* | ❌ |
Note: The major version of this plugin follows the major version of Capacitor. Use the version that matches your Capacitor installation (e.g., plugin v8 for Capacitor 8). Only the latest major version is actively maintained.
You can use our AI-Assisted Setup to install the plugin. Add the Capgo skills to your AI tool using the following command:
npx skills add https://github.com/cap-go/capacitor-skills --skill capacitor-plugins
Then use the following prompt:
Use the `capacitor-plugins` skill from `cap-go/capacitor-skills` to install the `@capgo/capacitor-accelerometer` plugin in my project.
If you prefer Manual Setup, install the plugin by running the following commands and follow the platform-specific instructions below:
npm install @capgo/capacitor-accelerometer
npx cap sync
Add the following to your app's Info.plist. iOS requires this key before the Motion & Fitness permission dialog can appear:
<key>NSMotionUsageDescription</key>
<string>We need access to motion data to read accelerometer measurements</string>
Then call requestPermissions() (or start measurement updates) to trigger the system prompt.
No additional configuration is required. Android does not expose a dedicated runtime permission for raw accelerometer access on supported devices.
getMeasurement()isAvailable()startMeasurementUpdates()stopMeasurementUpdates()checkPermissions()requestPermissions()addListener('measurement', ...)removeAllListeners()getPluginVersion()Capacitor plugin contract for working with the device accelerometer.
getMeasurement() => Promise<GetMeasurementResult>
Get the most recent accelerometer sample that was recorded by the native layer.
Returns: Promise<Measurement>
Since: 1.0.0
isAvailable() => Promise<IsAvailableResult>
Check if the current device includes an accelerometer sensor.
Returns: Promise<IsAvailableResult>
Since: 1.0.0
startMeasurementUpdates() => Promise<void>
Begin streaming accelerometer updates to the JavaScript layer.
Call {@link addListener} with the measurement event to receive the updates.
Since: 1.0.0
stopMeasurementUpdates() => Promise<void>
Stop streaming accelerometer updates started via {@link startMeasurementUpdates}.
Since: 1.0.0
checkPermissions() => Promise<PermissionStatus>
Return the current permission state for accessing motion data.
On platforms without explicit permissions this resolves to granted.
Returns: Promise<PermissionStatus>
Since: 1.0.0
requestPermissions() => Promise<PermissionStatus>
Request permission to access motion data if supported by the platform.
Returns: Promise<PermissionStatus>
Since: 1.0.0
addListener(eventName: 'measurement', listenerFunc: (event: MeasurementEvent) => void) => Promise<PluginListenerHandle>
Listen for measurement updates.
| Param | Type | Description |
|---|---|---|
eventName | 'measurement' | Only the measurement event is supported. |
listenerFunc | (event: Measurement) => void | Callback invoked with each measurement. |
Returns: Promise<PluginListenerHandle>
Since: 1.0.0
removeAllListeners() => Promise<void>
Remove all listeners that have been registered on the plugin.
Since: 1.0.0
getPluginVersion() => Promise<{ version: string; }>
Get the native Capacitor plugin version.
Returns: Promise<{ version: string; }>
Since: 1.0.0
The x, y and z axis acceleration values reported by the device motion sensors.
| Prop | Type | Description | Since |
|---|---|---|---|
x | number | The acceleration on the x-axis in G's. | 1.0.0 |
y | number | The acceleration on the y-axis in G's. | 1.0.0 |
z | number | The acceleration on the z-axis in G's. | 1.0.0 |
Result returned by {@link CapacitorAccelerometerPlugin.isAvailable}.
| Prop | Type | Description | Since |
|---|---|---|---|
isAvailable | boolean | Whether an accelerometer sensor is available on the device. | 1.0.0 |
Permission information returned by {@link CapacitorAccelerometerPlugin.checkPermissions} and {@link CapacitorAccelerometerPlugin.requestPermissions}.
| Prop | Type | Description | Since |
|---|---|---|---|
accelerometer | AccelerometerPermissionState | The permission state for accessing motion data on the current platform. | 1.0.0 |
| Prop | Type |
|---|---|
remove | () => Promise<void> |
Alias for the most recent measurement.
Permission state union including limited for platforms that can throttle motion access.
PermissionState | 'limited'
'prompt' | 'prompt-with-rationale' | 'granted' | 'denied'
Event payload emitted when {@link CapacitorAccelerometerPlugin.startMeasurementUpdates} is active.
This plugin was inspired from: https://github.com/kesha-antonov/react-native-background-downloader
FAQs
Read device accelerometer measurements with Capacitor
The npm package @capgo/capacitor-accelerometer receives a total of 14,836 weekly downloads. As such, @capgo/capacitor-accelerometer popularity was classified as popular.
We found that @capgo/capacitor-accelerometer demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.

Security News
GitHub Actions now supports cache-mode, a least-privilege control on the Actions cache aimed at the cache poisoning technique behind recent compromises.

Company News
Allow myself to introduce... myself.

Research
/Security News
A Twitch browser extension on Chrome and Firefox forwards users’ live OAuth session tokens through proxies controlled by a Russian bot service.