Skip to content
Guides

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.

ecomiq.config.js
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

FieldRequiredUse
domainYesIdentity sent as x-Store-Domain; accepts a slug or domain.
apiNoStorefront API URL, version, additional headers, and timeout.
themeNoVisual variables that override the design system.
devNoPort, local API, runtime, and HTTPS for ecomiq dev.
deployNoCloudflare Worker name and routes.
envNoNon-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

FieldDefault
api.baseUrlhttps://storefront.ecomiq.pe
api.versionv1
api.timeoutMs10000 ms
dev.port3000
dev.runtimenode
dev.httpsfalse
deploy.targetcloudflare
deploy.nameA 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.

On this page