iOS · TypeScript · Expo · React Native

Access HealthKit seamlessly.

Type-safe, Promise-based HealthKit bindings for React Native and Expo. Powered by Nitro Modules for exceptional performance.

100+ Quantity Types
63+ Category Types
75+ Workout Types

Three steps to launch

Install

Install the package

Terminal
yarn add @kingstinct/react-native-healthkit

Add the Config Plugin to app.json

app.json
{
  "expo": {
    "plugins": [
      "@kingstinct/react-native-healthkit"
    ]
  }
}
Build a new Dev Client

Authorize

TypeScript · React Native
import { Text, Button, View } from 'react-native'
import { useHealthkitAuthorization } from '@kingstinct/react-native-healthkit'

export default function AuthExample() {
  const [authorizationStatus, requestAuthorization] =
    useHealthkitAuthorization({
      toRead: ['HKQuantityTypeIdentifierBloodGlucose']
    })

  return (
    <View>
      <Text>Authorization Status: {authorizationStatus}</Text>
      <Button
        onPress={requestAuthorization}
        title="Request Authorization"
      />
    </View>
  )
}

Launch

TypeScript · React Native
import { Text, View } from 'react-native'
import { useMostRecentQuantitySample } from '@kingstinct/react-native-healthkit'

export default function BloodGlucoseMonitor() {
  const sample = useMostRecentQuantitySample(
    'HKQuantityTypeIdentifierBloodGlucose'
  )

  return (
    <View>
      <Text>
        Blood Glucose: {sample?.quantity} {sample?.unit}
      </Text>
    </View>
  )
}