Storefront SDK
Our React micro-framework for building Ecomiq stores with SSR routes, Storefront API, checkout, and Cloudflare Workers deployment.
@ecomiq/storefront is our micro-framework for building Ecomiq stores with
React. It generates routes and the SSR server from pages/; its loaders and
server functions call the Storefront API.
It also includes providers and hooks for store settings, menus, and cart, plus flows for checkout, authentication, customer accounts, and CMS pages.
The CLI handles the local environment, production builds, and deployment to Cloudflare Workers.
You maintain this project structure:
The CLI generates .ecomiq/ with the router, SSR server, and build configuration.
Do not edit or commit that directory.
What it includes
- SSR routes generated from
pages/, with a global layout and file-based parameters. - Loaders and server functions that call Storefront API through
serverApi. - Providers and hooks for settings, menus, cart, and authentication.
- Included flows for checkout, CMS pages, and the account area.
- Commands for development, builds, cleanup, and deployment to Cloudflare Workers.
Public imports
| Import | Use it for |
|---|---|
@ecomiq/storefront | Pages, layout, data, providers, hooks, types, and authentication. |
@ecomiq/storefront/config | defineConfig and complete configuration types. |
@ecomiq/storefront/ui | Button, Card, Badge, Skeleton, Separator, and other bases. |
@ecomiq/storefront/styles.css | Framework styles; the CLI includes them automatically. |
The @ecomiq/storefront/internal/* imports are for code generated in .ecomiq/.
Do not use them in a store.
Basic workflow
- Install the package.
- Set the store
domainin configuration. - Create pages with
definePage. - Run
ecomiq dev. - Publish with
ecomiq deploy.
One store per project
domain identifies the store consumed by the project.
The name, SEO, currency, menus, and checkout rules come from
Storefront API through
GET /v1/settings.