
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-coreAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 1 |
|---|---|
| repo stars | ★ 1 |
| Last updated | July 2, 2026 |
| Repository | mandarnilange/health_forge ↗ |
What it does
Integrates health_forge_core, the pure-Dart health data model, provider interfaces, and conflict-resolution MergeEngine, without Flutter.
Files
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_forgeFlutter 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
MergeEngineon 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.1Run 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
| Type | Purpose |
|---|---|
HealthRecordMixin | Envelope on every record (id, provider, timestamps, provenance, extensions) |
DataProvider / MetricType | Enums identifying source and metric |
TimeRange | start + end + timezone |
Provenance | sourceDevice, sourceApp, dataOrigin |
HealthProvider | Adapter interface |
ProviderCapabilities | Declares which metrics a provider supports |
MergeEngine + MergeConfig | Conflict resolution across providers |
DuplicateDetector | Clusters overlapping records per MetricType |
ProviderExtension | Base for provider-specific metric extensions (e.g. OuraSleepExtension) |
Record families (21 record types)
| Family | Records |
|---|---|
| Activity | ActivitySession, WorkoutRoute, StepCount, DistanceSample, CaloriesBurned, ElevationGain |
| Cardiovascular | HeartRateSample, RestingHeartRate, HeartRateVariability |
| Sleep | SleepSession, SleepStageSegment, SleepScore |
| Recovery | ReadinessScore, StressScore, RecoveryMetric |
| Respiratory | RespiratoryRate, BloodOxygenSample |
| Body | Weight, 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, usehealth_forgeinstead. - IDs — use
IdGenerator.uuid()for internal UUIDs.providerRecordIdis the native ID from the source API (keep separate). - Time zones — prefer UTC for
startTime/endTime.TimeRangecarries an optional timezone name for display. - Extensions — store via
Map<Type, ProviderExtension>on records; deserialize withExtensionType.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`
{
"version": "0.1.1",
"organization": "Health Forge",
"date": "May 2026",
"abstract": "Integration recipe for `health_forge_core` — the pure-Dart foundation of Health Forge: 21 unified record types across 6 families, the HealthRecordMixin envelope, the ProviderExtension type-map mechanism, and the isolate-safe MergeEngine with five conflict-resolution strategies. Use in server-side Dart, CLIs, isolates, or when implementing a custom HealthProvider.",
"references": [
"https://pub.dev/packages/health_forge_core",
"https://github.com/mandarnilange/health_forge",
"https://github.com/mandarnilange/health_forge/blob/main/design/adr/0002-record-envelope-design.md",
"https://github.com/mandarnilange/health_forge/blob/main/design/adr/0003-conflict-resolution-strategies.md",
"https://github.com/mandarnilange/health_forge/blob/main/design/adr/0004-pure-dart-core.md",
"https://github.com/mandarnilange/health_forge/blob/main/design/adr/0005-provider-extension-mechanism.md"
]
}