GET /api/store
Discovery document listing the available public Store API endpoints.
The GET /api/store endpoint is the entry point to the public, read-only Store API. It returns a small discovery document that names the store and lists the available endpoints, so external clients (native apps, alternate frontends, integrations) can self-configure without hard-coding paths.
The Store API exposes only data that is already publicly readable per firestore.rules (products, home-products, categories), reshaped into a stable wire format. No authentication is required, and no inventory counts or internal fields are leaked.
Request
GET /api/store HTTP/1.1| Method | GET |
| Auth | None (public) |
| Query params | None |
| Cache-Control | public, s-maxage=3600, stale-while-revalidate=86400 |
The response is cached with the CONFIG_CACHE_CONTROL header (defined in src/lib/api/store.ts), matching the slow-changing config-backed endpoints. The route itself is declared dynamic = "force-dynamic".
curl -s https://your-store.example.com/api/storeResponse
Returns 200 OK with a JSON body containing the store name, the API version, and the list of endpoints.
{
"name": "Acme Store",
"version": "v1",
"endpoints": [
"/api/store/products",
"/api/store/products/{id}",
"/api/store/categories"
]
}| Field | Type | Description |
|---|---|---|
name | string | The store's display name, from siteConfig.name (default "Acme Store"). |
version | string | The Store API version. Currently always "v1". |
endpoints | string[] | Relative paths of the available Store API endpoints. {id} is a placeholder for a product id. |
name reflects your configured store name. Change it in src/config/site.ts and the discovery document updates automatically.
Errors
On an unexpected failure the endpoint logs the error server-side and returns:
{
"error": "Internal server error"
}with status 500. Error bodies use the shared { "error": message } shape produced by the jsonError helper.
Listed endpoints
Each path in endpoints corresponds to a documented Store API resource: