Configuration
The real ecomiq.config.js reference for store, API, theme, development, and deployment.
The CLI loads ecomiq.config.js from the project root and validates its default
export. defineConfig is recommended because it adds types and runs the same
validation.
import { defineConfig } from "@ecomiq/storefront/config";
export default defineConfig({
domain: "marketplace",
api: {
baseUrl: "https://storefront.ecomiq.pe",
version: "v1",
timeoutMs: 10_000,
},
theme: {
primary: "oklch(0.45 0.15 165)",
primaryForeground: "white",
radius: "0.75rem",
},
dev: {
port: 3000,
runtime: "node",
https: true,
},
deploy: {
target: "cloudflare",
name: "andina-market",
routes: [{ pattern: "shop.example.com", custom_domain: true }],
},
env: {
PUBLIC_SUPPORT_EMAIL: "support@example.com",
},
});Fields
| Field | Required | Use |
|---|---|---|
domain | Yes | Identity sent as x-Store-Domain; accepts a slug or domain. |
api | No | Storefront API URL, version, additional headers, and timeout. |
theme | No | Visual variables that override the design system. |
dev | No | Port, local API, runtime, and HTTPS for ecomiq dev. |
deploy | No | Cloudflare Worker name and routes. |
env | No | Non-secret variables written to the Worker's vars. |
domain is not the store name, editorial slug, or SEO configuration. Those
values come from /v1/settings.
API and defaults
| Field | Default |
|---|---|
api.baseUrl | https://storefront.ecomiq.pe |
api.version | v1 |
api.timeoutMs | 10000 ms |
dev.port | 3000 |
dev.runtime | node |
dev.https | false |
deploy.target | cloudflare |
deploy.name | A normalized version of domain |
dev.apiBaseUrl overrides api.baseUrl only in development.
dev.runtime: "workerd" emulates Cloudflare locally; build and deploy always
use workerd.
For HTTPS, use an automatic certificate or provide PEM files:
dev: {
https: true,
}dev: {
https: {
cert: "./certs/localhost.pem",
key: "./certs/localhost-key.pem",
},
}Theme
theme accepts only primary, primaryForeground, background, foreground,
accent, and radius. The CLI turns them into CSS variables.
What reaches the browser
The client bundle receives only:
type PublicEcomiqConfig = {
domain: string;
theme?: EcomiqThemeConfig;
};api, dev, deploy, and env remain on the server.
Do not store secrets in env
env is written as plain text to the generated Wrangler configuration. Use
Cloudflare Secrets for keys, tokens, and BETTER_AUTH_SECRET.