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

@mgarcialeniolabs/expo-health-kit

v0.1.8

Published

HealthKit integration for Expo apps.

Readme

expo-health-kit

HealthKit integration for Expo apps, focused on step count data.

Installation

expo install expo-health-kit

Configuration

iOS

  1. Open your iOS project's Info.plist file and add the following permissions:
<key>NSHealthShareUsageDescription</key>
<string>This app requires access to your step count data to track your activity.</string>
  1. Enable HealthKit capabilities in your Xcode project:
    • Open your project in Xcode
    • Select your target
    • Go to the "Signing & Capabilities" tab
    • Click "+" and add "HealthKit"

API

isHealthKitAvailable()

Check if HealthKit is available on the current device.

import ExpoHealthKit from "expo-health-kit";

const isAvailable = ExpoHealthKit.isHealthKitAvailable();
console.log(`HealthKit available: ${isAvailable}`);

requestPermissions()

Request permissions for step count data.

import ExpoHealthKit from "expo-health-kit";

// Request permissions for steps
const result = await ExpoHealthKit.requestPermissions();

console.log(`Permission result: ${result.success}`);

getStepCount(startDate, endDate)

Get step count between two dates.

import ExpoHealthKit from "expo-health-kit";

// Get steps for today
const now = new Date();
const startOfDay = new Date(now.setHours(0, 0, 0, 0));
const steps = await ExpoHealthKit.getStepCount(startOfDay, new Date());

console.log(`Steps today: ${steps}`);

Events

onPermissionsResult

Emitted when permission request completes.

import { useEffect } from "react";
import ExpoHealthKit from "expo-health-kit";

useEffect(() => {
  const subscription = ExpoHealthKit.addListener(
    "onPermissionsResult",
    (event) => {
      console.log(`Permission result: ${event.success}`);
    }
  );

  return () => {
    subscription.remove();
  };
}, []);

Example

import React, { useEffect, useState } from "react";
import { StyleSheet, Text, View, Button } from "react-native";
import ExpoHealthKit from "expo-health-kit";

export default function App() {
  const [isAvailable, setIsAvailable] = useState(false);
  const [hasPermissions, setHasPermissions] = useState(false);
  const [steps, setSteps] = useState(0);

  useEffect(() => {
    // Check if HealthKit is available
    const available = ExpoHealthKit.isHealthKitAvailable();
    setIsAvailable(available);
  }, []);

  const requestPermissions = async () => {
    if (!isAvailable) return;

    const result = await ExpoHealthKit.requestPermissions();
    setHasPermissions(result.success);
  };

  const fetchStepData = async () => {
    if (!hasPermissions) return;

    // Get steps for today
    const now = new Date();
    const startOfDay = new Date(now.setHours(0, 0, 0, 0));
    const stepsToday = await ExpoHealthKit.getStepCount(startOfDay, new Date());
    setSteps(stepsToday);
  };

  return (
    <View style={styles.container}>
      <Text>HealthKit Available: {isAvailable ? "Yes" : "No"}</Text>
      <Text>Has Permissions: {hasPermissions ? "Yes" : "No"}</Text>

      <Button
        title="Request Permissions"
        onPress={requestPermissions}
        disabled={!isAvailable}
      />

      <Button
        title="Fetch Step Data"
        onPress={fetchStepData}
        disabled={!hasPermissions}
      />

      <Text>Steps today: {steps}</Text>
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: "#fff",
    alignItems: "center",
    justifyContent: "center",
    padding: 20,
    gap: 10,
  },
});