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

@codespar/api-types

v0.5.0

Published

Shared REST wire contract for the CodeSpar managed-tier API (api.codespar.dev) — Zod schemas + inferred TypeScript types

Readme

@codespar/api-types

Shared REST wire contract for the CodeSpar managed-tier API at api.codespar.dev.

Every request body and response shape is defined once, as a Zod schema, and the matching TypeScript type is inferred from it. Both the backend (codespar-enterprise) and the dashboard (codespar-web) import from here — no more hand-rolled mirror types.

Why

Two bugs shipped in a 48-hour window because web and backend independently redeclared the same response types:

  • Newly-created API keys rendered as "Revoked" (revoked_at omitted on the create response, web type assumed present, undefined !== null was truthy).
  • API-key list came back empty (backend returns { keys: [...] }, web parsed data.api_keys).

Schemas here are the single source of truth. Parse responses at the fetch boundary and these failures become impossible — missing/renamed fields throw at runtime instead of rendering broken UI.

Usage

import {
  ApiKeyRowSchema,
  ListApiKeysResponseSchema,
  type ListApiKeysResponse,
} from "@codespar/api-types";

const res = await fetch("/v1/api-keys", { headers: { authorization: `Bearer ${token}` } });
const body: ListApiKeysResponse = ListApiKeysResponseSchema.parse(await res.json());
//    ^^^^ throws ZodError if the backend drifts

Every module exports both the schema (FooSchema) and the inferred type (Foo). Import whichever side you need.

Coverage

  • api-keys — create / list / row
  • projects — create / update / list / row
  • connections — create / list / row / webhook-secret rotation
  • servers — list / row / auth-schema
  • sessions — create / list / row / detail / tool-calls / execute

auth_type enum

A connection's auth_type determines how credentials are stored and forwarded to the upstream provider. As of 0.4.0 the enum has six values:

| Value | Used by | |---|---| | api_key | Most providers — Asaas, Mercado Pago, NFe.io, Stripe, etc. | | path_secret | Z-API-style providers that embed credentials in the URL path with a companion header. | | oauth | Providers requiring an OAuth flow (e.g. user-authorized integrations). | | cert | mTLS — BR open-banking pilots (BB live; Itaú / Santander / Bradesco / Caixa next). | | hmac_signed | Foxbit + LATAM crypto exchanges that sign each request with a derived HMAC. | | none | Public APIs / no credentials. |

What's new in 0.4.0

Adds the cert and hmac_signed auth_type values to the connection schemas — the contract now covers BR open-banking mTLS pilots and HMAC-signed crypto exchange APIs alongside the original four.

Known limitation. AuthSchemaFieldKindSchema (the kind enum for individual fields inside an auth schema) does NOT yet include hmac — only the connection-level auth_type enum does. The dashboard's ProviderConnectModal works around this by tagging HMAC-signed fields as path_secret kind. Consumers reading auth schemas directly should expect this mismatch until a future minor bump tightens the field-kind enum.

Versioning

  • This package mirrors the /v1/* REST surface of api.codespar.dev.
  • Additive changes (new field, new endpoint schema) → minor bump.
  • Breaking changes (field removed, type narrowed) → major bump, shipped alongside a matching backend release.

Keep TS + Python + backend aligned — drift is the loudest way to break trust.

Need more?

Need governance, budget limits, and audit trails for agent payments? CodeSpar Enterprise adds policy engine, payment routing, and compliance templates on top of these MCP servers.

License

MIT — codespar.dev