Repository navigation
Add a Garmin Connect template on Garmin's Personal API - #338
Merged
Merged
Conversation
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
widefleet-docs | d2cfe2b | Nov 23 2026, 02:59 PM |
…ns published inside other documents Garmin's Personal API description gives its operations no IDs and is published only inside its Swagger page's script. Rules now list such operations by method and path, and a template's scripts/operations.ts can export download to read the description from where its provider publishes it. Templates whose methods only read no longer receive the approval files.
Each user connects their own Garmin account with a Personal API key they create on Garmin Connect. The key is checked with Garmin, stored encrypted with the app's keys and never shown again. The template issues an access token from the key when needed, reuses it until shortly before it expires and issues a new one once when Garmin refuses it. 28 typed read methods are generated from the OpenAPI description on Garmin's Swagger page: activities and their original files, daily summaries, sleep, heart rate, HRV, Body Battery, SpO2, VO2 max, fitness age, weight, nutrition, menstrual cycle data and profile settings.
The Garmin Connect template connects with a Personal API key and has no OAuth client.
…en requests The key form now ends on the app's own page, which navigates back to Widefleet: the app's form-action policy allows only its own origin, and Chromium applies it to the redirects after a form submission. A Garmin request that cannot be sent while saving a key shows the retry notice and keeps the way back to Widefleet, as other outages do. One request at a time issues a user's new token, holding the row for a short lease; overlapping requests wait for the token it saves instead of each requesting their own.
tnkuehne
force-pushed
the
feat/garmin-connect-template
branch
from
November 23, 2026 14:57
3337e52 to
d2cfe2b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change
A Garmin Connect template.
reconnect_requireduntil the user saves a new one.template.mdquotes Garmin's FAQ on who the Personal API is for.Generator.
GET /hrv-service/hrv/{calendarDate}.scripts/operations.tscan exportdownloadto read it from there.templates/garmin-connect/scripts/openapi.tscuts the description out of the script without running it.Tests
tests/types.tschecks the generated types.pnpm check, the generator tests and the template tests.

Confidence Score: 5/5
The PR appears safe to merge; no new blocking issue was found.Summary
Adds a Garmin Connect template with 28 typed read methods and a separate saved connection for each user.
No new actionable issues were found. The four previous unnumbered findings are addressed.
Diagram
sequenceDiagram participant User participant App as Garmin template participant DB as App database participant Garmin User->>App: Save Personal API key App->>Garmin: Issue token and read profile Garmin-->>App: Token and account name App->>DB: Save encrypted key and token User->>App: Call a read method App->>DB: Read saved token opt Token expires soon or was refused App->>DB: Claim renewal App->>Garmin: Issue replacement token App->>DB: Save encrypted token end App->>Garmin: Read user's data Garmin-->>App: Data or error App-->>User: Typed resultReviews (3) · Last reviewed commit: "Regenerate the Garmin Connect template w..." · Reviewed by Greptile