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

controlresell-sdk

v1.1.0

Published

TypeScript SDK for the ControlResell public API.

Readme

ControlResell TypeScript SDK

TypeScript client for the ControlResell public API (Node 20+, any runtime with fetch).

Install

From the 1.0.0 release, on npm:

npm install controlresell-sdk
import { ControlResell } from 'controlresell-sdk';

const client = new ControlResell({ apiKey: 'cr_live_...' }); // or set CONTROLRESELL_API_KEY
const me = await client.me.getMe();
for await (const item of client.items.listAll({ sold: false })) console.log(item.name);
for await (const order of client.orders.listAll({ bucket: 'to_send' })) console.log(order.id); // needs the orders:read scope; also client.orders.getOrder(id), listOrderLabels(id)
for await (const brand of client.catalogs.listAllBrands({ q: 'nik' })) console.log(brand.id, brand.name); // the identifiers an item is written with (items:read): getCatalogCategory, getCatalogCategoryFields, listAllCategories, listAllBrands, listAllSizes, listAllColors, listAllConditions, listAllPackageSizes, listAllMaterials (one page: listCatalog…)

for await (const favorite of client.favorites.listAll({ itemId: 42 })) console.log(favorite.buyerId); // the buyers who favorited a listing (items:read); also listAllItemFavorites(42), listFavorites, listItemFavorites
await client.conversations.listConversations({ buyerId: 'BUYER_ID', offerStatus: 'PENDING' }); // buyerId, itemId and offerStatus filter the conversations

// Writes (API key with `items:write` / `conversations:write`); pass `{ idempotencyKey }` to choose the key.
await client.items.publishItem(42, { accountIds: ['<account id>'] });
await client.items.publishItem(42, { accountIds: ['<account id>'], scheduledAt: '2026-11-02T10:00:00Z' }); // publishItem, dropItemPrice and republishItem take an optional scheduledAt (ISO 8601, at most 30 days ahead); without it they run now
await client.items.createItem({ name: 'Jacket' }); // PATCH: client.items.updateItem(42, { name: 'Jacket XL' })
await client.conversations.sendMessage('<conversation id>', { text: 'Hello!' });

// Photos (`items:write`): `upload` registers the file and sends its bytes (an HTTP PUT to the returned address); put its id in `photoIds`.
// `files.uploadFile` only registers it (you PUT the bytes yourself), `files.getFile(id)` reads it (`status` is PENDING until its bytes are stored).
const photo = await client.files.upload(await readFile('jacket.jpg'), { filename: 'jacket.jpg', contentType: 'image/jpeg' });
await client.items.createItem({ name: 'Jacket', photoIds: [photo.id] });

// Webhooks (`webhooks:read` / `webhooks:write`): list, get, create, update, delete an endpoint, read or rotate its secret,
// test it, list and retry its deliveries, recover the failed ones; listAllEvents catches up the last 7 days.
const { endpoint, secret } = await client.webhooks.createWebhookEndpoint({ url: 'https://example.com/hooks', eventTypes: ['item.sold'] });
for await (const event of client.webhooks.listAllEvents({ type: 'item.sold' })) console.log(event.type, event.data.itemId);

Retries (rate limits, 502/503/504, network errors), Idempotency-Key on every POST, cursor pagination with for await and typed errors (NotFoundError, RateLimitError…) are built in. The client is generated from the API's OpenAPI document (npm run generate, code in src/generated).

Licensed under the Apache License 2.0.