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

higherdata-sdk

v0.7.1

Published

Typed HigherData API client generated from the tool registry.

Readme

HigherData SDK

Node 24+ TypeScript client for HigherData. Install with:

npm install higherdata-sdk
import { HigherData, HigherDataError } from "higherdata-sdk";

const client = new HigherData({
  apiKey: process.env.HIGHERDATA_API_KEY,
  space: "default",
});
const companies = await client.call("search.companies", {
  countryCodes: ["CA"], limit: 25,
});
const preview = await client.call("enrich.company", {
  domain: "cedar.example",
}, { execute: false });

Every registered tool name, input and output is generated from the registry's OpenAPI document using pinned openapi-typescript 7.13.0. ToolName, ToolInput<Name>, ToolOutput<Name>, operations, and components are exported. The small shared transport is handwritten. The server validates inputs, authorization and scope; a client cannot choose a tenant. execute: false sets the API dry-run flag. API-key and space headers stay on the configured origin; redirects are refused. HTTPS is required except HTTP loopback for tests.

Errors and retries

try {
  await client.call("account.whoami", {});
} catch (error) {
  if (error instanceof HigherDataError) {
    console.log(error.code, error.status, error.retryAfter);
  }
}

API errors retain the API's code, HTTP status and public message. Transport failures use status 0 with codes such as network_error, invalid_response, response_too_large and request_aborted; transport details are not exposed. Only HTTP 429 and 503 are retried, twice by default. Retry-After seconds or HTTP dates take precedence over the error body's retry_after; absent either, waits are one then two seconds. A requested wait above maxRetryDelayMs (default 30 seconds) returns the error to the caller rather than retrying early. Network errors and other statuses are never retried. Set maxRetries: 0 to turn retries off. The CLI uses that setting to preserve its existing behavior.

Each tool call has one idempotency key reused across its retries. Supply idempotencyKey in call options to retain a key across your own attempts. The server returns only a receipt for a replayed write; the SDK throws HigherDataReplayError with requestId instead of returning a value with the wrong tool output type. Read replays still return the normal result.

Requests have a 30-second timeout per attempt and an 8 MiB response bound. timeoutMs and an AbortSignal may be supplied in call options. Constructor options include apiUrl, fetch, maxRetries (0 to 5), maxRetryDelayMs, timeoutMs, sleep, and now for deterministic tests.

Streaming downloads

for await (const content of client.downloadJob({ jobId, format: "csv" })) {
  await destination.write(content);
}

The API returns bounded JSON pages; the helper yields content one page at a time and fetches the next page only when the consumer asks. It retains the CSV header from the first page, follows cursors and stops repeated cursors. Breaking out of the loop stops fetching. downloadJobPages also yields each page's content type, next cursor and suppression count. Every page goes through the authenticated job tool, so current suppression applies. Results may change between pages when suppression changes. Pass a cursor to resume a paged download.

Development

From the repository root, npm run sdk:generate regenerates the checked-in contract and npm run sdk:check fails if it is stale. The SDK build regenerates it; CI checks for drift before any build can overwrite it. Generation imports server tool definitions under the react-server condition but never invokes tools or uses hosted credentials. None of the server implementation is bundled. The SDK and CLI publish together through publish-cli.yml; see docs/RELEASE-CLI.md for the release procedure and unresolved B16 prerequisites.