@wellpipe/whoop
The WHOOP provider package implements the HealthProvider interface for the WHOOP API. It handles API communication, data normalization, and provides MCP tools for AI assistants.
Installation
npm install @wellpipe/whoop
Features
- Full WHOOP API v1 integration
- Automatic token refresh
- Rate limiting and retry logic
- 21 MCP tools for AI assistants
- Normalized data output matching
@wellpipe/coretypes
Quick Start
import { WhoopClient } from '@wellpipe/whoop';
import { TokenProvider } from '@wellpipe/core';
// Create a token provider (implementation depends on your storage)
const tokenProvider: TokenProvider = {
async getAccessToken() { /* ... */ },
async getRefreshToken() { /* ... */ },
async updateTokens(access, refresh, expires) { /* ... */ },
async isExpired() { /* ... */ },
};
// Initialize the client
const client = new WhoopClient(tokenProvider);
// Fetch sleep data
const sleepData = await client.getSleep('2024-01-01', '2024-01-07');
console.log(sleepData);
Package Structure
@wellpipe/whoop/
├── src/
│ ├── index.ts # Package exports
│ ├── client.ts # WhoopClient class
│ ├── api/ # Raw API wrappers
│ │ ├── sleep.ts
│ │ ├── recovery.ts
│ │ ├── workout.ts
│ │ ├── cycle.ts
│ │ └── user.ts
│ ├── normalizers/ # Data transformation
│ │ ├── sleep.ts
│ │ ├── recovery.ts
│ │ └── workout.ts
│ └── tools/ # MCP tool definitions
│ ├── sleep-tools.ts
│ ├── recovery-tools.ts
│ ├── workout-tools.ts
│ ├── cycle-tools.ts
│ └── profile-tools.ts
├── docs/
│ └── TOOLS.md # Tool reference
└── package.json
Dependencies
| Package | Purpose |
|---|---|
@wellpipe/core | Shared interfaces and types |
zod | Runtime validation |
The package has minimal dependencies to keep bundle size small.
API Coverage
| WHOOP Endpoint | Supported |
|---|---|
| Sleep | Yes |
| Recovery | Yes |
| Workout | Yes |
| Cycle | Yes |
| User Profile | Yes |
| Body Measurement | Yes |
Rate Limits
The WHOOP API has the following limits:
| Limit Type | Value |
|---|---|
| Requests per minute | 100 |
| Requests per day | 10,000 |
The client automatically handles rate limiting with exponential backoff.