Node SDK

Call the revenexx API from server-side JavaScript with a typed client that handles auth, requests, and responses.

@revenexx/node is the typed client for the revenexx API built for server-side JavaScript: Node back ends, background jobs, and serverless functions. It's the same client model as the Web SDK — configure the endpoint, your tenant, and a credential once, then call methods on a service — packaged for require and the Node runtime. Because it runs on a trusted server, it usually authenticates with a machine-to-machine API key.

Status: shipped.

Install

npm
npm install @revenexx/node

Configure the client

Create a Client, point it at the API, set your tenant, and add a credential.

Node
const { Client } = require('@revenexx/node');

const client = new Client()
  .setEndpoint('https://api.revenexx.com')
  .setTenant('<TENANT_SLUG>')
  .setApiKeyAuth('rvxk_...');

The client supports the full public auth contract:

MethodHeader it setsWhen to use it
setApiKeyAuth(key)X-Revenexx-Api-KeyServer-to-server. Created in the customer console. Keep it on the server.
setBearerAuth("Bearer <token>")AuthorizationA user token from ID or a personal access token. Pass the value including the Bearer prefix.
setTenant(slug)X-Revenexx-TenantAlways — selects which tenant the request applies to.

The tenant slug rides on every request as the X-Revenexx-Tenant header. There's one gateway, https://api.revenexx.com — no per-region host to configure.

Make a call

Construct a service with the client, then call its methods. Each method takes a single params object and returns a promise.

Node
const { Client, Products } = require('@revenexx/node');

const client = new Client()
  .setEndpoint('https://api.revenexx.com')
  .setTenant('<TENANT_SLUG>')
  .setApiKeyAuth('rvxk_...');

const products = new Products(client);

const result = await products.productsList();
const product = await products.productsGet({ id: '<PRODUCT_ID>' });

The package ships full TypeScript definitions. Response types live in the Models namespace, including nullable fields (typed as | null):

Node
import { Client, Customers, type Models } from "@revenexx/node";

const customers = new Customers(client);

const address: Models.Address = await customers.customersAddressesGet({
  id: "<ADDRESS_ID>",
});

Handle errors

Failed calls throw a RevenexxAPIRevenexxException carrying the message, an error code, and the raw response.

Node
const { RevenexxAPIRevenexxException, Products } = require('@revenexx/node');

const products = new Products(client);

try {
  await products.productsGet({ id: 'missing' });
} catch (error) {
  if (error instanceof RevenexxAPIRevenexxException) {
    console.error(error.code, error.message);
  }
}

Web SDK or Node SDK?

Both call the same API. Use @revenexx/node for code that only ever runs on a server. Use @revenexx/sdk when the same client also needs to run in the browser or an edge runtime — it works in Node too, so a shared codebase can standardize on it.

What's available

The client exposes a service per API area, including Customers, Products, Orders, Carts, Payments, Shipping, Prices, Inventories, and Storage. The exact set of services and methods is generated from your tenant's API, so it tracks what your tenant exposes. Browse the typed methods in your editor's autocomplete after installing, or read the per-tenant API at /v1/openapi.json.

Where to go next

Was this page helpful?