For developers. Just want to ask Claude about your training, with no code? Start with Your Garmin data in Claude instead.
In Part 1 we signed in to Garmin from a script and printed last night's sleep. A script has it easy: one user, one machine, and a terminal to type the MFA code into.
A web app has none of that. Your users sign in through a form, the MFA code arrives in a second request, and many users' Garmin sessions have to live somewhere safer than a folder. This post builds that properly with garminconnect-js and the Next.js App Router:
Storing each user's Garmin tokens, encrypted, in your own database
Signing in with MFA across two requests, using Server Actions
Reading Garmin data in a Server Component
The security details that are easy to get wrong
Written against garminconnect-js 0.10.0 and Next.js 16. Every snippet here type-checks against those versions.…