Skip to content

fetchWakatimeStats

The fetcher behind the WakaTime card, and the only one here that never touches GitHub.

WakaTime data fetcher.

WakaTime needs no GitHub token; the config is here for the transport it carries.

fetchWakatimeStats(options, config: CardConfig): Promise<WakaTimeData>
OptionTypeRequiredWhat it is
usernamestring | undefinedyes—
wakatime_hoststring | undefinedno—

Returns Promise<WakaTimeData> — WakaTime data response.

It needs no GitHub token, and it still takes a CardConfig, because that is what carries the fetch every request goes through. A host that proxies, caches or mocks its traffic gets the same treatment here as everywhere else.

wakatime_host points at a self-hosted WakaTime — Wakapi or Hakatime — and defaults to wakatime.com. It is a host and an optional port, wakapi.dev or localhost:3000: a path, a query or credentials are refused, as is a username that is not one path segment.

The profile has to be public: WakaTime hides these numbers until “Display coding activity publicly” is switched on.