The official JavaScript and TypeScript SDK for the NodeRings API. It covers the whole public API: virtual machines, DNS, firewalls, snapshots and backups, game servers, IP address management, the marketplace, billing, access control, support tickets, and the provider side for hosts who sell on NodeRings. That is 485 operations in 69 services, all typed.
npm install noderingsIt has no dependencies and uses only web-standard APIs (fetch, AbortController,
crypto.randomUUID), so it runs on Node.js 20+, Vercel (serverless and edge functions),
Cloudflare Workers, Deno and Bun; CI tests each of them. ESM and CommonJS builds are included.
import { Distro, NodeRings, OperationStatus } from "noderings";
const client = new NodeRings(); // reads NODERINGS_TOKEN
// Every virtual machine, page by page.
for await (const vm of client.virtualMachine.listVirtualMachinesAll()) {
console.log(vm.hostname, vm.operationStatus, vm.ipv4);
}
// Order a server and wait until it runs.
const created = await client.virtualMachine.createVirtualMachine({
hostname: "web-1",
planId, // from client.marketplace.listProviders(...)
regionId,
distro: Distro.UBUNTU_26_04,
sshKeyIds: [sshKeyId],
});
const vm = await client.waitForVirtualMachineStatus(created.virtualMachine!.id!, OperationStatus.STARTED);
// Give it a DNS name.
await client.dnsRecord.upsertDnsRecord(zoneId, {
record: { name: "web-1", type: "A", ttl: 300, rdata: [vm.ipv4!] },
});examples/node/quickstart.ts is a complete program.
The SDK works the same in Node.js serverless functions and on the Edge runtime. Set
NODERINGS_TOKEN in the project's environment variables and use it in a route handler:
// app/api/servers/route.ts
import { NodeRings } from "noderings";
export const runtime = "edge"; // or leave it out for a Node.js function
export const dynamic = "force-dynamic";
export async function GET() {
const client = new NodeRings();
const { virtualMachines = [] } = await client.virtualMachine.listVirtualMachines();
return Response.json(virtualMachines.map((vm) => ({ hostname: vm.hostname, ipv4: vm.ipv4 })));
}examples/vercel-next has the full route, with ordering a server. Keep
the token on the server (route handlers, server actions, server components); never ship it to the
browser.
Create a service account in the NodeRings console under Organization → Access Control →
Service accounts, give it the permissions your program needs, and pass its token to the
client, or set NODERINGS_TOKEN. Keep the token out of source code.
| Option | Environment variable | Use |
|---|---|---|
token |
NODERINGS_TOKEN |
The service account token. Required. |
organizationId |
NODERINGS_ORGANIZATION_ID |
Act in another organization the token can access (the X-Organization-ID header). By default the token's own organization is used. |
baseURL |
NODERINGS_BASE_URL |
Another API endpoint. The default is https://api.noderings.com. |
timeout |
Milliseconds per attempt. Default 60 000. | |
maxRetries, minBackoff, maxBackoff |
Retry count and backoff in milliseconds (default 3, 500, 10 000). | |
userAgent |
Add your product to the User-Agent, for example "my-app/1.2". |
|
fetch |
Your own fetch, for proxies or tests. |
|
onRequest |
Called once per HTTP attempt with the method, path, status and duration, for logging or metrics. It never sees tokens or bodies. |
Every method also takes options as its last argument: { signal, timeout, maxRetries, headers }.
A few user-account operations (sign-in, MFA, linked identities, the OAuth authorize step) only work with a signed-in user's session, not with a service account token.
Every area of the API is a property of the client, and every method is one API operation, named as in the API description in camelCase.
| Area | Properties |
|---|---|
| Compute | virtualMachine (create, start, stop, restart, reinstall, delete, tags, firewall, backups, extra IPs, console), snapshot, backup, vmTemplate, cloudInitUserData, cloudInitTemplate, instantApp, metadata (distro catalog) |
| Game servers | gameServer (lifecycle, files, databases, backups, schedules, allocations), gameServerTemplate |
| DNS | dnsZone, dnsRecord, dnssec, domain |
| Network | firewall (rulesets, rules, address groups), ipam |
| Marketplace | marketplace (regions, plan codes, offers, plans), region, plan, clientProviderReview |
| Billing | subscription, addon, invoice, payment, paymentMethod, refund, credit, coupon, usageReport, exchangeRate |
| Organization and access | organization, user, serviceAccount, group, role, permission, invite, secret, environmentVariable, oauth2 |
| Monitoring | monitoring, businessMonitoring, metric, metricsCredential, clientDashboard |
| Support | ticket, chat, roadmap |
| Providers (hosts selling on NodeRings) | providerPlan, providerStorefront, providerCustomer, providerDashboard, providerDashboardPlansTab, providerReview, providerNetwork, providerConnect, providerOnboarding, providerTicketNotification, payoutConfiguration, payoutInvoice, manualPayout, liveValidation, preflight, platform, node, nodePlacement, agent, hookScript |
For an operation the SDK does not have yet, client.request("GET", "/v1/...", { query, body })
sends a request with the same authentication, retries and errors and returns the JSON.
Arguments. Path parameters come first. Then one object: the request body for operations that
send one, or the query parameters for those that take them. Its properties are the API's own JSON
names, so what you pass is exactly what is sent: deleteDnsZone(id, { force: true }).
Types. Requests and responses are plain objects, typed by interfaces that use the API's JSON
names. Every property is optional, because the API leaves out fields that have their zero value
(vm.tags ?? []). Timestamps are RFC 3339 strings and 64-bit numbers are strings, as the API
sends them, so nothing loses precision.
Enums. Each enum is a constant object and a type: OperationStatus.STARTED is
"OPERATION_STATUS_STARTED". The types also accept any string, so a value the API adds later
does not break your build.
Paging. List operations that take page and pageSize have an ...All method: an async
iterator over every result, 100 rows per page. It stops when you break.
Errors. API errors are APIError subclasses by HTTP status: BadRequestError,
AuthenticationError, PermissionDeniedError, NotFoundError, ConflictError,
RateLimitError, QuotaExceededError (a plan limit such as the number of servers, with
.reason like VM_LIMIT_REACHED) and InternalServerError. Each has .status, .code (the
API's status code), .apiMessage, .details and .isBusy (another operation on the resource
is still running; try again later). Network failures throw APIConnectionError and
APITimeoutError.
Retries. A request is retried when the API rate-limits it (HTTP 429, unless a plan quota is
used up, honoring Retry-After), and on connection errors and HTTP 502, 503 and 504 when it is
safe to repeat: reads, PUT, DELETE, and creates that carry an idempotency key.
Idempotency. Creates that take an idempotency key (virtual machines, game servers) get a new
UUID automatically, so a retry never orders a second server. Pass idempotencyKey yourself to
retry a create safely after your program restarts. Your object is not changed.
Waiting. waitForVirtualMachineStatus, waitForVirtualMachineDeleted and the general
waitForVirtualMachine(id, until) poll until a condition holds (interval and timeout in
milliseconds, and a signal). They throw WaitTimeoutError with the last state read.
| Suite | What it checks |
|---|---|
npm test |
Calls every one of the 485 generated methods against a fake API and checks the HTTP method, the path and its escaping, every query parameter's name, every body field's name and the auth headers against the API description. Also covers retries, Retry-After, timeouts, aborts, errors, idempotency keys, paging and waiting, and runs the built bundle inside Vercel's Edge runtime VM (@edge-runtime/vm). |
npm run test:runtimes |
The built package on Deno, Bun and Cloudflare Workers (workerd, through miniflare): paging, retries, typed errors and idempotency keys. |
npm run test:live |
Against the real API: every read that needs no ID; SSH keys, a DNS zone with records, firewall rulesets and rules, and cloud-init data created and deleted; and the SDK calling the real API from inside the Edge runtime VM and from a Cloudflare Worker. With NODERINGS_TEST_BILLED=1, a virtual machine is created, started, stopped, started, restarted, tagged, snapshotted, given a firewall and deleted. |
The live suite runs nightly in CI. See CONTRIBUTING.md.
The SDK is generated from api/openapi.json by
scripts/generate.mjs. A weekly job fetches the published description
and opens a pull request when it changed. Releases follow semantic versioning;
while the version is 0.x, a minor release can rename a field when the API itself renames it, and
CHANGELOG.md says so. RELEASING.md describes how a release is published.
Not included: the payment-provider webhook endpoint (it receives calls, it does not make them) and NodeRings staff-only enforcement endpoints.
Python SDK · Go SDK · n8n node · Terraform provider · Pulumi