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

@usenubis/sdk

v0.2.0

Published

Official Nubis JavaScript and TypeScript SDK

Readme

Nubis JavaScript / TypeScript SDK

Official JavaScript and TypeScript SDK for Nubis.

Built for production teams that want:

  • fast onboarding with clean, resource-based APIs
  • broad endpoint coverage generated from Nubis product APIs
  • runtime-safe HTTP behavior (timeouts, retries, auth hooks, normalized errors)

Install

npm install @usenubis/sdk

Quick Start

import { NubisClient } from "@usenubis/sdk";

const client = new NubisClient({
  apiKey: process.env.NUBIS_API_KEY,
  baseUrl: "https://nubis-core.onrender.com",
});

const orgs = await client.orgs.list();
console.log(orgs);

const projectId = "proj_123";
const vm = await client.vms.create(projectId, {
  name: "api-server",
  size: "s-1vcpu-1gb",
  region: "nyc1",
  image: "ubuntu-24.04-x64",
  ssh_keys: [],
});

console.log(vm);

Authentication

Use either a static API key or a dynamic token getter.

const client = new NubisClient({
  getToken: async () => {
    // Example: rotate a short-lived token from your auth layer
    return process.env.NUBIS_ACCESS_TOKEN ?? null;
  },
});

getToken takes precedence over apiKey when both are provided.

High-Level API Surface

NubisClient includes grouped resource APIs for common workflows:

  • client.orgs
  • client.projects
  • client.vms (alias: client.instances)
  • client.kubernetes
  • client.databases
  • client.networks
  • client.firewalls
  • client.billing
  • client.account
  • client.domains
  • client.storage
  • client.support
  • client.admin

Example admin calls:

const hasAdminAccess = await client.admin.verifyAccess();
if (hasAdminAccess) {
  const taxRates = await client.admin.taxRates();
  console.log(taxRates);
}

Raw Requests for Edge Cases

If you need a route before an ergonomic wrapper lands, use client.raw directly:

const { data, response } = await client.raw.get("/api/v1/status", {
  params: { verbose: true },
});

console.log(response.status, data);

Error Handling

The SDK throws HttpError for both HTTP and transport failures:

import { HttpError, isHttpError } from "@usenubis/sdk";

try {
  await client.projects.get("org_123", "proj_123");
} catch (error) {
  if (isHttpError(error)) {
    console.error("status:", error.status);
    console.error("message:", error.message);
    console.error("body:", error.body);
  } else {
    console.error(error);
  }
}

Reliability Defaults

  • default timeout: 30s
  • default retries: 2 (idempotent methods only)
  • automatic bearer auth header when apiKey or getToken is configured
  • configurable global onError callback

Runtime Compatibility

The SDK is ESM-first and works in modern JavaScript runtimes that provide fetch, including:

  • Node.js (18+)
  • Bun
  • browser environments
  • edge runtimes

Type Exports

The package exports:

  • NubisClient
  • HttpClient
  • HttpError
  • generated API types from src/generated/types.ts

SDK Generation and Development

Generated files in src/generated are synced from the current frontend API layer:

npm run generate
npm run build

Useful scripts:

  • npm run generate regenerates src/generated/*
  • npm run build regenerates + TypeScript compile check
  • npm run check alias for full build check

Versioning and Release

  • bump version in package.json
  • run npm run build
  • publish with your standard npm release workflow

License

MIT. See LICENSE.md.

Related SDK

Need Rust? See the Nubis Rust SDK README in:

  • ../sdk-rust/README.md