Passer au contenu

@capgo/capacitor-accelerometer

Access device motion and acceleration data from accelerometer sensors

The Capacitor Accelerometer plugin provides access to device accelerometer sensors, allowing you to read acceleration forces in three dimensions and detect device motion.

Key Features

  • 3-Axis Acceleration - X, Y, Z axis measurements
  • Real-time Updates - Continuous acceleration monitoring
  • Motion Detection - Detect shakes, tilts, and movements
  • Cross-Platform - iOS, Android, and Web support

Installation

Terminal window
npm install @capgo/capacitor-accelerometer
npx cap sync

Platform Support

  • iOS: Full support (all devices)
  • Android: Full support (all devices)
  • Web: Supported via DeviceMotion API

Use Cases

  • Fitness Apps - Track movement and activity
  • Games - Motion-based controls and gestures
  • Navigation - Detect orientation changes
  • Health Monitoring - Fall detection and activity tracking

API Overview

The plugin provides methods to:

  • Start/stop acceleration monitoring
  • Read current acceleration values
  • Configure update intervals
  • Listen to acceleration events

Next Steps

Get started with the Getting Started guide to integrate accelerometer functionality into your Capacitor app.

Resources