/**
 * Public read-only demo. When a request carries the `x-demo: 1` header, it is
 * served the DEMO_SHOP merchant's (seeded) data — no Shopify session needed —
 * and all writes are rejected. This powers the public /admin?demo=1 preview so
 * anyone can explore the app without installing it.
 */
export const DEMO_SHOP = process.env.DEMO_SHOP_DOMAIN || 'demo.trackopia';

/** True when this request is a public demo request. */
export function isDemoReq(req: { headers?: Record<string, unknown> }): boolean {
  return req?.headers?.['x-demo'] === '1';
}
