vital_health

Creator: coderz1093

Last updated:

Add to Cart

Description:

vital health

vital_health #

Introduction #
The Vital SDK is split into three main components: vital_core, vital_health and vital_devices.

vital_core holds common
components to both vital_health and vital_devices. Among other things, it has the network layer that allows us to
send data from a device to a server.
vital_health is an abstraction over HealthKit an Health Connect(coming soon)
vital_devices is an abstraction over a set of Bluetooth devices.

Getting Started #


Follow iOS SDK instructions regarding HealthKit
capabilities and background delivery setup for
your iOS app.


Follow Android SDK instructions regarding Health Connect
capabilities setup for your Android app.


To use Vital Health client you need to call configure first:


import 'package:vital_core/vital_core.dart' as vital_core;
import 'package:vital_health/vital_health.dart' as vital_health;

await vital_core.configure(
apiKey,
Environment.sandbox,
Region.us
);

await vital_health.configure(HealthConfig(
iosConfig: IosHealthConfig(
backgroundDeliveryEnabled: true,
),
androidConfig: AndroidHealthConfig(
syncOnAppStart: true,
),
));
copied to clipboard

Set User ID

vital_core.setUserId('eba7c0a2-dc01-49f5-a361-...);
copied to clipboard

Ask user for permissions to collect/write Health data.

vital_health.askForPermission(
[
HealthResource.profile,
HealthResource.body,
...
],
[
HealthResourceWrite.water,
...
]
);
copied to clipboard

Sync data

vital_health.syncData();
copied to clipboard

Observe sync status using status stream

Stream<SyncStatus> status = vital_health.status;
copied to clipboard

When your user logs out, you can call signOut() to reset the SDK state. This resets both the Vital Health and the Vital Core SDK.

vital_health.signOut();
copied to clipboard
Documentation #
For more example usage run the sample app with your API key and Region set in main.dart.
Please refer to the official Vital docs provide a full reference on using
this library.
License #
vital-flutter is available under the AGPLv3 license. See the LICENSE file for more info. VitalDevices is under
the Adept Labs Enterprise Edition (EE) license (the “EE License”). Please refer to its license inside its folder.

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files:

Customer Reviews

There are no reviews.