GarminRunerz.Workout.Connect 1.0.0

dotnet add package GarminRunerz.Workout.Connect --version 1.0.0
                    
NuGet\Install-Package GarminRunerz.Workout.Connect -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="GarminRunerz.Workout.Connect" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="GarminRunerz.Workout.Connect" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="GarminRunerz.Workout.Connect" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add GarminRunerz.Workout.Connect --version 1.0.0
                    
#r "nuget: GarminRunerz.Workout.Connect, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package GarminRunerz.Workout.Connect@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=GarminRunerz.Workout.Connect&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=GarminRunerz.Workout.Connect&version=1.0.0
                    
Install as a Cake Tool

GarminRunerz.Workout.Connect

Uploads workouts built with GarminRunerz.Workout.Models / GarminRunerz.Workout.Services to a Garmin Connect account.

Authentication (Garmin SSO, MFA, token caching) is handled by the unofficial Unofficial.Garmin.Connect client; workout creation posts your serialized workout JSON directly to Garmin Connect's workout-service API — the same API the Garmin Connect web app uses.

⚠️ This relies on Garmin Connect's private web API. It is intended for personal automation with your own account. It may break without notice if Garmin changes their API, and heavy or multi-account use may violate Garmin's terms of service.

Installation

dotnet add package GarminRunerz.Workout.Connect

Usage

Registration

services.AddGarminConnectUploader(options =>
{
    options.Email = Environment.GetEnvironmentVariable("GARMIN_EMAIL")!;
    options.Password = Environment.GetEnvironmentVariable("GARMIN_PASSWORD")!;
    options.TokenCacheFilePath = "garmin-tokens.json"; // optional: persist tokens between runs
});

Uploading a workout

var uploader = provider.GetRequiredService<IWorkoutUploadService>();

// Build the workout with GarminRunerz.Workout.Services, then:
var created = await uploader.CreateWorkoutAsync(workout);
Console.WriteLine($"Created workout {created.WorkoutId}");

// Optionally schedule it on the Garmin Connect calendar:
await uploader.ScheduleWorkoutAsync(created.WorkoutId!.Value, new DateOnly(2026, 8, 20));

Once created (and synced), the workout appears in Garmin Connect and on your watch.

MFA accounts

If your account uses multi-factor authentication, provide an IMfaCodeProvider:

options.MfaCodeProvider = new StaticMfaCode("123456");
// or implement IMfaCodeProvider to prompt/fetch the code dynamically

With TokenCacheFilePath set, the MFA prompt only happens on the first run — subsequent runs reuse the cached OAuth tokens.

API

Method Description
CreateWorkoutAsync(workout) Creates the workout; returns it with the Garmin-assigned WorkoutId.
UpdateWorkoutAsync(workout) Updates an existing workout (WorkoutId required).
ScheduleWorkoutAsync(id, date) Schedules the workout on the Garmin Connect calendar.
DeleteWorkoutAsync(id) Deletes the workout.

The registration also exposes the full IGarminConnectClient (activities, devices, SendWorkoutToDevices, …) for anything beyond workout upload.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 99 8/18/2026