Wearables

Sync wearable device data from Garmin, Strava, Whoop, Polar, Suunto, Apple HealthKit, Samsung Health, and Google Health Connect into your Convex app.

Installation

npm install @clipin/convex-wearables

About Wearables

Convex component for wearable device integrations — sync health data from Garmin, Strava, Whoop, Polar, Suunto, Apple HealthKit, Samsung Health, and Google Health Connect.

Benefits

Use cases

how to sync Garmin health data with Convex

Use @clipin/convex-wearables to connect Garmin accounts via OAuth and automatically sync workouts, sleep, and time-series metrics. The component handles token management, webhooks, and data normalization into a unified schema you can query directly from Convex functions.

building fitness app with multiple wearable integrations

The Wearables component supports 8 major providers including Garmin, Strava, Whoop, Apple HealthKit, and Samsung Health. It provides a single API to query workouts, sleep sessions, and 88 health metrics across all connected devices with automatic deduplication and daily summary aggregation.

storing heart rate data efficiently in Convex

Configure time-series storage policies to keep raw heart rate data for recent periods and automatically roll up older data into hourly or daily aggregates. This reduces database growth while maintaining query performance for dense metrics like continuous heart rate monitoring.

OAuth flow for wearable device authorization

Call wearables.generateAuthUrl() to create provider-specific OAuth URLs with PKCE support, then use wearables.handleCallback() to exchange authorization codes for access tokens. The component automatically handles token refresh and stores encrypted credentials in Convex.

Frequently asked questions

What health data can I sync with this component?

The @clipin/convex-wearables component syncs workouts (40+ types), sleep sessions, and 88 time-series metrics including heart rate, HRV, SpO2, steps, weight, and body temperature. All data is normalized into a unified schema regardless of the source provider.

Does this handle OAuth token refresh automatically?

Yes, the Wearables component automatically refreshes OAuth tokens when they expire. It stores encrypted credentials in Convex and handles the refresh flow transparently during data syncing operations.

How do I prevent duplicate data when syncing from multiple sources?

The @clipin/convex-wearables component automatically deduplicates events and data points using external IDs and source timestamps. This prevents duplicate workouts or metrics when users connect multiple devices or providers.

Can I control how much historical data to store?

Yes, configure time-series storage policies to define retention rules per provider and metric type. You can keep raw data for recent periods and automatically roll up older data into aggregates, or store only rollups to minimize database growth.

Is this component GDPR compliant?

The @clipin/convex-wearables component includes a deleteAllUserData method that performs cascading deletion of all user health data in a single call, supporting GDPR right-to-erasure requirements.

Links