Node SDK
BetaUse the official Getme Node SDK for TypeScript and JavaScript integrations.
Getme Node is the official JavaScript and TypeScript client for Getme developer APIs.
Installation
npm install @getme-tech/getme-node
Node.js 20 or newer is required.
Source code: github.com/getme-tech/getme-node
Quick start
import {GetmeClient} from "@getme-tech/getme-node";
const getme = new GetmeClient({
apiKey: process.env.GETME_API_KEY,
});
const sites = await getme.sites.list();
const products = await getme.products.list({limit: 10});
console.log(sites.data.map((site) => site.name));
console.log(products.data.map((product) => product.name));
GETME_API_KEY should contain an app-install access token such as gmat_test_... or gmat_live_....
Pagination
List endpoints use cursor pagination:
const firstPage = await getme.sites.list({limit: 25});
const lastSite = firstPage.data.at(-1);
if (firstPage.has_more && lastSite) {
const nextPage = await getme.sites.list({
limit: 25,
cursor: lastSite.id,
});
console.log(nextPage.data.length);
}
For full scans, use auto-paging:
for await (const site of getme.sites.listAutoPaging({limit: 100})) {
console.log(site.id, site.name);
}
for await (const product of getme.products.listAutoPaging({limit: 100})) {
console.log(product.id, product.name);
}
The SDK sends cursor as starting_after. Pagination primitives are shared by resources so future list endpoints use the same behavior.
Commerce catalog
const product = await getme.products.create({
name: "Coffee",
sku: "COF-001",
status: "draft",
});
await getme.products.update(product.id, {status: "active"});
await getme.products.archive(product.id);
await getme.categories.create({name: "Menu", type: "product"});
await getme.brands.create({name: "Acme"});
await getme.services.create({name: "Consulting"});
Mutating resource methods generate an idempotency key automatically unless you provide one.
Website source
Create a standalone site directly from a complete custom source tree when no live site or base-theme selection exists:
const custom = await getme.sites.development.createFromSource({
name: "Custom storefront",
message: "Initial source",
files: customThemeFiles,
});
console.log(custom.site_id, custom.id, custom.source_revision);
The API validates the full archive before creating the draft. and intentionally identify the same standalone development session. Subsequent source writes, previews, and publish requests use the existing development-session methods.