Supported paths
Core modules
Storage split
Wearable data deliberately has two layers:
If a new metric needs detailed charts on another device, do not silently sync the whole raw table. Add a compact summary first and decide deliberately whether detail rows belong in sync.
Runtime configuration
Self-hosted and production deployments can provide wearable client ids/secrets through runtime config andapi/proxy.js. Do not hardcode real provider credentials in docs, source, test snapshots, or browser-visible constants.
Google Health is a fail-closed capability. collectWearableConfigured() reports it available only when GOOGLE_HEALTH_ENABLED=true, GOOGLE_HEALTH_CLIENT_ID, and GOOGLE_HEALTH_CLIENT_SECRET are all present. Runtime config returns the public client ID and boolean capability, never the secret. Disabled deployments must block connect, token exchange, refresh, sync, and backfill while preserving disconnect and account-wide revocation for previously stored connections.
The legacy Fitbit adapter is hidden for new users but remains visible and syncable for existing connections while their current token and the legacy API still work. Do not add a legacy reconnect path; Google requires users to re-consent through Google OAuth for migration.
When adding a provider, document:
- OAuth callback path and allowed origin expectations;
- token storage key and encryption behavior;
- normalized metric ids;
- whether the provider supports backfill and how many days;
- how disconnect/revoke behaves;
- test fixtures with fake payloads only.
Agent Access wearable series
Settings → Agent Access can push a daily-series section for MCP clients: off, 7 days, 30 days, or 90 days. The browser serializes one metric per line, oldest to newest, using— for missing days and source labels in parentheses.
This is a read-only export surface. The MCP must not write wearable values back through Agent Access.
Verification checklist
Before shipping wearable changes:- run provider fetcher/adapter tests with fixture payloads;
- run sync-flow tests proving summaries sync and OAuth tokens do not;
- run browser specs for connect/disconnect UI if touched;
- verify Apple Health imports stay local and large files remain cancellable;
- verify manual entries merge with vendor values without duplicating days;
- verify Agent Access series output if metric ids or daily-row shape changed.