npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@commercejs/types

v0.3.0

Published

Unified Data Model types for CommerceJS SDK

Downloads

648

Readme

@commercejs/types

Unified Data Model for eCommerce — 20+ domain types that work across every platform.

npm TypeScript License: MIT

Overview

@commercejs/types is the shared type foundation for the entire CommerceJS ecosystem. It defines a platform-agnostic data model that adapters map to, so your application code works identically regardless of the underlying eCommerce backend.

Install

npm install @commercejs/types

What's Included

Domain Types

| Domain | Types | |--------|-------| | Product | Product, ProductVariant, ProductOption, Attribute | | Cart | Cart, CartItem, CartTotals | | Order | Order, OrderItem, OrderStatus, FulfillmentStatus | | Customer | Customer, Address, RegisterInput | | Category | Category | | Brand | Brand | | Shipping | ShippingMethod, ShippingProvider | | Payment | PaymentMethod, PaymentProvider, PaymentSession | | Search | SearchParams, SearchResult, Facet | | Wishlist | Wishlist, WishlistItem | | Review | Review, ReviewInput, ReviewSummary | | Promotion | Promotion, Coupon, DiscountType | | Return | ReturnRequest, ReturnItem, ReturnReason | | Wholesale | PriceTier, CustomerGroup, QuoteRequest | | Auction | AuctionProductMeta, Bid, PlaceBidInput | | Rental | RentalProductMeta, RentalBooking | | Gift Card | GiftCard, GiftCardTransaction | | Store | StoreInfo, Country, StoreLocation |

Adapter Interface

The CommerceAdapter interface defines the contract that every platform adapter must implement:

import type { CommerceAdapter, Product, Cart } from '@commercejs/types'

// Every adapter implements this interface
const adapter: CommerceAdapter = createSallaAdapter({ ... })

// Same API regardless of platform
const products: Product[] = await adapter.getProducts({ limit: 10 })
const cart: Cart = await adapter.getCart(cartId)

Utility Types

  • Maybe<T> — nullable type wrapper
  • LocalizedString — i18n-ready string type
  • PaginatedResult<T> — standardized pagination
  • Price / DiscountablePrice — monetary values
  • CommerceError — typed error class with error codes

Orchestrator Types

Types for multi-adapter composition:

  • AdapterDomain — union of all domain names (catalog, cart, checkout, etc.)
  • CommerceOrchestrator — orchestrator interface with capability checking
  • CompositeOrchestratorConfig — source mapping for multi-adapter setups

Provider Interfaces

| Interface | Purpose | |---|---| | PaymentProvider | Payment session lifecycle (create, get, refund) | | NotificationProvider | Multi-channel notification delivery (email, SMS, push) | | AnalyticsProvider | Event tracking, user identification, page views | | TaxProvider | Tax calculation for line items |

Documentation

Full docs at commerce.js.org

License

MIT