Store

The store's own identity: its name, its slug and its brand (what the merchant set under Settings → Brand). One anonymous read, usually at layout level, so a storefront titles, heads and foots itself with the merchant's name and never hardcodes one. Logo URLs are public. Colors are #rrggbb. Every field except name and slug may be null.

SDK module: @cartbase/storefront/api/store (from 0.8.0; on 0.7.0 call client.request("/api/store/store") with the same shape).


GET /api/store/store

  • Purpose — read the store's id, name, slug and brand.
  • Auth — anon: the store's publishable key (x-publishable-api-key).
  • RequestGET /api/store/store
  • Response 200
{
  "store": {
    "id": "1e7a4c02-9b31-4f7e-8d2a-5c6f90ab12cd",   // the store's public id (what PlatformInit mounts)
    "name": "Demo Store",
    "slug": "demo-store",
    "brand": {
      "logo_url": "https://…/brand/…/logo.png",   // or null
      "logo_square_url": null,
      "color_primary": "#111111",                  // or null
      "color_secondary": null,
      "slogan": null
    }
  }
}
  • Errors404 store_not_found when the key names no live store.
import { getStore } from "@cartbase/storefront/api/store"

export async function generateMetadata() {
  const { store } = await getStore(await getServerClient())
  return createStorefrontMetadata({ title: store.name, description: store.brand.slogan ?? undefined })
}