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

@healthcloudai/hc-vitals-import-ui

v0.4.0

Published

React Native UI for importing vitals — Apple HealthKit / Google Health Connect sync with offline queue and background sync

Downloads

541

Readme

@healthcloudai/hc-vitals-import-ui

React Native UI for importing vitals from Apple HealthKit (iOS) and Google Health Connect (Android) into the Healthcheck platform. Companion UI package to the @healthcloudai/hc-vitals-import api-connector.

What it does

  1. Checks health data availability on the device (native ImportVitals bridge module, react-native-health, or react-native-health-connect).
  2. Requests read permissions for vitals (heart rate, HRV, blood pressure, SpO₂, temperature, respiratory rate, steps, weight, glucose).
  3. Fetches records since the last sync date (incremental sync).
  4. POSTs the records to the EHR services backend in batches of 50, with exponential-backoff retry on 5xx / network errors.
  5. Queues failed payloads offline and retries them automatically; keeps a sync history; optionally syncs on a background interval.

Install

npm install @healthcloudai/hc-vitals-import-ui \
  @healthcloudai/hc-vitals-import \
  @healthcloudai/hc-login-connector \
  @healthcloudai/hc-http

Optional peers (install the ones your app uses):

  • @react-native-async-storage/async-storage — persistent sync state (falls back to in-memory)
  • @expo/vector-icons — Feather icons (falls back to unicode glyphs)
  • expo-haptics — button haptics (no-op if missing)
  • react-native-health — iOS HealthKit permission prompt
  • react-native-health-connect — Android Health Connect JS fallback

On iOS/Android the package prefers the app's native ImportVitals bridge module (ImportVitals.swift / ImportVitalsModule.kt) when present.

Usage

import {
  useImportVitals,
  ImportVitalsSyncButton,
  ImportVitalsStatusCard,
  ImportVitalsQueueBanner,
  ImportVitalsWebFallback,
} from "@healthcloudai/hc-vitals-import-ui";
import { HCImportVitalsClient } from "@healthcloudai/hc-vitals-import";
import { HCLoginClient } from "@healthcloudai/hc-login-connector";
import { FetchClient } from "@healthcloudai/hc-http";

const httpClient = new FetchClient();
const loginClient = new HCLoginClient(httpClient);

loginClient.configure("healthcheck", "dev");

const connector = new HCImportVitalsClient(httpClient, loginClient);

export default function ImportVitalsScreen() {
  const vitals = useImportVitals({
    connector,
    onNavigate: (route, params) => navigation.navigate(route, params),
  });

  if (Platform.OS === "web") {
    return <ImportVitalsWebFallback onClose={() => navigation.goBack()} />;
  }

  return (
    <View>
      <ImportVitalsSyncButton onPress={vitals.sync} isSyncing={vitals.isSyncing} />
      <Text>{vitals.syncStatus}</Text>
      <Text>Last sync: {vitals.lastSyncDate ?? "Never"}</Text>

      <ImportVitalsQueueBanner
        count={vitals.queueSize}
        onRetry={vitals.retryQueue}
        isProcessing={vitals.isSyncing}
      />

      <ImportVitalsStatusCard icon="upload-cloud" label="Queued" value={String(vitals.queueSize)} />
    </View>
  );
}

Config

| Option | Type | Description | |---|---|---| | connector | VitalsImportConnector | Configured connector that owns API URLs, authentication, and vitals requests. | | theme | Partial<ImportVitalsTheme>? | Optional component color overrides. | | storage | VitalsStorage? | Custom key-value storage (default AsyncStorage). | | onNavigate | (route, params) => void | Navigation callback. | | logger | (level, message, metadata) => void | Optional logger (default silent). |

Theming

Components ship with sensible light-mode defaults. Override individual colors via the theme prop:

<ImportVitalsSyncButton
  onPress={vitals.sync}
  isSyncing={vitals.isSyncing}
  theme={{ primary: theme.primary, buttonText: theme.buttonText }}
/>

Advanced

VitalsImportService and HealthProviderService are exported for consumers who need direct access (e.g. headless background sync). The api-connector client HCImportVitalsClient is re-exported for convenience.