synheart_wear 0.1.2 copy "synheart_wear: ^0.1.2" to clipboard
synheart_wear: ^0.1.2 copied to clipboard

Unified wearable SDK for Synheart (HR, HRV, steps, energy, stress).

synheart_wear #

Version Flutter License

Unified wearable SDK โ€” Cross-device, cross-platform biometric data normalization with a single standardized output format. Stream HR, HRV, steps, calories, and stress signals from Apple Watch, Fitbit, Garmin, Whoop, and Samsung devices into your Flutter applications.

๐Ÿš€ Features #

  • ๐Ÿ“ฑ Cross-Platform: Works on iOS and Android
  • โŒš Multi-Device Support: Apple Watch, Fitbit, Garmin, Whoop, Samsung Watch
  • ๐Ÿ”„ Real-Time Streaming: Live HR and HRV data streams
  • ๐Ÿ“Š Unified Schema: Consistent data format across all devices
  • ๐Ÿ”’ Privacy-First: Consent-based data access with encryption
  • ๐Ÿ’พ Local Storage: Encrypted offline data persistence

๐Ÿ“ฆ Installation #

Add synheart_wear to your pubspec.yaml:

dependencies:
  synheart_wear: ^0.1.0

Then run:

flutter pub get

๐ŸŽฏ Quick Start #

Basic Usage #

import 'package:synheart_wear/synheart_wear.dart';

void main() async {
  // Initialize the SDK
  final synheart = SynheartWear();
  await synheart.initialize();

  // Read current metrics
  final metrics = await synheart.readMetrics();
  print('Heart Rate: ${metrics.getMetric(MetricType.hr)}');
  print('Steps: ${metrics.getMetric(MetricType.steps)}');
}

Real-Time Streaming #

// Stream heart rate data every 5 seconds
synheart.streamHR(interval: Duration(seconds: 5))
  .listen((metrics) {
    print('Current HR: ${metrics.getMetric(MetricType.hr)}');
  });

// Stream HRV data in 5-second windows
synheart.streamHRV(windowSize: Duration(seconds: 5))
  .listen((metrics) {
    print('HRV RMSSD: ${metrics.getMetric(MetricType.hrvRmssd)}');
  });

Configuration #

final synheart = SynheartWear(
  config: SynheartWearConfig(
    enabledAdapters: {
      DeviceAdapter.appleHealthKit,
      DeviceAdapter.fitbit,
    },
    enableLocalCaching: true,
    enableEncryption: true,
    streamInterval: Duration(seconds: 3),
  ),
);

๐Ÿ“Š Data Schema #

All wearable data follows the Synheart Data Schema v1.0:

{
  "timestamp": "2025-10-20T18:30:00Z",
  "device_id": "applewatch_1234",
  "source": "apple_healthkit",
  "metrics": {
    "hr": 72,
    "hrv_rmssd": 45,
    "hrv_sdnn": 62,
    "steps": 1045,
    "calories": 120.4,
    "stress": 0.3
  },
  "meta": {
    "battery": 0.82,
    "firmware_version": "10.1",
    "synced": true
  }
}

๐Ÿ”ง API Reference #

Core Methods #

Method Description
initialize() Request permissions & setup adapters
readMetrics() Get current biometric snapshot
streamHR() Stream real-time heart rate
streamHRV() Stream HRV in configurable windows
getCachedSessions() Retrieve cached wearable data
clearOldCache() Clean up old cached data

Permission Management #

// Request specific permissions
final permissions = await synheart.requestPermissions(
  permissions: {PermissionType.heartRate, PermissionType.steps},
  reason: 'This app needs access to your health data for insights.',
);

// Check permission status
final status = synheart.getPermissionStatus();
print('HR permission: ${status[PermissionType.heartRate]}');

Local Storage #

// Get cached sessions
final sessions = await synheart.getCachedSessions(
  startDate: DateTime.now().subtract(Duration(days: 7)),
  limit: 100,
);

// Get cache statistics
final stats = await synheart.getCacheStats();
print('Total sessions: ${stats['total_sessions']}');

// Clear old data
await synheart.clearOldCache(maxAge: Duration(days: 30));

โŒš Supported Devices #

Device Platform Integration Status
Apple Watch iOS HealthKit โœ… Ready
Fitbit iOS/Android REST API ๐Ÿ”„ In Development
Garmin iOS/Android Connect API ๐Ÿ“‹ Planned
Whoop iOS/Android REST API ๐Ÿ“‹ Planned
Samsung Watch Android Samsung Health ๐Ÿ“‹ Planned

๐Ÿ”’ Privacy & Security #

  • Consent-First Design: Users must explicitly approve data access
  • Data Encryption: AES-256-CBC encryption for local storage
  • Key Management: Automatic key generation and rotation
  • No Persistent IDs: Anonymized UUIDs for experiments
  • Compliant: Follows Synheart Data Governance Policy
  • Right to Forget: Users can revoke permissions and delete encrypted data

๐Ÿ—๏ธ Architecture #

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   synheart_wear SDK     โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚           โ”‚             โ”‚
โ”‚           โ–ผ             โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Device Adapters Layer   โ”‚
โ”‚ (Apple, Fitbit, etc.)   โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚           โ”‚             โ”‚
โ”‚           โ–ผ             โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Normalization Engine    โ”‚
โ”‚ (standard output schema)โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚           โ”‚             โ”‚
โ”‚           โ–ผ             โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚   Local Cache & Storage โ”‚
โ”‚   (encrypted, offline)  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ“ฑ Example App #

Check out the complete example in examples/flutter_example/:

cd examples/flutter_example
flutter run

The example demonstrates:

  • SDK initialization
  • Permission requests
  • Real-time data streaming
  • Local storage management

๐Ÿงช Testing #

Run the test suite:

flutter test

Tests cover:

  • Core SDK functionality
  • Data model serialization
  • Error handling scenarios
  • Permission management
  • Configuration system

๐Ÿ“‹ Roadmap #

Version Goal Description
v0.1 Core SDK โœ… Apple Watch + Fitbit integration
v0.2 Real-time streaming ๐Ÿ”„ HRV, HR over BLE
v0.3 Extended device support ๐Ÿ“‹ Garmin, Whoop, Samsung integration
v0.4 SWIP integration ๐Ÿ“‹ Add impact measurement hooks
v1.0 Public Release ๐Ÿ“‹ Open standard SDK and docs

๐Ÿค Contributing #

We welcome contributions! Please see our Contributing Guidelines for details.

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a pull request

๐Ÿ“„ License #

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ‘ฅ Authors #

  • Israel Goytom - Initial work - @isrugeek
  • Synheart AI Team - RFC Design & Architecture

Made with โค๏ธ by the Synheart AI Team

Technology with a heartbeat.

6
likes
0
points
286
downloads

Publisher

verified publishersynheart.ai

Weekly Downloads

Unified wearable SDK for Synheart (HR, HRV, steps, energy, stress).

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

collection, encrypt, flutter, health, path_provider, platform, uuid

More

Packages that depend on synheart_wear

Packages that implement synheart_wear