---
description: Capacitor plugin to capture the acceleration force along the x, y, and z axes. Available for Android, iOS, and Web.
title: Capacitor Accelerometer Plugin for Android, iOS & Web - Capawesome
image: https://capawesome.io/docs/assets/images/social/sdks/capacitor/accelerometer.png
---

[ Skip to content](#capawesome-teamcapacitor-accelerometer) 

[ 🔐 Introducing the **Capacitor Vault** plugin — store secrets behind biometrics or a device passcode.](/blog/announcing-the-capacitor-vault-plugin/) 

* [  SDKs ](/docs/sdks/)
* [  iOS ](#ios)
* [  Usage ](#usage)
* [  API ](#api)
* [  Type Aliases ](#type-aliases)
* [  Changelog ](#changelog)
* [  Breaking Changes ](#breaking-changes)
* [  License ](#license)
* [  Age Signals ](/docs/sdks/capacitor/age-signals/)
* [  Android Battery Optimization ](/docs/sdks/capacitor/android-battery-optimization/)
* [  Android Dark Mode Support ](/docs/sdks/capacitor/android-dark-mode-support/)
* [  Android Edge-to-Edge Support ](/docs/sdks/capacitor/android-edge-to-edge-support/)
* [  Android Foreground Service ](/docs/sdks/capacitor/android-foreground-service/)
* [  App Review ](/docs/sdks/capacitor/app-review/)
* [  App Shortcuts ](/docs/sdks/capacitor/app-shortcuts/)
* [  App Update ](/docs/sdks/capacitor/app-update/)
* [  Apple Sign-In ](/docs/sdks/capacitor/apple-sign-in/)
* [  Asset Manager ](/docs/sdks/capacitor/asset-manager/)
* [  Audio Player ](/docs/sdks/capacitor/audio-player/)
* [  Audio Recorder ](/docs/sdks/capacitor/audio-recorder/)
* [  Background Task ](/docs/sdks/capacitor/background-task/)
* [  Badge ](/docs/sdks/capacitor/badge/)
* [  Barometer ](/docs/sdks/capacitor/barometer/)
* [  Biometrics ](/docs/sdks/capacitor/biometrics/)
* [  Bluetooth Low Energy ](/docs/sdks/capacitor/bluetooth-low-energy/)
* [  Cloudinary ](/docs/sdks/capacitor/cloudinary/)
* [  Contacts ](/docs/sdks/capacitor/contacts/)
* [  Datetime Picker ](/docs/sdks/capacitor/datetime-picker/)
* [  File Compressor ](/docs/sdks/capacitor/file-compressor/)
* [  File Opener ](/docs/sdks/capacitor/file-opener/)
* [  File Picker ](/docs/sdks/capacitor/file-picker/)
* [  Firebase ](/docs/sdks/capacitor/firebase/)
* [  Formbricks ](/docs/sdks/capacitor/formbricks/)
* [  Geocoder ](/docs/sdks/capacitor/geocoder/)
* [  Google Sign-In ](/docs/sdks/capacitor/google-sign-in/)
* [  Grafana Faro ](/docs/sdks/capacitor/grafana-faro/)
* [  libSQL ](/docs/sdks/capacitor/libsql/)
* [  Live Update ](/docs/sdks/capacitor/live-update/)
* [  Managed Configurations ](/docs/sdks/capacitor/managed-configurations/)
* [  Media Session ](/docs/sdks/capacitor/media-session/)
* [  ML Kit ](/docs/sdks/capacitor/mlkit/)
* [  Navigation Bar ](/docs/sdks/capacitor/navigation-bar/)
* [  NFC ](/docs/sdks/capacitor/nfc/)
* [  OAuth ](/docs/sdks/capacitor/oauth/)
* [  Pedometer ](/docs/sdks/capacitor/pedometer/)
* [  Photo Editor ](/docs/sdks/capacitor/photo-editor/)
* [  PostHog ](/docs/sdks/capacitor/posthog/)
* [  Printer ](/docs/sdks/capacitor/printer/)
* [  Purchases ](/docs/sdks/capacitor/purchases/)
* [  RealtimeKit ](/docs/sdks/capacitor/realtimekit/)
* [  Screen Orientation ](/docs/sdks/capacitor/screen-orientation/)
* [  Screenshot ](/docs/sdks/capacitor/screenshot/)
* [  Secure Preferences ](/docs/sdks/capacitor/secure-preferences/)
* [  Speech Recognition ](/docs/sdks/capacitor/speech-recognition/)
* [  Speech Synthesis ](/docs/sdks/capacitor/speech-synthesis/)
* [  Share Target ](/docs/sdks/capacitor/share-target/)
* [  Square Mobile Payments ](/docs/sdks/capacitor/square-mobile-payments/)
* [  SQLite ](/docs/sdks/capacitor/sqlite/)
* [  Superwall ](/docs/sdks/capacitor/superwall/)
* [  Torch ](/docs/sdks/capacitor/torch/)
* [  Vault ](/docs/sdks/capacitor/vault/)
* [  Wifi ](/docs/sdks/capacitor/wifi/)
* [  Zip ](/docs/sdks/capacitor/zip/)
* [  Cordova ](/docs/sdks/cordova/)
* [  Cloud ](/docs/cloud/)
* [  Integrations ](/docs/cloud/live-updates/integrations/)
* Concepts
* Reference
* [  Troubleshooting ](/docs/cloud/live-updates/troubleshooting/)
* [  FAQ ](/docs/cloud/live-updates/faq/)
* [  Native Builds ](/docs/cloud/native-builds/)
* [  Set Up Environments ](/docs/cloud/native-builds/environments/)
* [  Overwrite Native Configurations ](/docs/cloud/native-builds/native-configurations/)
* [  Auto-Increment Build Numbers ](/docs/cloud/native-builds/auto-incrementing-build-numbers/)
* [  Configure the Web Build Script ](/docs/cloud/native-builds/web-build-script/)
* [  Build from a Monorepo ](/docs/cloud/native-builds/monorepo/)
* [  Use pnpm or Yarn ](/docs/cloud/native-builds/package-managers/)
* [  Install Private npm Packages ](/docs/cloud/native-builds/npm-private-registry/)
* [  Override the Java Version ](/docs/cloud/native-builds/override-java-version/)
* [  Custom iOS Provisioning Profiles ](/docs/cloud/native-builds/custom-ios-provisioning-profiles/)
* [  Build without Git ](/docs/cloud/native-builds/build-without-git/)
* [  Access Git Behind a Firewall ](/docs/cloud/native-builds/firewall-access/)
* [  Integrations ](/docs/cloud/native-builds/integrations/)
* Reference
* [  Troubleshooting ](/docs/cloud/native-builds/troubleshooting/)
* [  FAQ ](/docs/cloud/native-builds/faq/)
* [  App Store Publishing ](/docs/cloud/app-store-publishing/)
* [  Submit a Build ](/docs/cloud/app-store-publishing/submit-a-build/)
* [  Submit Automatically After a Build ](/docs/cloud/app-store-publishing/submit-automatically/)
* [  Troubleshooting ](/docs/cloud/app-store-publishing/troubleshooting/)
* [  FAQ ](/docs/cloud/app-store-publishing/faq/)
* [  Automations ](/docs/cloud/automations/)
* [  Reference ](/docs/cloud/automations/reference/)
* [  Troubleshooting ](/docs/cloud/automations/troubleshooting/)
* [  FAQ ](/docs/cloud/automations/faq/)
* [  Assist ](/docs/cloud/assist/)
* [  CLI ](/docs/cloud/cli/)
* APIs and SDKs
* [  Webhooks ](/docs/cloud/webhooks/)
* [  Integrations ](/docs/cloud/integrations/)
* Account
* [  Organization ](/docs/cloud/organizations/)
* [  Two-Factor Enforcement ](/docs/cloud/organizations/two-factor-authentication/)
* [  Audit Logs ](/docs/cloud/organizations/audit-logs/)
* [  Billing ](/docs/cloud/organizations/billing/)
* [  License Keys ](/docs/cloud/license-keys/)
* [  AI ](/docs/ai/)
* [  Insiders ](/docs/insiders/)
* [  Billing & Plans ](/docs/insiders/billing-and-plans/)
* [  FAQ ](/docs/insiders/faq/)
* [  License ](https://capawesome.io/legal/eula/)
* [  Support ](/docs/support/)
* [  Contributing ](/docs/contributing/)
* Contributing code
* [  Code of Conduct ](/docs/contributing/code-of-conduct/)
* [  Questions ](https://docs.github.com/en/discussions/collaborating-with-your-community-using-discussions/participating-in-a-discussion#creating-a-discussion)
* [  Blog ](/blog/)
* Categories

* [  iOS ](#ios)
* [  Usage ](#usage)
* [  API ](#api)
* [  Type Aliases ](#type-aliases)
* [  Changelog ](#changelog)
* [  Breaking Changes ](#breaking-changes)
* [  License ](#license)

# @capawesome-team/capacitor-accelerometer[¶](#capawesome-teamcapacitor-accelerometer "Permanent link")

Capacitor plugin to capture the acceleration force along the x, y, and z axes.

[ ![Deliver Live Updates to your Capacitor app with Capawesome Cloud](../../../assets/external/cloud.capawesome.io/assets/banners/cloud-build-and-deploy-capacitor-apps.69628c3f.png) ](https://cloud.capawesome.io/) 

## Features[¶](#features "Permanent link")

We are proud to offer one of the most complete and feature-rich Capacitor plugins for accelerometer measurements. Here are some of the key features:

* 🖥️ **Cross-platform**: Supports Android and iOS.
* ⚡ **Real-time measurements**: Continuous accelerometer data with event listeners.
* 📊 **High precision**: Accurate x, y, and z-axis acceleration measurements in G's.
* 🔒 **Permission handling**: Built-in permission management for sensor access.
* 📦 **CocoaPods & SPM**: Supports CocoaPods and Swift Package Manager for iOS.
* 🔁 **Up-to-date**: Always supports the latest Capacitor version.
* ⭐️ **Support**: Priority support from the Capawesome Team.
* ✨ **Handcrafted**: Built from the ground up with care and expertise, not forked or AI-generated.

Missing a feature? Just [open an issue](https://github.com/capawesome-team/capacitor-plugins/issues) and we'll take a look!

## Newsletter[¶](#newsletter "Permanent link")

Stay 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/).

## Compatibility[¶](#compatibility "Permanent link")

| Plugin Version | Capacitor Version | Status         |
| -------------- | ----------------- | -------------- |
| 8.x.x          | \>=8.x.x          | Active support |
| 0.1.x          | 7.x.x             | Deprecated     |

## Installation[¶](#installation "Permanent link")

This plugin is only available to [Capawesome Insiders](https://capawesome.io/insiders/). First, make sure you have the Capawesome npm registry set up. You can do this by running the following commands:

`[](#%5F%5Fcodelineno-0-1)npm config set @capawesome-team:registry https://npm.registry.capawesome.io
[](#%5F%5Fcodelineno-0-2)npm config set //npm.registry.capawesome.io/:_authToken <YOUR_LICENSE_KEY>
`

**Attention**: Replace `<YOUR_LICENSE_KEY>` with the license key you received from Polar. If you don't have a license key yet, you can get one by becoming a [Capawesome Insider](https://capawesome.io/insiders/).

Next, you can use our **AI-Assisted Setup** to install the plugin. Add the [Capawesome Skills](https://github.com/capawesome-team/skills) to your AI tool using the following command:

`[](#%5F%5Fcodelineno-1-1)npx skills add capawesome-team/skills --skill capacitor-plugins
`

Then use the following prompt:

`` [](#%5F%5Fcodelineno-2-1)Use the `capacitor-plugins` skill from `capawesome-team/skills` to install the `@capawesome-team/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:

`[](#%5F%5Fcodelineno-3-1)npm install @capawesome-team/capacitor-accelerometer
[](#%5F%5Fcodelineno-3-2)npx cap sync
`

### Android[¶](#android "Permanent link")

#### Proguard[¶](#proguard "Permanent link")

If you are using Proguard, you need to add the following rules to your `proguard-rules.pro` file:

`[](#%5F%5Fcodelineno-4-1)-keep class io.capawesome.capacitorjs.plugins.** { *; }
`

### iOS[¶](#ios "Permanent link")

#### Privacy Descriptions[¶](#privacy-descriptions "Permanent link")

Add the `NSMotionUsageDescription` key to the `ios/App/App/Info.plist` file, which tells the user why your app needs access to the user's contacts:

`[](#%5F%5Fcodelineno-5-1)<key>NSMotionUsageDescription</key>
[](#%5F%5Fcodelineno-5-2)<string>The app needs to access the motion activity.</string>
`

## Usage[¶](#usage "Permanent link")

`[](#%5F%5Fcodelineno-6-1)import { Accelerometer } from '@capawesome-team/capacitor-accelerometer';
[](#%5F%5Fcodelineno-6-2)
[](#%5F%5Fcodelineno-6-3)const getMeasurement = async () => {
[](#%5F%5Fcodelineno-6-4)  const measurement = await Accelerometer.getMeasurement();
[](#%5F%5Fcodelineno-6-5)  console.log("X: ", measurement.x);
[](#%5F%5Fcodelineno-6-6)  console.log("Y: ", measurement.y);
[](#%5F%5Fcodelineno-6-7)  console.log("Z: ", measurement.z);
[](#%5F%5Fcodelineno-6-8)};
[](#%5F%5Fcodelineno-6-9)
[](#%5F%5Fcodelineno-6-10)const isAvailable = async () => {
[](#%5F%5Fcodelineno-6-11)  const result = await Accelerometer.isAvailable();
[](#%5F%5Fcodelineno-6-12)  return result.isAvailable;
[](#%5F%5Fcodelineno-6-13)};
[](#%5F%5Fcodelineno-6-14)
[](#%5F%5Fcodelineno-6-15)const startMeasurementUpdates = async () => {
[](#%5F%5Fcodelineno-6-16)  await Accelerometer.startMeasurementUpdates();
[](#%5F%5Fcodelineno-6-17)};
[](#%5F%5Fcodelineno-6-18)
[](#%5F%5Fcodelineno-6-19)const stopMeasurementUpdates = async () => {
[](#%5F%5Fcodelineno-6-20)  await Accelerometer.stopMeasurementUpdates();
[](#%5F%5Fcodelineno-6-21)};
[](#%5F%5Fcodelineno-6-22)
[](#%5F%5Fcodelineno-6-23)const checkPermissions = async () => {
[](#%5F%5Fcodelineno-6-24)  const result = await Accelerometer.checkPermissions();
[](#%5F%5Fcodelineno-6-25)  return result;
[](#%5F%5Fcodelineno-6-26)};
[](#%5F%5Fcodelineno-6-27)
[](#%5F%5Fcodelineno-6-28)const requestPermissions = async () => {
[](#%5F%5Fcodelineno-6-29)  const result = await Accelerometer.requestPermissions();
[](#%5F%5Fcodelineno-6-30)  return result;
[](#%5F%5Fcodelineno-6-31)};
[](#%5F%5Fcodelineno-6-32)
[](#%5F%5Fcodelineno-6-33)const removeAllListeners = async () => {
[](#%5F%5Fcodelineno-6-34)  await Accelerometer.removeAllListeners();
[](#%5F%5Fcodelineno-6-35)};
`

## API[¶](#api "Permanent link")

* [getMeasurement()](#getmeasurement)
* [isAvailable()](#isavailable)
* [startMeasurementUpdates()](#startmeasurementupdates)
* [stopMeasurementUpdates()](#stopmeasurementupdates)
* [checkPermissions()](#checkpermissions)
* [requestPermissions()](#requestpermissions)
* [addListener('measurement', ...)](#addlistenermeasurement-)
* [removeAllListeners()](#removealllisteners)
* [Interfaces](#interfaces)
* [Type Aliases](#type-aliases)

### getMeasurement()[¶](#getmeasurement "Permanent link")

`[](#%5F%5Fcodelineno-7-1)getMeasurement() => Promise<GetMeasurementResult>
`

Get the latest measurement.

This method returns the most recent measurement from the accelerometer sensor.

**Returns:** `Promise<[Measurement](#measurement)>`

**Since:** 0.1.0

---

### isAvailable()[¶](#isavailable "Permanent link")

`[](#%5F%5Fcodelineno-8-1)isAvailable() => Promise<IsAvailableResult>
`

Check if the accelerometer sensor is available on the device.

**Returns:** `Promise<[IsAvailableResult](#isavailableresult)>`

**Since:** 0.1.0

---

### startMeasurementUpdates()[¶](#startmeasurementupdates "Permanent link")

`[](#%5F%5Fcodelineno-9-1)startMeasurementUpdates() => Promise<void>
`

Starts emitting `measurement` events.

**Since:** 0.1.0

---

### stopMeasurementUpdates()[¶](#stopmeasurementupdates "Permanent link")

`[](#%5F%5Fcodelineno-10-1)stopMeasurementUpdates() => Promise<void>
`

Stops emitting `measurement` events.

**Since:** 0.1.0

---

### checkPermissions()[¶](#checkpermissions "Permanent link")

`[](#%5F%5Fcodelineno-11-1)checkPermissions() => Promise<PermissionStatus>
`

Check if the app has permission to access the accelerometer sensor.

**Returns:** `Promise<[PermissionStatus](#permissionstatus)>`

**Since:** 0.1.0

---

### requestPermissions()[¶](#requestpermissions "Permanent link")

`[](#%5F%5Fcodelineno-12-1)requestPermissions() => Promise<PermissionStatus>
`

Request permission to access the accelerometer sensor.

**Returns:** `Promise<[PermissionStatus](#permissionstatus)>`

**Since:** 0.1.0

---

### addListener('measurement', ...)[¶](#addlistenermeasurement "Permanent link")

`[](#%5F%5Fcodelineno-13-1)addListener(eventName: 'measurement', listenerFunc: (event: MeasurementEvent) => void) => Promise<PluginListenerHandle>
`

Only available on Android and iOS.

| Param            | Type                                         |
| ---------------- | -------------------------------------------- |
| **eventName**    | 'measurement'                                |
| **listenerFunc** | (event: [Measurement](#measurement)) => void |

**Returns:** `Promise<[PluginListenerHandle](#pluginlistenerhandle)>`

**Since:** 0.1.0

---

### removeAllListeners()[¶](#removealllisteners "Permanent link")

`[](#%5F%5Fcodelineno-14-1)removeAllListeners() => Promise<void>
`

Remove all listeners for this plugin.

**Since:** 0.1.0

---

### Interfaces[¶](#interfaces "Permanent link")

#### Measurement[¶](#measurement "Permanent link")

| Prop  | Type   | Description                                           | Since |
| ----- | ------ | ----------------------------------------------------- | ----- |
| **x** | number | The x-axis acceleration in G's (gravitational force). | 0.1.0 |
| **y** | number | The y-axis acceleration in G's (gravitational force). | 0.1.0 |
| **z** | number | The z-axis acceleration in G's (gravitational force). | 0.1.0 |

#### IsAvailableResult[¶](#isavailableresult "Permanent link")

| Prop            | Type    | Description                                                  | Since |
| --------------- | ------- | ------------------------------------------------------------ | ----- |
| **isAvailable** | boolean | Whether the accelerometer sensor is available on the device. | 0.1.0 |

#### PermissionStatus[¶](#permissionstatus "Permanent link")

| Prop              | Type                                                          | Description                             | Since |
| ----------------- | ------------------------------------------------------------- | --------------------------------------- | ----- |
| **accelerometer** | [AccelerometerPermissionState](#accelerometerpermissionstate) | The permission status of accelerometer. | 0.1.0 |

#### PluginListenerHandle[¶](#pluginlistenerhandle "Permanent link")

| Prop       | Type                |
| ---------- | ------------------- |
| **remove** | () => Promise<void> |

### Type Aliases[¶](#type-aliases "Permanent link")

#### GetMeasurementResult[¶](#getmeasurementresult "Permanent link")

`[Measurement](#measurement)`

#### AccelerometerPermissionState[¶](#accelerometerpermissionstate "Permanent link")

`[PermissionState](#permissionstate) | 'limited'`

#### PermissionState[¶](#permissionstate "Permanent link")

`'prompt' | 'prompt-with-rationale' | 'granted' | 'denied'`

#### MeasurementEvent[¶](#measurementevent "Permanent link")

`[Measurement](#measurement)`

## Changelog[¶](#changelog "Permanent link")

See [CHANGELOG.md](https://github.com/capawesome-team/capacitor-plugins/blob/main/packages/accelerometer/CHANGELOG.md).

## Breaking Changes[¶](#breaking-changes "Permanent link")

See [BREAKING.md](https://github.com/capawesome-team/capacitor-plugins/blob/main/packages/accelerometer/BREAKING.md).

## License[¶](#license "Permanent link")

See [LICENSE](https://github.com/capawesome-team/capacitor-plugins/blob/main/packages/accelerometer/LICENSE).

May 17, 2026 

 Back to top 