Getting Started

SDKs

API Reference

Resources

Nostavia Wearables SDK

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.

Key Features

Supported Providers

The SDK harmonizes data from 8+ leading health and fitness platforms:

Provider Architecture Supported Data Quirks / Notes
Apple HealthKitOn-deviceSleep, HR, HRV, SpO2, Activity, Workouts, Body, GlucoseNeeds iOS permissions, queries when unlocked
Google Health ConnectOn-deviceSleep, HR, SpO2, Activity, Body, GlucoseRequires Android permissions
Oura RingCloud APISleep, Readiness, Activity, HR, HRV, TempRich sleep staging. Limits: 5k requests/day
WHOOPCloud APISleep, Recovery, Strain, Workouts, HRVRelies on proprietary physiological cycles
Fitbit / Google HealthCloud APISleep, Activity, HR, SpO2, HRV150 req/hr limit. Strict token expiration
WithingsCloud APISleep, HR, BP, Weight, ECGStrict granular scopes, custom auth flow
PolarCloud APISleep, Activity, HR, WorkoutsTransaction model (requires commit after pull)
DexcomCloud APIGlucose (CGM), Meals, InsulinPolling limits. Delayed data unless medical tier

Quickstart

Get up and running with Nostavia in minutes.

React Native Integration

Install Dependencies

npm install @nostavia/react-native @nostavia/core
cd ios && pod install

Initialize the SDK

import { Nostavia } from '@nostavia/react-native';
Nostavia.init({
  apiKey: 'YOUR_NOSTAVIA_API_KEY',
  environment: 'sandbox', // or 'production'
});

Connect a Provider

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);
  }
};

Flutter Integration

Install Dependencies

Add to pubspec.yaml:

dependencies:
  nostavia_flutter: ^1.0.0

Run flutter pub get.

Initialize the SDK

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());
}

Connect a Provider

Future<void> connectDevice() async {
  try {
    await Nostavia.connect(Provider.oura);
    print('Successfully connected to Oura!');
  } catch (error) {
    print('Connection failed: $error');
  }
}

API Reference

Data Fetching

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);
};

Core Methods

Normalized Data Models

The SDK maps all provider-specific payloads into strict, unified models.

SleepSession

FieldTypeDescription
idStringUnique identifier.
providerProviderData source (e.g., OURA, HEALTH_CONNECT).
startTimeDateStart timestamp.
endTimeDateEnd timestamp.
durationMsNumberTotal sleep duration.
efficiencyNumberSleep efficiency score (0.0 to 1.0).
stagesArray<SleepStage>Breakdown of AWAKE, LIGHT, DEEP, REM.

HeartRateSample

FieldTypeDescription
idStringUnique identifier.
timestampDateTime of the reading.
bpmNumberBeats per minute.
contextEnumRESTING, ACTIVE, SLEEP, WORKOUT.

Workout

FieldTypeDescription
typeStringNormalized activity type (RUNNING, CYCLING, etc.).
startTimeDateSession start.
endTimeDateSession end.
caloriesBurnedNumberTotal active calories burned.
distanceMetersNumberDistance covered.

System Architecture

Nostavia utilizes a robust architecture to harmonize on-device and cloud capabilities seamlessly.

graph LR A[Client App] --> B(Nostavia SDK) B -->|On-Device| C[Apple HealthKit] B -->|On-Device| D[Google Health Connect] B -->|Cloud| E[Nostavia Backend] E --> F[Oura API] E --> G[Whoop API] E --> H[Fitbit API]

Multi-Source Resolution Engine

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.