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

@karta.sh/sdk

v0.5.1

Published

TypeScript SDK for the Karta API (api keys, model keys, webhooks, usage, billing).

Readme

@karta.sh/sdk

Lightweight TypeScript SDK for the Karta API. No runtime dependencies — uses native fetch (Node ≥ 18.17 or any modern browser). The full machine-readable OpenAPI description is served by the Karta backend at https://karta.sh/openapi.json.

Install

npm install @karta.sh/sdk

Quick start

import { Karta } from "@karta.sh/sdk";

const karta = new Karta({
  apiKey: process.env.KARTA_API_KEY!, // "kt_live_…"
  // baseUrl is optional; defaults to https://karta.sh (the control API)
});

// List API keys
const keys = await karta.apiKeys.list();

// Create one (the plaintext `secret` is returned exactly once)
const { api_key, secret } = await karta.apiKeys.create("ci-runner", ["write"]);
console.log("Store this now, it won't be shown again:", secret);

// Store a BYOK provider key (encrypted at rest server-side)
await karta.modelKeys.create("anthropic", process.env.ANTHROPIC_API_KEY!, "primary");

// Manage webhook endpoints
const { webhook_endpoint, secret: signingSecret } = await karta.webhookEndpoints.create({
  url: "https://example.com/karta-webhook",
  event_types: ["subscription.created", "invoice.paid"],
});

// Usage + billing
const usage = await karta.usage.summary();
const billing = await karta.billing.status();

Errors

Every 4xx/5xx response throws a typed KartaError subclass that preserves status and the parsed JSON body:

import { KartaValidationError } from "@karta.sh/sdk";

try {
  await karta.apiKeys.create("");
} catch (e) {
  if (e instanceof KartaValidationError) {
    console.warn(e.body); // { error: "validation_failed", message: "Name is required" }
  } else {
    throw e;
  }
}

Subclasses: KartaAuthError (401), KartaForbiddenError (403), KartaNotFoundError (404), KartaValidationError (422). Anything else throws the base KartaError.

Development

npm install
npm run build   # tsc → ./dist
npm test        # vitest against a stub fetch

Surface

| Resource | Methods | | -------------------- | ---------------------------------------------------------------------- | | apiKeys | list(), create(name, scopes?), revoke(id) | | modelKeys | list(), create(provider, plaintext, name?), revoke(id) | | webhookEndpoints | list(), create(params), update(id, params), delete(id) | | usage | summary() | | billing | status() |

Auth is Bearer-only here. The browser dashboard talks to the same endpoints over a Devise session cookie — see the OpenAPI doc.