---
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/plugins/accelerometer.png
---

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

[ 🎉 Introducing **Capawesome Platform** — one platform for Live Updates, Native Builds, App Store Publishing, and Insider SDKs.](https://capawesome.io) 

* [  iOS ](#ios)
* [  Usage ](#usage)
* [  API ](#api)
* [  Type Aliases ](#type-aliases)
* [  Changelog ](#changelog)
* [  Breaking Changes ](#breaking-changes)
* [  License ](#license)
* [  Age Signals ](/docs/plugins/age-signals/)
* [  Android Battery Optimization ](/docs/plugins/android-battery-optimization/)
* [  Android Dark Mode Support ](/docs/plugins/android-dark-mode-support/)
* [  Android Edge-to-Edge Support ](/docs/plugins/android-edge-to-edge-support/)
* [  Android Foreground Service ](/docs/plugins/android-foreground-service/)
* [  App Review ](/docs/plugins/app-review/)
* [  App Shortcuts ](/docs/plugins/app-shortcuts/)
* [  App Update ](/docs/plugins/app-update/)
* [  Apple Sign-In ](/docs/plugins/apple-sign-in/)
* [  Asset Manager ](/docs/plugins/asset-manager/)
* [  Audio Player ](/docs/plugins/audio-player/)
* [  Audio Recorder ](/docs/plugins/audio-recorder/)
* [  Background Task ](/docs/plugins/background-task/)
* [  Badge ](/docs/plugins/badge/)
* [  Barometer ](/docs/plugins/barometer/)
* [  Biometrics ](/docs/plugins/biometrics/)
* [  Bluetooth Low Energy ](/docs/plugins/bluetooth-low-energy/)
* [  Cloudinary ](/docs/plugins/cloudinary/)
* [  Contacts ](/docs/plugins/contacts/)
* [  Datetime Picker ](/docs/plugins/datetime-picker/)
* [  File Compressor ](/docs/plugins/file-compressor/)
* [  File Opener ](/docs/plugins/file-opener/)
* [  File Picker ](/docs/plugins/file-picker/)
* [  Firebase ](/docs/plugins/firebase/)
* [  Formbricks ](/docs/plugins/formbricks/)
* [  Geocoder ](/docs/plugins/geocoder/)
* [  Google Sign-In ](/docs/plugins/google-sign-in/)
* [  Grafana Faro ](/docs/plugins/grafana-faro/)
* [  libSQL ](/docs/plugins/libsql/)
* [  Live Update ](/docs/plugins/live-update/)
* [  Managed Configurations ](/docs/plugins/managed-configurations/)
* [  Media Session ](/docs/plugins/media-session/)
* [  ML Kit ](/docs/plugins/mlkit/)
* [  Navigation Bar ](/docs/plugins/navigation-bar/)
* [  NFC ](/docs/plugins/nfc/)
* [  OAuth ](/docs/plugins/oauth/)
* [  Pedometer ](/docs/plugins/pedometer/)
* [  Photo Editor ](/docs/plugins/photo-editor/)
* [  PostHog ](/docs/plugins/posthog/)
* [  Printer ](/docs/plugins/printer/)
* [  Purchases ](/docs/plugins/purchases/)
* [  RealtimeKit ](/docs/plugins/realtimekit/)
* [  Screen Orientation ](/docs/plugins/screen-orientation/)
* [  Screenshot ](/docs/plugins/screenshot/)
* [  Secure Preferences ](/docs/plugins/secure-preferences/)
* [  Speech Recognition ](/docs/plugins/speech-recognition/)
* [  Speech Synthesis ](/docs/plugins/speech-synthesis/)
* [  Share Target ](/docs/plugins/share-target/)
* [  Square Mobile Payments ](/docs/plugins/square-mobile-payments/)
* [  SQLite ](/docs/plugins/sqlite/)
* [  Superwall ](/docs/plugins/superwall/)
* [  Torch ](/docs/plugins/torch/)
* [  Wifi ](/docs/plugins/wifi/)
* [  Zip ](/docs/plugins/zip/)
* [  Cloud ](/docs/cloud/)
* [  Live Updates ](/docs/cloud/live-updates/)
* Advanced
* Integrations
* [  Native Builds ](/docs/cloud/native-builds/)
* [  Configuration ](/docs/cloud/native-builds/configuration/)
* [  Environments ](/docs/cloud/native-builds/environments/)
* Guides
* [  Sample Projects ](/docs/cloud/native-builds/sample-projects/)
* [  Troubleshooting ](/docs/cloud/native-builds/troubleshooting/)
* [  Automations ](/docs/cloud/automations/)
* [  Assist ](/docs/cloud/assist/)
* Account
* Organizations
* [  Organization and User Management ](/docs/cloud/organizations/memberships/)
* [  Single Sign-On (SSO) ](/docs/cloud/organizations/sso/)
* [  Teams ](/docs/cloud/organizations/teams/)
* [  Two-Factor Authentication ](/docs/cloud/organizations/two-factor-authentication/)
* [  Integrations ](/docs/cloud/integrations/)
* [  License Keys ](/docs/cloud/license-keys/)
* [  Webhooks ](/docs/cloud/webhooks/)
* [  Pricing ](https://capawesome.io/pricing/)
* [  FAQ ](/docs/cloud/faq/)
* [  Support ](/docs/cloud/support/)
* [  Contributing ](/docs/contributing/)
* [  LLMs ](/docs/llms/)
* [  Insiders ](/docs/insiders/)
* [  License ](https://capawesome.io/legal/eula/)
* [  Support ](/docs/insiders/support/)
* [  FAQ ](/docs/insiders/faq/)
* [  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 