TypeScript SDK
A 100% type-safe TypeScript SDK for the CommerceEngine Storefront API — automatic token management, universal compatibility (browser, Node.js, Next.js, TanStack Start), and production-ready error handling.Package
@commercengine/storefront
Universal TypeScript SDK with first-class bindings for React, Next.js, TanStack Start, and Node.js.
Pick your integration
React
Context providers, hooks, and component patterns for React SPAs.
Next.js
SSR, Server Actions, static rendering, and cookie-backed sessions.
TanStack Start
Server functions, route loaders, and pre-rendering.
Node.js
Express middleware, background jobs, and server-side patterns.
Installation
- npm
- pnpm
- yarn
Quick Start
That’s it — you’re making API calls. The SDK handles token refresh, error typing, and session management automatically.
Learn More
Client Overview
Public/session split, available clients, and the SDK architecture.
Configuration
All config options, environments, custom base URLs, and debugging.
Token Management
Automatic token refresh, storage options, and auth lifecycle.
Type Safety
Auto-generated types, IntelliSense, and the
{ data, error } pattern.