# categories manifest member

> The categories member is an array of strings, lowercase by convention, naming the store sections a web app belongs in; browsers render nothing from it.

The `categories` manifest member is an array of strings naming the store sections a web app belongs in, such as
`"productivity"` or `"games"`. The W3C Application Information registry defines it as a hint to
catalogs and stores; a browser engine changes nothing about how the app
installs, launches, or renders.

MDN marks browser compatibility as not applicable because stores, not browsers, use the member, and
the [browser-compat-data `manifests/webapp` directory](https://github.com/mdn/browser-compat-data/tree/main/manifests/webapp) (github.com) has no `categories.json` file.
Chromium's manifest parser (`manifest_parser.cc`) has no handling for the member, and MDN notes that
other browsers may parse it without effect.
Store packagers such as PWABuilder read the array
when they generate listing metadata for the Microsoft Store or a Play Store wrapper.

## Member

| Property | Value |
|---|---|
| Type | array of strings. The registry publishes a list of known values, including `business`, `education`, `entertainment`, `finance`, `food`, `games`, `health`, `kids`, `lifestyle`, `music`, `news`, `productivity`, `shopping`, `social`, `sports`, `travel`, `utilities`, and `weather`. Other strings are legal; stores map them to their own taxonomy or ignore them. |
| Default | an empty array. A store that finds no usable category classifies the app itself. |
| Example value | `["food", "health", "lifestyle"]`. |

The registry encourages authors to write lowercase values. It defines no comparison rule. Chromium does not read the member, so a value that is not an array does not
affect the rest of the manifest.

A store is free to list the app under a section the
manifest did not name, and a category the manifest names is not shown anywhere in the installed
app or in the browser's install dialog.

:::note
Chromium's manifest parser ([`manifest_parser.cc`](https://chromium.googlesource.com/chromium/src/+/main/third_party/blink/renderer/modules/manifest/manifest_parser.cc)) and its `Manifest` mojom definition contain no handling of `categories`, and DevTools' [`AppManifestView.ts`](https://github.com/ChromeDevTools/devtools-frontend/blob/main/front_end/panels/application/AppManifestView.ts) has no row for it. The member is never read, so a value of the wrong type, such as `"categories": "games"`, produces no entry under **Errors and warnings**.
:::

## Examples

The member has no runtime API. Validate its value in the deployed manifest.

### Declaring several store sections for one app

A meal-planning app fits more than one section. Listing three categories lets a store that
supports multi-category listings surface it in each; a store that supports one category takes
the first it recognizes.

```json
{
  "name": "Meal Planner",
  "short_name": "Meals",
  "start_url": "/",
  "display": "standalone",
  "categories": ["food", "health", "lifestyle"]
}
```

Keep the first entry the one the app most belongs to: a packager that has to pick a single
primary category has nothing else to go on.

### Validating the shipped value in a build step

There is no API that reports whether a browser or a store acted on the member, so the useful
check is a build-time or test-time assertion against the manifest you deploy. The function
lowercases each entry, following the registry's lowercase recommendation, and flags values outside the registry's
known list.

```js
const KNOWN = new Set([
  'beauty', 'books', 'books & reference', 'business', 'cars', 'dating',
  'design', 'developer', 'developer tools', 'development', 'education', 'entertainment',
  'events', 'fashion', 'finance', 'fitness', 'food', 'fundraising',
  'games', 'government', 'graphics', 'graphics & design', 'health', 'health & fitness',
  'kids', 'lifestyle', 'magazines', 'medical', 'multimedia', 'multimedia design',
  'music', 'navigation', 'network', 'networking', 'news', 'personalization',
  'parenting', 'pets', 'photo', 'photo & video', 'politics', 'productivity',
  'reference', 'security', 'shopping', 'social', 'social networking', 'sports',
  'transportation', 'travel', 'utilities', 'video', 'weather',
]);

export function checkCategories(manifest) {
  const raw = manifest.categories;
  if (raw === undefined) return { declared: [], unknown: [] }; // optional member
  if (!Array.isArray(raw)) throw new Error("categories must be an array of strings");
  const declared = raw.map((c) => String(c).toLowerCase());
  const unknown = declared.filter((c) => !KNOWN.has(c));
  return { declared, unknown };
}
```

An absent member is a valid manifest, so the function succeeds with an empty list; an unknown value is reported, not rejected, because stores accept free-form strings.

### Reading the value from the page's own manifest

For a settings or "about" page that mirrors store metadata, fetch the manifest the document
links to and read the array. The fallback branch handles pages that ship no manifest link.

```js
async function declaredCategories() {
  const link = document.querySelector('link[rel="manifest"]');
  if (!link) return []; // no manifest linked from this document
  const manifest = await fetch(link.href).then((r) => r.json());
  return Array.isArray(manifest.categories) ? manifest.categories : [];
}
```

Reading the manifest confirms the declared categories. It cannot tell whether a store listed
the app under those sections.

## See also

- [description manifest member](/reference/manifest/description/)
- [screenshots manifest member](/reference/manifest/screenshots/)
- [Distribute a PWA via app stores](/guides/app-store-distribution/)
- [Web App Manifest - Application Information: categories member](https://w3c.github.io/manifest-app-info/#categories-member) (w3c.github.io)
- [categories](https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Manifest/Reference/categories) (developer.mozilla.org)