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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@packagecat/packagecat-js

v0.5.0

Published

Package Cat JavaScript SDK

Downloads

4

Readme

Packagecat JS SDK

A lightweight JavaScript SDK for interacting with the Packagecat API.
Packagecat helps developers manage developer keys, tokens, client APIs, and carrier bundles easily and securely.

Installation

Install via npm:

npm install @packagecat/packagecat-js

Or using yarn:

yarn add @packagecat/packagecat-js

Usage

First, initialize a Packagecat instance with your API URL and (optionally) access token and clientToken:

import { Packagecat } from '@packagecat/packagecat-js';

const packagecat = new Packagecat({
  url: 'https://api.packagecat.com',
  token: 'your-access-token',
  clientToken: 'your-client-specific-token',
});

You can update tokens later dynamically:

packagecat.setToken('new-token'); // Update auth token
packagecat.setToken('new-client-specific-token', true); // Update client specific auth token

API Overview

Packagecat organizes functionality into two main areas: developer and carrier.

Developer APIs

Users

| Method | Description | |:----------------------------------------|:--------------------------------------| | developer.createUser(user) | Create a developer user | | developer.getUsers() | Retrieve developer users |

Keys & Tokens

| Method | Description | |:----------------------------------------|:--------------------------------------| | developer.createClientSecret(key) | Create client key secret | | developer.createDeveloperKey(payload) | Add developer keys | | developer.createToken(tokenProps) | Set or exchange for a developer token | | developer.deleteApiKey(keyId) | Delete a developer key by ID | | developer.getKeys() | Retrieve all developer keys | | developer.updateApiKey(key, payload) | Update name or enabled |

Carrier APIs

| Method | Description | |:-------|:------------------------------------------------------------| | carrier.createAccountBundle(bundle) | Add a carrier account bundle | | carrier.deleteAccountBundle(id) | Delete a carrier account bundle by ID | | carrier.getAccountBundles() | Retrieve all carrier account bundles | | carrier.patchAccountBundle(id) | Patch an account bundle by overwriting its carrier accounts | | carrier.updateAccountBundle(bundle) | Update an existing carrier account bundle |

Rates

| Example | Description | |:--------|:------------| | carrier.getRates(rateRequests, { carrier: 'ups' }) | Retrieve abbreviated rates from a specific carrier | | carrier.getRates(rateRequests, { short: false }) | Retrieve full rate response object | | carrier.getRates(rateRequests) | Retrieve abbreviated rates (default behavior) |

Location APIs

| Method | Description | |:---------------------------------------|:--------------------------------------------| | location.createLocation(payload) | Add a new location | | location.getLocations(params?) | Retrieve locations with optional pagination | | location.getLocationById(id) | Retrieve location by ID | | location.deleteLocationById(id) | Delete a specific location by ID | | location.patchLocation(location, id) | Patches a specific location by ID | | location.updateLocation(location, id) | Updates a specific location by ID |

Shipment APIs

| Method | Description | |:-------|:------------| | shipment.create(payload) | Create a shipment | | shipment.label(shipmentId) | Generate a shipping label | | shipment.cancel(shipmentId) | Cancel a shipment | | shipment.get(shipmentId) | Retrieve a shipment by ID |

Event APIs

| Method | Description | |:-------|:------------| | event.get(options?) | Fetch developer events with optional filters |

Notes

  • token is used for administrative API access.
  • clientToken is used for client-specific API access via /api/{apiVersion}.
  • You can choose to operate on either depending on your access model.

License

MIT