Skip to content

Bridge Tempdrop

Bridge

Pull-model bridge: fetches basal body temperature (BBT) readings from a user’s Tempdrop account into HDS. Same shape as bridge-mira, built on lib-bridge-js.

  • Basal body temperature: one temperature/c event per reading in the body-temperature-basal stream (data-model item body-temperature-basal), value in °C rounded to 2 decimals
  • The raw Tempdrop reading is kept in the event’s clientData.tempdrop and doubles as the idempotency key, so a re-sync only writes readings it has not seen and updates one whose value changed
  • Nothing else: Tempdrop exposes no cycle data, so the bridge derives none

These come from Tempdrop’s API, not from HDS, and the bridge cannot work around them:

  • 6 months of history only. Tempdrop serves readings from the last 6 months. Anything older cannot be reached through the API, so a user’s earlier BBT history will never be imported.
  • One reading per day. Tempdrop returns a single BBT reading per calendar day.
  • Refresh tokens expire after 30 days. If the bridge goes 30 days without a successful refresh (for example after a long outage, or if the user revokes access at Tempdrop), the credential is dead and the user must reconnect. The daily sync normally keeps it alive.
  1. The patient app (or the account app’s connect page) mints a scoped access for the bridge and calls POST /tempdrop/initiate
  2. The user signs in at Tempdrop and authorizes the bridge (OAuth 2.0 authorization code)
  3. Tempdrop redirects to /tempdrop/authReturn; the bridge stores the credential, starts a 6-month backfill in the background and sends the user back, to HDS’s own pages only (a refusal at Tempdrop comes back as error=partner-denied)
  4. Every 24 h the bridge re-fetches the last 14 days per user, so readings uploaded late are still caught
  5. The connector state (active, needs reauthorization, error, disconnected) is published as a sync-status/connector-v1 event on the user’s sync-status-tempdrop stream. A user connected before 2026-10-05 gets it after one reconnect through /connect, which adds the stream to the bridge’s access
  6. A user whose HDS access was revoked is disconnected before Tempdrop is called

Other routes: resync (reconnect after an expired token), sync (on-demand, 10 min cooldown), lastSync, status, revoke and health.

Production only: https://bridge-tempdrop.hds.ngo. Tempdrop issues a single OAuth app with one registered redirect URI and offers no sandbox, so there is no demo deployment. Automated tests run against an in-repo Tempdrop mock and an in-memory Pryv, without network access.

  • Node.js, lib-bridge-js framework
  • Tempdrop OAuth 2.0 integration

Production since 2026-09-22 (0.3.1 as of 2026-10-05), listed in the HDS app catalog. Deploys carry a /status health check.