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

@tradeproof/sdk

v0.1.0

Published

Official TypeScript/JavaScript SDK for the TradeProof contractor-license API (v1, MVP).

Readme

@tradeproof/sdk — TypeScript / JavaScript SDK

Official SDK for the TradeProof contractor-license API (/v1). Hand-written, fully typed, zero runtime dependencies, ESM + CommonJS, and isomorphic (browser + Node 18+, built on the global fetch and Web Crypto).

npm install @tradeproof/sdk

Quickstart

import { TradeProof } from "@tradeproof/sdk";

const client = new TradeProof({ apiKey: "tp_read_..." });

const results = await client.licenses.search("roofing contractors in texas", { limit: 5 });
for (const hit of results.hits) {
  console.log(hit.license_number, hit.business_name, hit.state);
}

const record = await client.licenses.get("TX", "tdlr", "ABC123");
console.log(record.status, record.expiration_date);

See examples/quickstart.ts.

MVP scope — these features only

This is the 0.1.0 MVP. It intentionally covers a small, stable surface and nothing else:

  • Authentication — API key (tp_...) or JWT bearer token; both sent as Authorization: Bearer.
  • License lookupclient.licenses.get(...), .lookup(...), .search(...), .list(...), .coverage().
  • Watchlist CRUDclient.watchlist.list() / .add() / .remove() (org-scoped; also needs internalAuthToken).
  • Webhook subscription CRUDclient.webhooks.create() / .list() / .get() / .update() / .delete().
  • HMAC signature verificationverify(body, signature, secret) for the X-TradeProof-Signature header on inbound webhooks.

Everything else in the API (billing, audits, insurance/COI, notifications, Procore, admin) is out of scope for the MVP and lands in later minor releases.

Authentication

new TradeProof({ apiKey: "tp_read_..." });            // programmatic API key
new TradeProof({ bearerToken: "<jwt>" });             // OIDC/JWT bearer
new TradeProof({ apiKey: "tp_...", internalAuthToken: "..." }); // org-scoped (watchlist)

Webhook signature verification (HMAC)

verify() is the cryptographic primitive that authenticates a webhook body — it confirms the payload was signed with your subscription secret and is within the replay-tolerance window. It is async (Web Crypto) and does not assert anything about a contractor.

import { verify } from "@tradeproof/sdk/hmac"; // tree-shaken subpath: HMAC only, no HTTP client

const ok = await verify(rawBody, req.headers["x-tradeproof-signature"], secret);
if (!ok) res.status(400).end();

The signature is t=<unix>,v1=<hex> where v1 = HMAC-SHA256(secret, + "${t}.${body}" + ); during secret rotation several v1= values may be present and any valid one is accepted.

Bundle size & tree-shaking

The package is sideEffects: false with per-feature subpath entry points, so a browser webhook receiver that imports only @tradeproof/sdk/hmac ships just the HMAC primitive (well under the 30 KB minified+gzipped budget) without pulling in the HTTP client.

Errors & retries

Non-2xx responses reject with typed errors (NotFoundError, AuthenticationError, RateLimitError, ...), all subclasses of APIError. The client automatically retries on 429 (honouring Retry-After) and 5xx, up to maxRetries (default 2).

Roadmap to 1.0

| Milestone | Adds | | --- | --- | | 0.2.0 | Auto-pagination async iterators, request/response hooks | | 0.3.0 | Insurance/COI + audit-report read surfaces | | 0.4.0 | Notifications + billing read surfaces | | 1.0.0 | Full /v1 coverage, frozen public surface, stability commitment |

Versioning & stability

Pre-1.0 the SDK follows tight semantic-versioning discipline so you can pin safely:

  • 0.1.x — bug-fix patches only; no breaking changes.
  • 0.2.0, 0.3.0, ... — additive minor releases; existing calls keep working.
  • 1.0.0 — the stability commitment: the public surface is frozen and any future breaking change ships with a 12-month deprecation window and a migration note.

Until 1.0.0, pin a minor range (e.g. "@tradeproof/sdk": "~0.1.0").

License

Apache-2.0.