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

@packbase/sdk-ts

v0.1.0

Published

Typed, dependency-free TypeScript client for the Packbase API.

Downloads

66

Readme

@packbase/sdk-ts

A typed, dependency-free TypeScript client for the Packbase API.

Installation

npm install @packbase/sdk-ts

The package ships native ESM and type declarations. It supports Node.js 18 or later and modern browsers with the standard fetch API.

Quick start

import { PackbaseSDK } from '@packbase/sdk-ts'

const pb = new PackbaseSDK({
    apiKey: process.env.PACKBASE_API_KEY,
})

const profile = await pb.profiles('rek')
const { packs } = await pb.packs.list()

When no apiKey is supplied, the SDK uses cookie-based authentication. This is useful in browser applications where the Packbase session cookie is already set.

const pb = new PackbaseSDK()

pb.on('ready', profile => {
    console.log(`Signed in as ${profile.username}`)
})

pb.on('error', error => {
    console.error('Unable to authenticate', error)
})

Resources

  • pb.me() gets the authenticated profile; pb.me.update() updates it.
  • pb.profiles(id) returns a lazy, awaitable profile handle.
  • pb.packs(id) returns a lazy, awaitable pack handle; pb.packs.list() and .create() work with packs in bulk.
  • pb.howls(id) returns a lazy, awaitable howl handle; pb.howls.create() creates a howl and waits for its job by default.
  • pb.feeds(id).fetch() fetches a paginated feed.
  • pb.inbox manages notifications.
  • pb.invites manages authenticated invite codes and pre-signup waitlist referrals with getWaitlistReferral() and redeemWaitlistReferral().
  • pb.leaderboard, pb.store, pb.folders, pb.tags(), and pb.search() expose their corresponding API endpoints.

Howl creation accepts body: string | null; strings may contain plain text or HTML and are sanitized by the server. Authored howls use content_type: 'text', which the SDK supplies when omitted. Object bodies are rejected before a request is sent.

Resource handles do not issue a request until they are awaited:

const pack = pb.packs('00000000-0000-0000-0000-000000000000')

await pack.join() // POST /pack/00000000-0000-0000-0000-000000000000/join
const details = await pack // GET /pack/00000000-0000-0000-0000-000000000000

Configuration

const pb = new PackbaseSDK({
    baseUrl: 'https://vgs.packbase.app',
    apiKey: 'your-api-key-or-clerk-jwt',
    cache: true,
    cacheNamespace: 'current-user-id',
    cacheTtlMs: 5 * 60 * 1000,
})

baseUrl defaults to https://vgs.packbase.app.

Caching is disabled by default. When enabled, GET responses use IndexedDB in browsers and a shared in-memory cache in other runtimes. Successful writes invalidate the current namespace. Set a stable cacheNamespace for each user or session so persisted browser responses never cross account boundaries.

Read calls can override the configured policy:

await pb.packs('00000000-0000-0000-0000-000000000000', {cache: false})
await pb.packs.list({cache: true, cacheTtlMs: 30_000})
await pb.feeds('universe:home').fetch({page: 2, cache: false})

Development

bun install
bun run verify

verify runs the type check, tests, release build, and an npm package dry run. Publishing runs the same verification through prepublishOnly.

License

MIT