npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@broberg/complimenta-sdk

v0.2.0

Published

Typed SDK for the Complimenta (ComplimentaWork) booking API — read therapists/services/clinics/calendar-slots and create/cancel bookings. Generated from Complimenta's OpenAPI spec; OAuth2 client-credentials; runs in Next.js and Bun.

Readme

@broberg/complimenta-sdk

Typed SDK for the Complimenta (ComplimentaWork) booking system — read therapists / services / clinics / calendar-slots and create + cancel bookings. Types are generated from Complimenta's own OpenAPI spec, so the contract is exact and complete. Zero runtime dependencies, native fetch → runs unchanged in Next.js and Bun.

Built in the fdaa monorepo (packages/complimenta), published to npm as @broberg/complimenta-sdk. One SDK, consumed across the FysioDanmark Aalborg fleet: the fdaa platform, the future fdaa-sundhed repo, and the native apps.

Auth

OAuth2 client-credentials: the SDK exchanges clientId+clientSecret at the auth host's /oauth2/token for a Bearer JWT (cached + auto-refreshed) and sends it on every /api/v1/* call.

import { createComplimentaClient } from "@broberg/complimenta-sdk";

const cam = createComplimentaClient({
  baseUrl: process.env.COMPLIMENTA_BASE_URL!,        // scheme+host, no path
  clientId: process.env.COMPLIMENTA_CLIENT_ID!,
  clientSecret: process.env.COMPLIMENTA_CLIENT_SECRET!,
});

const therapists = await cam.listUsers();                 // GET /api/v1/users
const services   = await cam.listClinicServices();        // GET /api/v1/clinic-services
const slots      = await cam.listUserCalendarSlots(        // GET /api/v1/users/{userId}/calendar-slots
  therapists.items[0].id,
  { endsOnOrAfter: "2026-06-16T08:00:00", endsBefore: "2026-06-23T17:00:00" }, // end-time window (required)
);
const bookings   = await cam.listBookings({               // GET /api/v1/bookings
  startsAtOrAfter: "2026-06-16T00:00:00",                 // from-date window (required, ≤ 3 months)
  startsBefore:    "2026-06-23T00:00:00",
});
// also: listClinics/getClinic · listPublicServices · getBooking ·
//       createBooking(body) · cancelBooking(id)

cam.request(method, path, { query, body }) is the typed escape hatch for any of the ~40 endpoints not yet wrapped in a convenience method.

Types generated from the spec

The full contract lives in openapi/complimenta-external.json (vendored from GET {host}/v3/api-docs/external). Regenerate the types whenever Complimenta updates their API:

pnpm generate      # openapi-typescript → src/schema.ts (paths · components · operations)

src/schema.ts is generated — do not hand-edit. The convenience methods derive their request/response types from it, so a spec change surfaces as a type error at the call-site.

Smoke test (proves the live connection)

cp .env.example .env     # COMPLIMENTA_BASE_URL + COMPLIMENTA_CLIENT_ID + COMPLIMENTA_CLIENT_SECRET
bun scripts/smoke.ts     # token exchange + GET /calendar-slots