Skip to content

Add a WHOOP template generated from WHOOP's OpenAPI description - #344

Merged
tnkuehne merged 3 commits into
mainfrom
feat/whoop-template
Nov 23, 2026
Merged

tnkuehne merged 3 commits into
mainfrom
feat/whoop-template

Conversation

@tnkuehne

@tnkuehne tnkuehne commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Change

A WHOOP template.

  • 12 methods for the connected member's data:
    • profile and body measurements
    • cycles with their recovery and sleep
    • recoveries, sleeps and workouts
  • revokeAccess ends the app's access and asks as a deletion.
  • WHOOP's trusted-partner operations are not offered.

Connection.

  • Each organization connects through its own WHOOP developer app, with WHOOP_CLIENT_ID and WHOOP_CLIENT_SECRET. There is no managed client.
  • Better Auth has no WHOOP provider, so the template uses its generic OAuth plugin with PKCE.
  • It reads the member's identity from the basic profile and names the offline scope when refreshing, as WHOOP's refresh requests do.
  • WHOOP's description names no error body, so errors carry the HTTP status and the JSON WHOOP sent.
  • template.md points to WHOOP's API Terms of Use and covers the 10-member limit before WHOOP approves a higher tier.

Tests

  • Template tests: connection with the organization's app, reads, revokeAccess with approval, refresh and type checks.
  • Ran pnpm check, the generator tests and the template tests.
  • Not yet run against WHOOP's live API.

RetriggerView in GreptileConfidence Score: 5/5 Tier: plus

The PR appears safe to merge, with no new actionable issues found.

Summary

Adds a WHOOP template with 12 typed methods, organization-owned OAuth credentials and per-user connections.

  • WHOOP methods return typed data for a connected member.
  • Each WHOOP member connects through their organization's app.
  • Revoking WHOOP access asks the member before it runs.

Diagram

sequenceDiagram
  actor Member
  participant Widefleet
  participant Connector
  participant WHOOP
  Member->>Widefleet: Connect WHOOP
  Widefleet->>Connector: Prepare a user-owned launch link
  Member->>Connector: Open launch link
  Connector-->>Member: Continue to WHOOP
  Member->>WHOOP: Approve or cancel
  WHOOP->>Connector: Return through OAuth callback
  Connector->>Connector: Consume completion link
  Connector-->>Widefleet: Return with connection outcome
Loading

Reviews (5) · Last reviewed commit: "Test the WHOOP connection from Widefleet..." · Reviewed by Greptile

@tnkuehne
tnkuehne added this pull request to stack #345 November 23, 2026 14:28
Comment thread templates/whoop/tests/app.test.ts Resolved
Comment thread templates/whoop/tests/provider.ts Resolved
@tnkuehne
tnkuehne force-pushed the feat/whoop-template branch from ac87c6a to 7a75eec Compare November 23, 2026 14:40
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
widefleet-docs b530656 Nov 23 2026, 03:06 PM

@tnkuehne
tnkuehne force-pushed the feat/strava-template branch from 934c09c to 34cecf6 Compare November 23, 2026 15:03
The WHOOP template offers 12 methods for the connected member's profile and
body measurements, cycles with their recovery and sleep, and recoveries,
sleeps and workouts, plus revokeAccess, which ends the app's access and asks
as a deletion. WHOOP's trusted-partner operations are not offered.

Each organization connects through its own WHOOP developer app. Better Auth
has no WHOOP provider, so the template uses its generic OAuth plugin with PKCE,
reads the member's identity from the basic profile, and names the offline
scope when refreshing, as WHOOP's refresh requests do. WHOOP's description
names no error body, so errors carry the HTTP status and the JSON WHOOP sent.
The synthetic WHOOP removed only a member's access tokens on revocation, so a
later refresh still issued working credentials. It now removes their refresh
tokens as well, and the test checks that refreshing after revokeAccess yields
no credentials.
Cover the flow Widefleet's My connections page uses: the single-use launch
link, the OAuth callback, the completion link back to Widefleet, expired
links, links opened by another user or twice, and a cancelled authorization
returning with the error.
@tnkuehne
tnkuehne force-pushed the feat/whoop-template branch from 7a75eec to b530656 Compare November 23, 2026 15:05
@tnkuehne
tnkuehne removed this pull request from stack #345 November 23, 2026 15:06
@tnkuehne
tnkuehne changed the base branch from feat/strava-template to main November 23, 2026 15:06
@tnkuehne
tnkuehne merged commit d2bb217 into main Nov 23, 2026
6 checks passed
@tnkuehne
tnkuehne deleted the feat/whoop-template branch November 23, 2026 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant