Skip to main content

Overview

Garmin is a real device-brand client — src/health/vendor/device/garmin.cpp, registered as garmin. It’s the most instructive example of Mirobody’s “implement only what’s publicly confirmable, leave the rest an honest stub” rule, because Garmin’s data API is partner-gated and push-based.
This is a vendor::Vendor implementing the shared authorize / fetch / webhook contract; see Vendor System for the interface.

What Garmin’s API shape forces

So of the six contract operations, Garmin ships exactly one working call — revoke — and three deliberate stubs (fetch, authorize_url, handle_webhook), with list_providers N/A (single brand). This is the intended state, recorded in the file header.

revoke — the one wired operation

revoke calls Garmin’s required account-disconnect endpoint, DELETE /wellness-api/rest/user/registration, authenticated with the user’s OAuth 2.0 access token as a bearer:
The data host defaults to https://apis.garmin.com (override via MIROBODY_VENDOR_GARMIN_BASE_URL).

fetch — a stub that explains itself

Rather than the generic “not implemented”, Garmin’s fetch throws a message stating the reason, so a caller learns the model:

Metadata (info())

Even with most operations stubbed, the vendor’s VendorInfo is fully populated and queryable without credentials:

Configuration

Takeaways for your own vendor

  • Implement what’s publicly confirmable; stub the rest with a reason. A stub that names the missing contract is better than a fabricated one.
  • A stateful OAuth flow (PKCE) doesn’t fit authorize_url alone — Mirobody keeps such flows in a stateful connect layer (as the SMART-on-FHIR EHR connect service does), not in the URL-builder signature.
  • VendorInfo should be complete regardless — it powers selection / comparison without a network call.
For a device brand with a fuller implementation, contrast Garmin with Fitbit (src/health/vendor/device/fitbit.cpp), which implements fetch, authorize_url, revoke, and a signed handle_webhook.

Next steps

Vendor System

The contract Garmin implements

Provider Integration

Build your own vendor::Vendor

OAuth Implementation

OAuth 2.0 / PKCE patterns in the vendor clients

Provider Overview

All shipped vendors