Skip to Content
FFitDatadraft

Introduction

Open draft specification and TypeScript SDK for portable fitness, nutrition, wearable, and laboratory data.

Draft specification — 0.0.0-local

FitData is currently an unreleased draft specification. All packages, wire schemas, and registry versions use the fixed 0.0.0-local placeholder during local iteration. No public release or backward-compatibility guarantee exists yet.

FitData defines portable, vendor-neutral data contracts for personal fitness, nutrition, wearables, sleep, and laboratory health records. It ships as a human-readable specification, generated JSON Schema files, typed TypeScript domain packages, semantic validators, JSON/JSONL serialization, and offline source mappers.

Workspace packages

Every domain owns its structural schemas, semantic checks, and generated JSON Schema. All four domains compose directly into the unified fitdata document schema using uniform domain.noun record kinds and optional ownership metadata.

PackageRecord kinds & scope
@fitdata/coreShared values, IDs, time, provenance, units and conversions, optional-ownership envelopes, core.measurement, core.series, core.summary, core.tombstone
@fitdata/trainingtraining.routine (step-based and timeline-based), training.workout (wearable and structured), training.threshold
@fitdata/nutritionnutrition.food, nutrition.nutrient, nutrition.intake, nutrition.meal, nutrition.goal, and createFoodIntake serving calculations
@fitdata/lablab.biomarker, lab.test, lab.specimen, lab.result, lab.report, and the 55-biomarker / 87-test LOINC registry
fitdataUnified document composition (all four domains + sleep.session), profiles, JSON/JSONL, history, and seven offline provider mappers

Quick example

Validate a FitData document or convert external provider exports offline:

import {
  currentRecords,
  parseDocument,
  serializeJsonLines,
  validateDocument,
} from "fitdata";
import { mapStravaActivities } from "fitdata/mappers";

const mapped = mapStravaActivities(stravaPayload, {
  subject: "example:athlete",
  importedAt: "2026-11-29T10:00:00Z",
  revision: 1,
  mode: "strict",
});

if (mapped.status !== "rejected") {
  const checked = validateDocument(mapped.document);
  if (checked.ok) {
    const active = currentRecords(checked.value);
    const jsonl = serializeJsonLines(checked.value);
    console.log({ activeCount: active.length, bytes: jsonl.length });
  }
}

Explore FitData

Local workspace commands

Use Node.js 22 or later inside the monorepo:

npm ci
npm run check
npm run dev:web

npm run check runs Biome linting, TypeScript builds and type checks, JSON Schema drift checks, Vitest suites, browser bundle smoke tests, offline package install checks, and the unreleased version guard.

On this page