Mobile Health Data

Integrate mobile health data with BlueNexus using the Thryve SDK.

Note: This guide covers mobile-only data sources: Apple Health (iOS), Health Connect (Android), and Samsung Health (Android). These services don't provide web APIs - the data must be collected directly from the smartphone. Most other BlueNexus data sources (Fitbit, Garmin, Strava, etc.) are directly available through the BlueNexus platform without requiring mobile SDK integration.

Why Thryve?

BlueNexus uses Thryve to collect data from these mobile-only sources because they require native mobile app integration. Here's how it works:

  • Thryve's role: Initialize the SDK in your mobile app and push health data from the device

  • BlueNexus's role: Access, read, and process all the data through the BlueNexus API

You only use Thryve for data collection. Once the data is pushed to Thryve's platform, it automatically syncs to BlueNexus where you can access it alongside all your other health data sources through a unified API.

For additional Thryve data sources beyond Apple Health, Health Connect, and Samsung Health, see Thryve documentation.

Prerequisites

  • BlueNexus account, authenticated to use the token for fetching Thryve credential

  • Thryve SDK packages (.tgz files) - Provided by BlueNexus support(contact [email protected])

  • Thryve credentials (authId and authSecret) - Provided by BlueNexus support

  • macOS with Xcode 15+, Node.js 18+, Expo SDK 54+

  • iOS 17.0+ device

Installation

1. Add SDK Packages

2. Configuration

Configure your app with the BlueNexus API URL:

iOS Configuration

iOS requires HealthKit entitlements, Info.plist permissions, and CocoaPods configuration.

For complete iOS setup with Expo config plugins, see the React Native Example Repository.

Key requirements:

  • HealthKit entitlement enabled

  • NSHealthShareUsageDescription in Info.plist

  • Thryve CocoaPods source: https://git.thryve.de/thryve/Specs.git

  • iOS deployment target: 17.0+

Build:

BlueNexus API Integration

Credentials Endpoint

Your app must fetch the user's Thryve credentials from the BlueNexus API:

The endUserAlias is a unique identifier that links the user to Thryve. Your app must authenticate with BlueNexus to obtain an access token before calling this endpoint. See BlueNexus Authentication Guide.

How It Works

Flow:

  1. App initializes SDK → Fetches endUserAlias from BlueNexus backend

  2. User grants permissions → iOS HealthKit dialog

  3. App triggers sync → SDK reads data from Apple Health

  4. Data uploads to Thryve platform

  5. Data becomes available via BlueNexus API

Usage

The following example shows how to use the Thryve SDK in your app. These functions (initializeThryveSDK, startHealthSync, etc.) are custom wrapper utilities that you need to implement in your app - they are not part of the Thryve SDK package itself.

These wrappers integrate the Thryve SDK with BlueNexus by handling credential fetching and providing a cleaner API. The implementation shown below is taken from the React Native Example Repository (features/thryve).

Note: Data appears in BlueNexus API within 1-3 minutes. Backfill functions are optional and can be used independently based on your needs.

Default Health Metrics

The SDK syncs these metrics by default:

Category
Metrics

Activity

Steps, Walking/Running Distance, Cycling, Active Energy

Heart

Heart Rate

Sleep

Sleep Analysis

Body

Weight, Height

Troubleshooting

"Unable to find specification for 'ThryveCommons'"

  • Run npm run prebuild:clean

  • Verify ios/Podfile contains: source 'https://git.thryve.de/thryve/Specs.git'

  • Check withThryvePodfile.js is listed in app.json plugins

"Thryve credentials not configured"

  • Check .env file has EXPO_PUBLIC_THRYVE_AUTH_ID and EXPO_PUBLIC_THRYVE_AUTH_SECRET

"No endUserAlias received"

  • Verify BlueNexus API endpoint /api/v1/integrations/thryve/credentials is accessible

  • Check authentication with BlueNexus is working

Permission dialog doesn't appear

  • Run npm run prebuild:clean

  • Verify HealthKit entitlement in ios/YourApp/YourApp.entitlements

  • Check NSHealthShareUsageDescription in app.json

No data after sync

  • Wait 1-3 minutes for backend processing

  • Verify permissions granted in iOS Settings → Privacy & Security → Health

  • Check Apple Health app has data (add sample data if needed)

Resources

Last updated