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

@bookr-cl/widget

v2.3.1

Published

Shared booking-flow logic (API client, auth, hooks) for Bookr client widgets.

Readme

@bookr-cl/widget

Shared booking-flow logic (typed API client, auth helpers, and React hooks) used by Bookr client widgets (ko-pilates, magnolia, and future clients — including third-party integrators). Each site keeps its own JSX/Tailwind presentation layer — this package only owns the parts that cause bugs when duplicated: API calls, validation, state machines, and auth/token handling.

Install

Published on the public npm registry — no auth or custom .npmrc needed:

npm install @bookr-cl/widget

Requires React 19+ (see peerDependencies).

What's exported

  • api.ts — thin typed functions for every Bookr endpoint the widgets call (listLocations, createBooking, sendMagicLink, etc.), each taking an explicit { apiBase, apiKey } config.
  • clientAuth.ts — getClientToken/setClientToken/clearClientToken/fetchMe.
  • dateUtils.ts — week/date helpers and the default provider-color palette used by class-schedule UIs.
  • hooks/useBookingFlow — locations→services→providers→slots fetch chain, validation, submit with 409 handling. Anonymous submissions are resolved server-side by contact fields (rut/email); a caller-supplied client_id is only honored alongside a client or staff auth token.
  • hooks/useClassSchedule — weekly group-class schedule fetch/submit logic, same anonymous-booking contract as useBookingFlow.
  • hooks/useMagicLinkAuth — passwordless (magic-link) auth; also accepts optional profile fields (firstName/lastName/phone/rut) for signup-style forms, linked server-side by rut first, then email.
  • hooks/usePasswordLoginAuth: email/password client login, additive alongside magic link. Also drives the forgot-password flow, which doubles as first-time password setup since there's no separate "set password" step.
  • hooks/useClientAccount, useSessionSummary — the client account/auth pages' remaining logic and session-summary display.
  • hooks/useShareableProfile — profile + stats ("member since", sessions completed) for shareable profile cards, tenant-agnostic.
  • clientAccountApi.ts, giftCards.ts, payments.ts, leadsApi.ts — typed client-account, gift-card, checkout (Webpay/Mercado Pago), and lead-submission (submitLead, contact forms) functions, same pattern as api.ts.
  • warmup.ts — warmupApi(config), fire-and-forget ping to /health to warm up Lambda/DB before the user reaches the booking flow.
  • generated/schema.ts — TS types generated from the real openapi.json (api/) via openapi-typescript. Not hand-edited.

Publishing a new version

Publishing happens under the bookr-cl npm account (a service account for the product, not any individual's personal npm login). CI (.github/workflows/publish.yml) publishes automatically when a vX.Y.Z tag is pushed — this is the only supported path now, so npm and git can't drift apart again (see bookr-cl/widget#5):

npm version patch   # or minor/major — also updates package-lock.json
git push && git push --tags

Update CHANGELOG.md with what changed before tagging. A manual npm publish from a laptop should only ever be used if CI itself is broken — if so, still commit the version bump and push a matching tag afterward so git stays the source of truth.

CI authenticates to npm via Trusted Publishing — OIDC straight from GitHub Actions to the npm registry, no token or secret involved at all. Configured on npmjs.com under the @bookr-cl/widget package's Settings → Trusted Publisher, pointing at this repo, publish.yml, and the widget environment.