README.md

November 4, 2025 ยท View on GitHub

Capacitor plugin for an easy compass using the native device sensors

Install

npm install capacitor-native-compass
npx cap sync

Version compatibility chart

Capacitorcapacitor-native-compass
5.x0.x
6.x6.x
7.x7.x

API

getCurrentHeading()

getCurrentHeading() => Promise<{ value: number; }>

Returns the current compass heading in degrees. On iOS, the heading is updated in the background, and the latest value is returned. On Android, the heading is calculated when the method is called. Not implemented on Web.

Returns: Promise<{ value: number; }>