npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

expo-recording-steps

v0.1.0

Published

Expo compatible wrapper for Android's Recording API

Readme

expo-recording-api

An Expo module that provides access to Android's Recording API for fitness activity data. This module uses Google Fit's Recording API (not the Sensor API) to track fitness metrics even when your app is closed.

Installation

npx expo install expo-recording-api

Requirements

  • Expo SDK 49 or higher
  • Android Oreo (8.0) or higher
  • iOS not supported (see alternatives below)
  • Requires ACTIVITY_RECOGNITION permission
  • Requires Google Play Services

API

checkSupport()

Checks if the Recording API is supported on the device. Always call this before using other methods.

import RecordingAPI, { ConnectionResult } from 'expo-recording-api';

const result = RecordingAPI.checkSupport();
if (result !== ConnectionResult.SUCCESS) {
  console.log('Recording API not supported');
}

requestPermission()

Requests the ACTIVITY_RECOGNITION permission required for accessing fitness data.

await RecordingAPI.requestPermission();

subscribe(type)

Tells Android to record fitness data of the specified type, even when your app is closed or the device is restarted. You must subscribe before querying data.

import RecordingAPI, { LocalDataType } from 'expo-recording-api';

await RecordingAPI.subscribe(LocalDataType.TYPE_STEP_COUNT_DELTA);

Important: Data is only available for the time period after subscribing. If you subscribe and immediately query, you'll get 0 results.

unsubscribe(type)

Stops recording the specified fitness data type. Call this when your app no longer needs to track this data.

await RecordingAPI.unsubscribe(LocalDataType.TYPE_STEP_COUNT_DELTA);

getSamples(options)

Retrieves fitness data within a specified time range. Data is only available if previously subscribed and for the time period after subscription.

import RecordingAPI, { LocalDataType } from 'expo-recording-api';

const steps = await RecordingAPI.getSamples({
  type: LocalDataType.TYPE_STEP_COUNT_DELTA,
  startDate: '2023-01-01T00:00:00.000Z',
  endDate: '2023-01-02T00:00:00.000Z',
  bucketByTime: [1, 'days']
});

Note: The Recording API has a maximum data retention limit of 10 days.

Data Types

  • TYPE_STEP_COUNT_DELTA: Step counts
  • TYPE_DISTANCE_DELTA: Distance traveled
  • TYPE_CALORIES_EXPENDED: Calories burned

Error Handling

import { RecordingApiError } from 'expo-recording-api';

try {
  await RecordingAPI.getSamples({...});
} catch (error) {
  if (error instanceof RecordingApiError) {
    console.log('Error code:', error.code);
  }
}

iOS Alternative

For accessing step data on iOS, consider using:

Note: We plan to merge this functionality into expo-sensors in the future.

License

MIT