Intervals-icu-sdk: TypeScript SDK generated from the official OpenAPI spec (open source, unofficial)

Hi all,

I am training for my first Olympic distance triathlon (April 2027) and I run everything through Intervals.icu: Garmin syncs in, wellness and activities flow out through the API into a small self-hosted coach pipeline, and planned workouts get pushed back to the calendar so they land on my watch. After hand-writing the same fetch wrappers and TypeScript types for the third time, I gave up and generated a proper client from the official OpenAPI spec. Sharing it in case it saves someone else the same work.

Install with npm install intervals-icu-sdk (npm page).

What it is

  • All 148 endpoints of the v1 API, with request and response types generated from the official OpenAPI spec

  • Zero runtime dependencies, works on Node 18+, Bun, and Deno

  • Function names match the API operation ids (listActivities, updateWellness, createEvent…), so the official api-docs page doubles as the SDK reference

  • API key and OAuth bearer auth both supported

  • MIT licensed

A quick taste


import { configureIntervals, listWellnessRecords } from "intervals-icu-sdk";



configureIntervals(); // reads INTERVALS_API_KEY

const { data } = await listWellnessRecords({

  path: { id: "0" },

  query: { oldest: "2026-07-01", newest: "2026-07-31" },

});

Design choices

  • JSON only: the CSV variants of the list endpoints are stripped, on the theory that a typed client wants JSON and curl already does CSV well. Workout downloads keep their format parameter (zwo, mrc, erg, fit).

  • A CI job re-fetches the spec every Monday and fails loudly if the API changed, so the package should never silently drift out of date.

Prior art

There are existing community clients, notably Fernando Paladini’s intervals-icu client announced here a few months back. This one takes a different approach: everything is generated from the spec, so coverage is complete by construction and API changes are caught by CI instead of by hand. Use whichever fits; more tooling around this API is good for everyone.

Not official

No affiliation with Intervals.icu. Huge thanks to David for the platform and for publishing a clean OpenAPI spec at all, which is the only reason this was possible. And mind the API rate limits when building on it.

Bug reports, feedback and PRs very welcome.

1 Like