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

@qcobro/sdk

v1.19.5

Published

Developer-friendly TypeScript SDK for the QCobro API.

Readme

@qcobro/sdk

A developer-friendly TypeScript SDK for the QCobro API. It wraps the server's tRPC interface behind an ergonomic, fully-typed Client so you can manage QCobro resources without touching transport details.

This release covers portfolios, including account synchronization. More resources land in follow-up releases.

Install

npm install @qcobro/sdk

Requires a runtime with a global fetch (Node ≥18 or a modern browser). For older runtimes, pass a fetch polyfill via the fetch option.

Quick start

import { Client } from "@qcobro/sdk";

const client = new Client({ endpoint: "https://api.qcobro.com" });

// Authenticate and pick the workspace to act in.
await client.login({ email: "[email protected]", password: process.env.QCOBRO_PASSWORD! });
client.useWorkspace("WO6ueex0qan9ojhf820wgiae3qi5luy08y");

// ...or, for unattended/server-to-server integrations, use a workspace API key:
await client.loginWithApiKey({
  accessKeyId: "WO6ueex0qan9ojhf820wgiae3qi5luy08y",
  accessKeySecret: process.env.QCOBRO_API_SECRET!
});

// Manage portfolios.
const portfolio = await client.portfolios.create({
  name: "Q3 delinquencies",
  clientId: "acme",
  currency: "USD"
});

const { items, total } = await client.portfolios.listAccounts({ portfolioId: portfolio.id });

await client.portfolios.syncAccounts({
  portfolioId: portfolio.id,
  mode: "APPEND_ONLY",
  rows: [{ externalId: "A-1", fullName: "Jane Doe", outstandingBalance: 1200.5 }]
});

Authentication & tokens

Authenticate one of two ways:

  • login({ email, password }) — interactive credentials login (returns id/access/refresh tokens).
  • loginWithApiKey({ accessKeyId, accessKeySecret }) — a workspace API key, for unattended server-to-server use where there's no human to type a password.

The Client holds tokens in memory. Persisting them (so a session survives a restart) is your responsibility:

// Save after login...
const tokens = client.getTokens();
// ...and restore later.
const client = new Client({ endpoint }).setTokens(tokens);

// Refresh an expired access token.
await client.refresh();

Auto-refresh. By default, if a call returns UNAUTHORIZED and a refresh token is held, the client refreshes the access token once and replays the request transparently — concurrent failures share a single refresh. If the refresh itself fails, the original UNAUTHORIZED is surfaced. Disable it with new Client({ endpoint, autoRefresh: false }).

Validation & errors

Inputs are validated client-side against the shared QCobro schemas before a request is sent. Invalid input throws a ValidationError with field-level details, and no network call is made. Server-side authorization failures (e.g. an unauthenticated or wrong-workspace call) surface as the server's error.

import { ValidationError } from "@qcobro/sdk";

try {
  await client.portfolios.create({ name: "", clientId: "acme", currency: "USD" });
} catch (err) {
  if (err instanceof ValidationError) {
    console.error(err.fieldErrors); // [{ field: "name", message: "...", code: "..." }]
  }
}

API reference

Generate the markdown API reference with:

npm run docs

Output lands in docs/.