Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
mandarnilange avatar

Integrate Health Forge Core

  • 1 installs
  • 1 repo stars
  • Updated July 2, 2026
  • mandarnilange/health_forge

Integrates health_forge_core, the pure-Dart health data model, provider interfaces, and conflict-resolution MergeEngine, without Flutter.

About

Integrates health_forge_core, the pure-Dart foundation with a unified health data model, provider interfaces, and a conflict-resolution MergeEngine. A developer uses it for server-side Dart, CLIs, isolates, or implementing a custom HealthProvider without Flutter.

  • Pure-Dart health data model and provider interfaces
  • MergeEngine for conflict resolution across records

Integrate Health Forge Core by the numbers

  • 1 all-time installs (skills.sh)
  • Ranked #959 of 1,039 Mobile Development skills by installs in the Skillselion catalog
  • Data as of Jul 8, 2026 (Skillselion catalog sync)
npx skills add https://github.com/mandarnilange/health_forge --skill integrate-health-forge-core

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs1
repo stars1
Last updatedJuly 2, 2026
Repositorymandarnilange/health_forge

What it does

Integrates health_forge_core, the pure-Dart health data model, provider interfaces, and conflict-resolution MergeEngine, without Flutter.

Files

SKILL.mdMarkdownGitHub ↗

Integrate health_forge_core

health_forge_core is the pure-Dart foundation of Health Forge. No Flutter dependencies; safe to use in isolates, CLIs, and server-side Dart.

When to use this package directly

  • You are not using the health_forge Flutter client (e.g. pure Dart server, isolate worker, CLI).
  • You are implementing a custom `HealthProvider` and only need the interfaces + data model.
  • You want to run the MergeEngine on records you already have (e.g. imported JSON).

For Flutter apps that consume data from the official adapters (health_forge_apple, health_forge_ghc, health_forge_oura, health_forge_strava), use `integrate-health-forge` instead — it includes the core transitively.

Integration steps

1. Add dependency

dependencies:
  health_forge_core: ^0.1.1

Run dart pub get (or flutter pub get).

2. Import

import 'package:health_forge_core/health_forge_core.dart';

One barrel file exports everything: enums, models, interfaces, merge engine.

3. Common usage patterns

Construct a record manually:

final sample = HeartRateSample(
  id: IdGenerator.uuid(),
  provider: DataProvider.apple,
  providerRecordType: 'HEART_RATE',
  startTime: DateTime.utc(2026, 4, 18, 9, 0),
  endTime: DateTime.utc(2026, 4, 18, 9, 0, 1),
  capturedAt: DateTime.now().toUtc(),
  beatsPerMinute: 68,
  freshness: Freshness.live,
);

Merge records from multiple sources:

final engine = MergeEngine(
  config: const MergeConfig(
    defaultStrategy: ConflictStrategy.priorityBased,
    providerPriority: [DataProvider.oura, DataProvider.apple],
    timeOverlapThresholdSeconds: 300,
  ),
);

final result = engine.merge(allRecords);
print('Resolved: ${result.records.length}');
print('Conflicts: ${result.conflictReport.conflicts.length}');

Implement a custom provider:

class MyProvider implements HealthProvider {
  @override
  DataProvider get providerType => DataProvider.garmin;

  @override
  String get displayName => 'My Custom Provider';

  @override
  ProviderCapabilities get capabilities => const ProviderCapabilities(
    supportedMetrics: {MetricType.heartRate: AccessMode.read},
    syncModel: SyncModel.fullWindow,
  );

  @override
  Future<AuthResult> authorize() async => AuthResult.success();

  @override
  Future<void> deauthorize() async {}

  @override
  Future<bool> isAuthorized() async => true;

  @override
  Future<List<HealthRecordMixin>> fetchRecords({
    required MetricType metricType,
    required TimeRange timeRange,
  }) async {
    // Call your API, convert to health_forge records, return.
    return const [];
  }
}

Key types

TypePurpose
HealthRecordMixinEnvelope on every record (id, provider, timestamps, provenance, extensions)
DataProvider / MetricTypeEnums identifying source and metric
TimeRangestart + end + timezone
ProvenancesourceDevice, sourceApp, dataOrigin
HealthProviderAdapter interface
ProviderCapabilitiesDeclares which metrics a provider supports
MergeEngine + MergeConfigConflict resolution across providers
DuplicateDetectorClusters overlapping records per MetricType
ProviderExtensionBase for provider-specific metric extensions (e.g. OuraSleepExtension)

Record families (21 record types)

FamilyRecords
ActivityActivitySession, WorkoutRoute, StepCount, DistanceSample, CaloriesBurned, ElevationGain
CardiovascularHeartRateSample, RestingHeartRate, HeartRateVariability
SleepSleepSession, SleepStageSegment, SleepScore
RecoveryReadinessScore, StressScore, RecoveryMetric
RespiratoryRespiratoryRate, BloodOxygenSample
BodyWeight, BodyFat, BloodPressure, BloodGlucose

All records are @freezed — immutable, with copyWith, ==, and toJson/fromJson.

Gotchas

  • No Flutter imports — this package must stay isolate-safe. If you need flutter_secure_storage, token persistence, or platform channels, use health_forge instead.
  • IDs — use IdGenerator.uuid() for internal UUIDs. providerRecordId is the native ID from the source API (keep separate).
  • Time zones — prefer UTC for startTime/endTime. TimeRange carries an optional timezone name for display.
  • Extensions — store via Map<Type, ProviderExtension> on records; deserialize with ExtensionType.fromJson(record.extensions).

Related skills

  • `integrate-health-forge` — Flutter client (most users want this)
  • `integrate-health-forge-apple`
  • `integrate-health-forge-ghc`
  • `integrate-health-forge-oura`
  • `integrate-health-forge-strava`

Related skills

Mobile Developmentintegrationsbackend

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.