Node SDK
@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 install @revenexx/node
Configure the client
Create a Client, point it at the API, set your tenant, and add a credential.
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:
| Method | Header it sets | When to use it |
|---|---|---|
setApiKeyAuth(key) | X-Revenexx-Api-Key | Server-to-server. Created in the customer console. Keep it on the server. |
setBearerAuth("Bearer <token>") | Authorization | A user token from ID or a personal access token. Pass the value including the Bearer prefix. |
setTenant(slug) | X-Revenexx-Tenant | Always — 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.
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):
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.
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
- Web / JavaScript SDK — the browser and edge build of the same client.
- PHP SDK — the same client, from PHP.
- API Explorer — browse and try every endpoint in the browser.
- Authentication — get a user token to pass to
setBearerAuth.