Skip to main content
Back to plugins
@capgo/capacitor-barometer
Tutorial
@capgo/capacitor-barometer

Barometer

Access device barometer for atmospheric pressure and altitude readings

Guide

Tutorial on Barometer

Using @capgo/capacitor-barometer

Capacitor plugin contract for working with the device barometer sensor.

Install

bun add @capgo/capacitor-barometer
bunx cap sync

What This Plugin Exposes

  • getMeasurement - Get the most recent barometer reading captured by the native layer.
  • isAvailable - Check if the current device includes a barometer sensor.
  • startMeasurementUpdates - Begin streaming barometer updates to the JavaScript layer.
  • stopMeasurementUpdates - Stop the continuous updates started via .

Example Usage

getMeasurement

Get the most recent barometer reading captured by the native layer.

import { CapacitorBarometer } from '@capgo/capacitor-barometer';

await CapacitorBarometer.getMeasurement();

isAvailable

Check if the current device includes a barometer sensor.

import { CapacitorBarometer } from '@capgo/capacitor-barometer';

await CapacitorBarometer.isAvailable();

startMeasurementUpdates

Begin streaming barometer updates to the JavaScript layer.

import { CapacitorBarometer } from '@capgo/capacitor-barometer';

await CapacitorBarometer.startMeasurementUpdates();

stopMeasurementUpdates

Stop the continuous updates started via .

import { CapacitorBarometer } from '@capgo/capacitor-barometer';

await CapacitorBarometer.stopMeasurementUpdates();

Full Reference

Keep going from Using @capgo/capacitor-barometer

If you are using Using @capgo/capacitor-barometer to plan dashboard and API operations, connect it with @capgo/capacitor-barometer for the implementation detail in @capgo/capacitor-barometer, Getting Started for the implementation detail in Getting Started, API Overview for the implementation detail in API Overview, Introduction for the implementation detail in Introduction, and API Keys for the implementation detail in API Keys.