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

@healthsync/core

v1.0.1

Published

Core TypeScript SDK for HealthSync - Universal health data integration platform

Downloads

176

Readme

@healthsync/core

Core TypeScript SDK for HealthSync - Universal health data integration platform.

Overview

HealthSync SDK provides a unified, plugin-based architecture for integrating with multiple health data sources including Apple HealthKit, Google Health Connect, Fitbit, Garmin, and more.

Features

  • Zero Dependencies: Lightweight core with no external runtime dependencies
  • Strict TypeScript: Fully typed with strict mode enabled
  • Plugin Architecture: Extensible design for easy integration of new health platforms
  • Unified Data Models: Standardized data structures across all health sources
  • Production-Ready: Built with error handling, retry logic, and caching

Installation

npm install @healthsync/core

Quick Start

import { HealthSyncSDK, DataType, HealthSource } from '@healthsync/core';

// Initialize SDK
const sdk = await HealthSyncSDK.initialize({
  logLevel: LogLevel.INFO,
  cache: {
    enabled: true,
    layers: [CacheLayer.MEMORY, CacheLayer.LOCAL_DB]
  }
});

// Register plugins
sdk.registerPlugin(healthConnectPlugin);
sdk.registerPlugin(fitbitPlugin);

// Connect to a health source
const result = await sdk.connect(HealthSource.HEALTH_CONNECT);

// Query health data
const steps = await sdk.query({
  dataType: DataType.STEPS,
  startDate: '2024-01-01T00:00:00Z',
  endDate: '2024-01-07T23:59:59Z'
});

Architecture

Core Components

  1. Unified Data Models (models/unified-data.ts)

    • Standardized interfaces for all health data types
    • Type-safe enums for data sources and types
    • Comprehensive data quality metadata
  2. Plugin Interface (plugins/plugin-interface.ts)

    • Contract for all health platform integrations
    • Lifecycle management (init, connect, disconnect, dispose)
    • Data fetching and real-time updates
  3. Configuration (types/config.ts)

    • SDK configuration options
    • Sync options and callbacks
    • Error types and handling

Data Types

Supported health data types:

  • Steps, Distance, Calories
  • Heart Rate, Heart Rate Variability, Resting Heart Rate
  • Sleep (with stage tracking)
  • Activities/Workouts
  • Blood Oxygen, Blood Pressure, Blood Glucose
  • Body Metrics (Weight, Height, BMI, Body Fat)
  • Hydration, Nutrition
  • Respiratory Rate, VO2 Max

Creating a Custom Plugin

import { BasePlugin, DataType, PluginConfig } from '@healthsync/core';

export class CustomHealthPlugin extends BasePlugin {
  readonly id = 'custom-health';
  readonly name = 'Custom Health Provider';
  readonly version = '1.0.0';
  readonly supportedDataTypes = [DataType.STEPS, DataType.HEART_RATE];
  readonly requiresAuthentication = true;
  readonly isCloudBased = true;

  async initialize(config: PluginConfig): Promise<void> {
    // Setup plugin
  }

  async connect(): Promise<ConnectionResult> {
    // Handle connection/auth
  }

  async fetchData(query: DataQuery): Promise<RawHealthData[]> {
    // Fetch data from source
  }

  // ... implement other interface methods
}

TypeScript Configuration

This package uses strict TypeScript configuration:

  • strict: true
  • noImplicitAny: true
  • strictNullChecks: true
  • noUnusedLocals: true
  • noUnusedParameters: true

Development

# Install dependencies
npm install

# Build
npm run build

# Watch mode
npm run dev

# Run tests
npm test

# Lint
npm run lint

# Format
npm run format

License

MIT

Contributing

See the main repository for contribution guidelines.