products.catalog.draft@1, review@1, and publish@1 run as store Commands locally. Publication records catalog.published@1 in one owner-local transaction.
Not yet: Storefront, search, and feed still do not read the published revision. Do not call publication Stable.
Source: modules/products · npm: @86d-store/products
Installation
config.json:
Configuration
Pass options to the factory when you register the Module:number
default:"20"
Default number of products returned per page on listing endpoints.
number
default:"100"
Hard cap on
limit query parameter. Requests above this value are clamped.boolean
default:"true"
Enable inventory tracking by default for new products. Products with
trackInventory: false skip all inventory increment and decrement operations.Store endpoints
Store endpoints are public and return onlyactive products. Use them from your Storefront to browse, search, and display products.
Products
Query parameters for
GET /products
Categories
Collections
Admin endpoints
Admin endpoints require authentication and return all product statuses (draft, active, archived).
Products
Variants
Categories
Collections
Components
Add these components to your MDX Template files. The Module must be listed inconfig.json for the components to be available.
ProductCard
Displays a single product card with image, name, price, discount badge, and an optional Add to Cart button.
boolean
default:"true"
Show the Add to Cart button on the card.
FeaturedProducts
Responsive grid of featured products. Fetches its own data; no props required.
number
Maximum number of featured products to display.
string
Section heading rendered above the grid.
ProductListing
Full product listing with search, category, price, stock, and tag filters, plus sorting and pagination. Fetches its own data.
string
Pre-select a category filter on initial render.
string
Pre-fill the search query on initial render.
number
Number of products per page.
ProductDetail
Full product detail page including image gallery, variant selector, pricing, inventory status, reviews, and related products. Loaded automatically by the store’s /products/:slug catch-all route.
string
required
Product slug from the URL.
Record<string, string>
required
Route params object (for example
params.slug).RelatedProducts
Horizontal grid of related products scored by shared category and tags. Fetches its own data.
string
required
Product ID to find related products for.
number
Maximum number of related products to show.
string
Section heading.
CollectionCard
Displays a single collection card with image, name, and description.
CollectionCardData
required
Collection object with
id, name, slug, description, and image.CollectionGrid
Grid of collections with optional featured-only filtering. Fetches its own data.
string
Section heading.
boolean
When
true, only featured collections are shown.CollectionDetail
Full collection page with image, description, product count, and products grid. Loaded automatically by the store’s /collections/:slug catch-all route.
string
required
Collection slug from the URL.
Record<string, string>
required
Route params object.
StarDisplay
Read-only star rating display.
number
required
Rating value between 0 and 5.
"sm" | "md" | "lg"
default:"\"md\""
Star size.
StarPicker
Interactive star rating input for review submission.
number
required
Current rating value.
StockBadge
Inventory status badge. Displays “Out of stock”, “Only X left”, or “In stock” based on the inventory count.
number
required
Available inventory count.
ProductReviewsSection
Complete review section with rating summary, paginated review list, and a review submission form. Fetches its own data.
string
required
Product ID to show reviews for.
Types
All price fields (
price, compareAtPrice, costPrice) are stored and returned in cents. Divide by 100 to display a dollar amount. When importing products from CSV, the import pipeline converts dollar values to cents automatically.Current behavior and limits
- Store endpoints always filter to
status: "active". Admin endpoints return all statuses. - Deleting a category orphans its child categories and products rather than cascading;
categoryIdandparentIdare set toundefined. - Deleting a product cascades to all its variants. Deleting a collection cascades to collection-product links.
addProductToCollectionis idempotent. Adding a product already in a collection returns the existing link.- Inventory decrement has no floor and can go negative. Products with
trackInventory: falseskip all inventory operations. - Related products are scored by shared category (+10 points) and shared tags (+1 point each).
Related pages
- Inventory for stock records
- Collections for merchandising groups
- Checkout for the purchase path
- How commerce records relate
- Glossary
- Versioning and maturity