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

@rustgrid/sdk

v0.1.0

Published

RustGrid first-party TypeScript SDK (generated from OpenAPI, wrapped with ergonomic resources).

Readme

@rustgrid/sdk

First-party TypeScript SDK for RustGrid (HTTP).

  • Typed models generated from openapi.json
  • Ergonomic resources (rg.tickets.*, rg.projects.*, ...)
  • Automatic x-request-id propagation
  • Optional auth refresh hook
  • Tenant scoping via X-Tenant-Id

Install

pnpm add @rustgrid/sdk
# or
npm i @rustgrid/sdk

Quickstart

import { RustGrid } from "@rustgrid/sdk";

const rg = new RustGrid({
  baseUrl: "https://app.rustgrid.com",
  tenantId: "<tenant-uuid>",
  accessToken: async () => localStorage.getItem("rg_token"),
  requestId: () => crypto.randomUUID(),
  clientName: "myapp/1.0.0",
});

const me = await rg.account.me();
console.log(me.data.user_id, me.data.permissions);

const created = await rg.tickets.create({ title: "Hello", project_key: "RG" }, { idempotencyKey: crypto.randomUUID() });
console.log(created.status, created.data, created.requestId, created.etag);

Auth refresh (optional)

const rg = new RustGrid({
  baseUrl,
  tenantId,
  auth: {
    async getAccessToken() { return tokenStore.get(); },
    async onAuthError() {
      await tokenStore.refresh();
      return true; // retry once
    },
  },
});

Regenerating types

The SDK ships with a generated src/gen/schema.ts. When the backend OpenAPI changes:

cp /path/to/openapi.json ./openapi.json
pnpm gen:types
pnpm build

Pagination iterator

for await (const t of rg.tickets.iterate({ project_id: projectId, size: 50 })) {
  console.log(t.id, t.title);
}

ETag / optimistic concurrency

const res = await rg.projects.get(projectId);
const etag = res.etag; // from header
await rg.projects.update(projectId, { name: "New" }, { ifMatch: etag! });

Retry policy (idempotent + 429 aware)

Retries are off-limits for non-idempotent requests unless you provide Idempotency-Key. For idempotent methods (GET/PUT/DELETE) and POST/PATCH with Idempotency-Key, the client can retry on:

  • network errors
  • 429 Too Many Requests (honors Retry-After when present)
const page = await rg.tickets.list(
  { size: 50 },
  { retry: { maxAttempts: 3, baseDelayMs: 250 } }
);

Examples

  • examples/node-basic – Node 18+ script (env var driven)
  • examples/browser-vite – Browser demo with Vite

Release checklist

pnpm i
pnpm typecheck
pnpm build
pnpm publish:dry
# then publish (when ready):
# npm publish --access public

GitHub Actions

  • CI runs on PRs and main: typecheck, build, and publish:dry
  • Release runs on tags v* and publishes to npm (requires NPM_TOKEN secret)

See docs/RELEASING.md.