Welcome to the Nostavia Wearables SDK, a unified integration layer for 8+ leading wearables and health platforms.
The Nostavia Wearables SDK simplifies health and fitness data integration by providing a single, normalized API to connect with multiple wearables. It abstracts away complex provider-specific logic, handling both on-device connections and cloud-to-cloud integrations. This empowers developers to build powerful health applications without worrying about wearable fragmentation.
The SDK harmonizes data from 8+ leading health and fitness platforms:
| Provider | Architecture | Supported Data | Quirks / Notes |
|---|---|---|---|
| Apple HealthKit | On-device | Sleep, HR, HRV, SpO2, Activity, Workouts, Body, Glucose | Needs iOS permissions, queries when unlocked |
| Google Health Connect | On-device | Sleep, HR, SpO2, Activity, Body, Glucose | Requires Android permissions |
| Oura Ring | Cloud API | Sleep, Readiness, Activity, HR, HRV, Temp | Rich sleep staging. Limits: 5k requests/day |
| WHOOP | Cloud API | Sleep, Recovery, Strain, Workouts, HRV | Relies on proprietary physiological cycles |
| Fitbit / Google Health | Cloud API | Sleep, Activity, HR, SpO2, HRV | 150 req/hr limit. Strict token expiration |
| Withings | Cloud API | Sleep, HR, BP, Weight, ECG | Strict granular scopes, custom auth flow |
| Polar | Cloud API | Sleep, Activity, HR, Workouts | Transaction model (requires commit after pull) |
| Dexcom | Cloud API | Glucose (CGM), Meals, Insulin | Polling limits. Delayed data unless medical tier |
Get up and running with Nostavia in minutes.
npm install @nostavia/react-native @nostavia/core
cd ios && pod install
import { Nostavia } from '@nostavia/react-native';
Nostavia.init({
apiKey: 'YOUR_NOSTAVIA_API_KEY',
environment: 'sandbox', // or 'production'
});
import { Provider } from '@nostavia/react-native';
const connectDevice = async () => {
try {
await Nostavia.connect(Provider.OURA);
console.log('Successfully connected to Oura!');
} catch (error) {
console.error('Connection failed:', error);
}
};
Add to pubspec.yaml:
dependencies:
nostavia_flutter: ^1.0.0
Run flutter pub get.
import 'package:nostavia_flutter/nostavia_flutter.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Nostavia.init(
apiKey: 'YOUR_NOSTAVIA_API_KEY',
environment: NostaviaEnvironment.sandbox,
);
runApp(MyApp());
}
Future<void> connectDevice() async {
try {
await Nostavia.connect(Provider.oura);
print('Successfully connected to Oura!');
} catch (error) {
print('Connection failed: $error');
}
}
Once connected, fetch normalized data across any provider using a unified API.
// Example: Fetching Sleep Data in React Native
const fetchSleepData = async () => {
const startDate = new Date('2023-10-01T00:00:00Z');
const endDate = new Date('2023-10-07T00:00:00Z');
const sleepSessions = await Nostavia.getSleep(startDate, endDate);
console.log(sleepSessions);
};
Nostavia.getSleep(startDate, endDate): Returns Promise<Array<SleepSession>>Nostavia.getHeartRate(startDate, endDate): Returns Promise<Array<HeartRateSample>>Nostavia.getWorkouts(startDate, endDate): Returns Promise<Array<Workout>>Nostavia.getBloodGlucose(startDate, endDate): Returns Promise<Array<BloodGlucoseSample>>The SDK maps all provider-specific payloads into strict, unified models.
| Field | Type | Description |
|---|---|---|
| id | String | Unique identifier. |
| provider | Provider | Data source (e.g., OURA, HEALTH_CONNECT). |
| startTime | Date | Start timestamp. |
| endTime | Date | End timestamp. |
| durationMs | Number | Total sleep duration. |
| efficiency | Number | Sleep efficiency score (0.0 to 1.0). |
| stages | Array<SleepStage> | Breakdown of AWAKE, LIGHT, DEEP, REM. |
| Field | Type | Description |
|---|---|---|
| id | String | Unique identifier. |
| timestamp | Date | Time of the reading. |
| bpm | Number | Beats per minute. |
| context | Enum | RESTING, ACTIVE, SLEEP, WORKOUT. |
| Field | Type | Description |
|---|---|---|
| type | String | Normalized activity type (RUNNING, CYCLING, etc.). |
| startTime | Date | Session start. |
| endTime | Date | Session end. |
| caloriesBurned | Number | Total active calories burned. |
| distanceMeters | Number | Distance covered. |
Nostavia utilizes a robust architecture to harmonize on-device and cloud capabilities seamlessly.
When a user connects multiple wearables (e.g., an Oura Ring and an Apple Watch), Nostavia intelligently merges the data using a strict priority queue and deduplicates overlaps.
Nostavia.setSourcePriority(DataType, [Providers]).