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

@ityph/api-client

v1.0.0-rc.3

Published

ITY superapp external API client: a typed openapi-fetch client generated from the committed public OpenAPI spec (apps/superapp/openapi/external.public.json).

Readme

@ityph/api-client

A typed HTTP client for the superapp's external API (apps/superapp/src/app/api/external/**), generated from the committed public OpenAPI spec (apps/superapp/openapi/external.public.json) and built on openapi-fetch.

import { createApiClient } from "@ityph/api-client";

const client = createApiClient({
  baseUrl: "https://serendra.ity.ph",
  apiKey: process.env.SUPERAPP_API_KEY!,
});

const { data, error } = await client.POST("/api/external/notifications/send", {
  body: {
    unitId: "unit-101",
    title: "Package arrived",
    subtitle: "Your package is ready for pickup.",
  },
});

if (error) {
  // `error` is typed as the ADR 0025 external-API error body:
  // { success: false; error: string; code: string; details?: unknown[] }
  throw new Error(`${error.code}: ${error.error}`);
}

createApiClient wraps openapi-fetch's createClient<paths>() and sets the x-api-key header (the spec's ApiKeyAuth security scheme) on every request. Pass fetch to inject a custom implementation, mainly for tests.

The package also re-exports the generated paths/components types and the derived ExternalApiError type, and ships the spec itself at the @ityph/api-client/openapi.json subpath so non-TypeScript backends can generate their own client from it.

The package is an ES module. Its published exports carry a default condition beside import, so CommonJS require() and tsx resolve it; require() of an ES module needs Node 20.19 / 22.12 or newer.

Generated code — never hand-edit

Everything under src/generated/ and the committed openapi.json are generated from apps/superapp/openapi/external.public.json (the internal spec, apps/superapp/openapi/external.internal.json, is never used here). Do not hand-edit either file — regenerate them instead:

pnpm --filter @ityph/api-client run generate
# or, from the repo root:
pnpm run api-client:generate

pnpm --filter @ityph/api-client run check (or pnpm run api-client:check from the repo root) regenerates in memory and fails if the committed openapi.json or src/generated/external.ts have drifted from the current spec — the CI gate, mirroring the superapp's own pnpm openapi:check.

Releasing @ityph/api-client

Same Changesets pipeline as @ityph/bridge (.changeset/config.json) — see libs/bridge/README.md's "Releasing" section for the mechanics. The package version tracks the spec's own version (major for major); it can also release its own minor and patch fixes independently of a spec change.