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

@callowayisweird/gmodstore-sdk

v0.1.0

Published

TypeScript SDK for the GModStore (Pivity) API v3

Readme

gmodstore-sdk

TypeScript SDK for the GModStore (Pivity) API v3. Zero dependencies, full type safety, auto-pagination.

Install

npm install @callowayisweird/gmodstore-sdk

Quick Start

import { GModStoreClient } from "@callowayisweird/gmodstore-sdk";

const client = new GModStoreClient({
  token: "your-personal-access-token",
  tenant: "gmodstore.com",
});

// Get the authenticated user
const me = await client.me.get();
console.log(me.user.name);

// Get a user by ID
const user = await client.users.get("uuid");
console.log(user.steamId);

// Find users by Steam ID
const page = await client.users.list({
  filter: { steamId: [76561198000000000] },
});
console.log(page.data);

Pagination

List methods return a Page<T> that supports async iteration:

// Iterate through all pages automatically
for await (const purchase of client.products.purchases.list("product-id")) {
  console.log(purchase.userId);
}

// Or work with pages manually
const page = await client.users.list({ perPage: 10 });
console.log(page.data);
console.log(page.hasNextPage);

if (page.hasNextPage) {
  const next = await page.getNextPage();
}

Error Handling

Errors are structured by HTTP status:

import { NotFoundError, RateLimitError, BadRequestError } from "@callowayisweird/gmodstore-sdk";

try {
  await client.users.get("nonexistent");
} catch (e) {
  if (e instanceof NotFoundError) {
    console.log("User not found");
  }
  if (e instanceof RateLimitError) {
    console.log(`Retry after ${e.retryAfter} seconds`);
  }
  if (e instanceof BadRequestError) {
    console.log(e.errors); // { field: ["error message"] }
  }
}

429 and 503 errors are automatically retried with exponential backoff (up to 3 retries).

Rate Limits

Rate limit info is available after any request:

const user = await client.users.get("uuid");
console.log(client.rateLimit);
// { limit: 300, remaining: 299, reset: 1711548000 }

Resources

| Resource | Methods | |----------|---------| | client.me | get() | | client.me.tokens | list(), create(), get(), update(), delete() | | client.users | list(), batch(), get(), teams(), products(), purchases(), bans() | | client.users.badges | list(), create(), delete() | | client.teams | list(), batch(), create(), get(), update(), delete(), users(), products() | | client.teams.webhooks | list(), create(), get(), update(), delete(), test(), getSecret(), updateSecret(), attempts(), resend() | | client.teams.webhookMessages | list(), get(), attempts() | | client.products | list(), batch(), get(), tickets() | | client.products.coupons | list(), create(), get(), update(), delete() | | client.products.purchases | list(), create(), get(), update() | | client.products.reviews | list(), get() | | client.products.versions | list(), create(), get(), update(), delete(), download() | | client.products.media | list(), create(), get(), update(), delete(), uploadBackground(), uploadPageHeader(), uploadBigHeader(), uploadListingHeader() | | client.tickets | batch(), get(), update(), uploadLog() | | client.tickets.messages | list(), create(), get(), update(), delete(), restore() | | client.tickets.messages.revisions | list(), get() | | client.tickets.attachments | list(), create(), get(), delete() | | client.tickets.tags | list(), create(), delete() | | client.permissions | list(), batch(), create(), get(), update(), delete() | | client.twoFactor | exchangeTotp() |

Configuration

const client = new GModStoreClient({
  // Required
  token: "your-personal-access-token",

  // Optional
  tenant: "gmodstore.com",        // Scope to a specific marketplace
  baseUrl: "https://api.pivity.com", // Custom base URL
  maxRetries: 3,                   // Retry attempts for 429/503
  fetch: customFetch,              // Custom fetch implementation
});

Tenant Scoping

By default, requests are not scoped to a marketplace. Pass tenant to filter:

// Only GModStore resources
const client = new GModStoreClient({ token: "...", tenant: "gmodstore.com" });

// Only Rust resources
const client = new GModStoreClient({ token: "...", tenant: "rust.pivity.com" });

File Uploads

Endpoints that accept files use FormData:

// Upload a product version
const form = new FormData();
form.append("name", "v1.0.0");
form.append("changelog", "Initial release");
form.append("releaseType", "stable");
form.append("file", fileBlob);

const version = await client.products.versions.create("product-id", form);

License

MIT