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

@jphil/bookwhen-client

v0.6.0

Published

TypeScript client for the Bookwhen API (v2)

Downloads

2,023

Readme

@jphil/bookwhen-client

TypeScript client for the Bookwhen API v2, built for Node.js and browser environments.

This package is currently pre-1.0 and under active development.

Quick Start

Install the library and peer dependencies:

pnpm add @jphil/bookwhen-client axios zod

Create a client and fetch events:

import { createBookwhenClient } from '@jphil/bookwhen-client';

const client = createBookwhenClient({
  apiKey: process.env.BOOKWHEN_API_KEY!,
});

const response = await client.events.getMultiple({
  filters: { from: '20250101', to: '20251231' },
  includes: ['location', 'tickets'],
});

const events = response.data;
const included = response.included;

API Coverage

Bookwhen resources currently implemented in this client:

| Resource | Status | Endpoints | | ------------ | ----------- | ------------------------------------------------ | | Events | Implemented | /events, /events/{event_id} | | Tickets | Implemented | /tickets, /tickets/{ticket_id} | | Locations | Implemented | /locations, /locations/{location_id} | | Attachments | Implemented | /attachments, /attachments/{attachment_id} | | Class passes | Implemented | /class_passes, /class_passes/{class_pass_id} |

Reference docs:

  • Bookwhen API docs: https://api.bookwhen.com/v2
  • Swagger layout: https://petstore.swagger.io/?url=https://api.bookwhen.com/v2/openapi.yaml

Response Shape

Service methods return full JSON:API response envelopes (not just data).

const eventResponse = await client.events.getById({
  eventId: 'ev-123',
  includes: ['location'],
});

eventResponse.data;
eventResponse.included;
eventResponse.links;
eventResponse.meta;

Relationship helper utilities are exported:

import {
  resolveJsonApiRelationships,
  resolveJsonApiResource,
} from '@jphil/bookwhen-client';

const resolvedMany = resolveJsonApiRelationships(
  response.data,
  response.included,
);
const resolvedOne = resolveJsonApiResource(
  eventResponse.data,
  eventResponse.included,
);

Browser Notes

  • The library works in browser contexts and includes browser-aware error handling.
  • Client-side API keys are visible to users; use least-privilege Bookwhen API tokens.

Development

Common local commands:

pnpm install
pnpm test
pnpm build
pnpm lint

Documentation

Project docs are intentionally lightweight and living:

Roadmap

  • Improve and consolidate shared JSON:API typing across model services.
  • Continue improving test depth across browser and Node environments.
  • Iterate toward a stable 1.0 release with community feedback.

License

ISC License. See LICENSE.