Catalog
products, categories, search, and store resource methods.
Open in
Every method returns Promise<Result<T>> and accepts an optional final
options argument. Examples use the
Next.js storekit instance, but the methods are identical on every client.
products
products.list(query?, options?)
List products with keyset pagination.
const { data } = await storekit.products.list({
limit: 24, // 1–100, default 20
cursor, // from a previous nextCursor
categorySlug: "shoes", // includes the subtree
tagSlug: "sale",
status: "active",
});
// data → { data: Product[], nextCursor, hasMore }products.get(slug, options?)
Fetch a single active product by slug. NOT_FOUND error if it doesn't exist.
const { data: product, error } = await storekit.products.get("air-zoom");products.listAll(query?, options?)
Auto-paginate every page into one array. Best for build-time generation.
const { data: all } = await storekit.products.listAll({ categorySlug: "shoes" });A Product carries product-level attributes — a Record<string, string> of
shared specs/facets for the whole product (e.g. brand, material) for spec
tables and filtering. It also includes variants[], each with
price/compareAtPrice (strings), inventoryQty, and its own attributes
(the per-variant selectable options, e.g. size, color).
categories
categories.list(options?)
Flat list of all categories, each with a parentId — build the tree
client-side.
const { data: categories } = await storekit.categories.list();categories.get(slug, query?, options?)
A category plus its products (paginated over the subtree).
const { data } = await storekit.categories.get("footwear", { limit: 24, cursor });
// data → { category, products: { data, nextCursor, hasMore } }Each Category also carries attributes — a Record<string, string> of shared
specs/facets for the category (e.g. Department, Season), mirroring a
product's product-level attributes.
search
search is callable directly — not a namespace.
search(query, options?)
const { data } = await storekit.search({
q: "running shoes", // required
limit: 20,
cursor,
categorySlug: "footwear",
inStock: true,
});
// data → { results, facets, nextCursor, hasMore, total }facets gives category counts, a price range, and in/out-of-stock counts for
building filter UI. See Pagination & filtering.
store
store.get(options?)
Store configuration: name, currency, websiteConfig, operating hours, delivery
charges, tax config, and isTakingOrders.
const { data: store } = await storekit.store.get();store.outlets(options?)
Active outlets for the store.
const { data } = await storekit.store.outlets();
// data → { outlets: Outlet[] }Pass { outletId } in a method's options to scope that call to a specific
outlet.