Architecture
Unified Types
The @commercejs/types package provides a single data model that works across every eCommerce platform.
The @commercejs/types package is the foundation of CommerceJS. It defines TypeScript interfaces for every eCommerce domain β products, carts, orders, customers, payments, and more.
Why Unified Types?
Every eCommerce platform represents data differently. Salla calls it name, Shopify calls it title. Salla uses regular_price, Shopify uses price. The unified types normalize these differences into a single vocabulary.
// Same Product type, regardless of source
interface Product {
id: string
name: LocalizedString
slug: string
description: LocalizedString
price: DiscountablePrice
variants: ProductVariant[]
images: Image[]
// ... more fields
}
Adapters map platform-specific data into these types, so application code never deals with platform differences directly.
Domain Coverage
Domain Coverage
Unified Type System
Implemented Domains
πCatalog
πCart
π¦Orders
π€Customers
π³Checkout
βReviews
π·Brands
πCountries
β€οΈWishlist
πPromotions
πReturns
πͺStore
Planned Domains
πGift Cards
πLocations
πWholesale
π¨Auctions
Implemented
Planned
Documentation Asset // COMMERCE_JS_TYPES_01