# id manifest member

> id identifies an installed PWA independently of start_url, so the launch URL can change without the browser treating the manifest as a second app.

The `id` manifest member identifies a web app independently of its launch URL. Before this member existed, browsers derived the identity from other values, usually `start_url`. Changing the launch URL therefore made the manifest describe a new app whose installation sat beside the old one. With `id` set, `start_url` can change while the identity stays fixed.

Chrome 96, Edge 96, Samsung Internet 17.0, Safari on iOS 16.4, and Safari 17 on macOS process
the member (BCD `manifests.webapp.id`). Firefox parses the property but it has no effect (BCD note). Browsers that ignore `id` keep their previous
identity rule, so adding the member leaves installs on those browsers intact.

## Member

| Property | Value |
|---|---|
| Type | string, parsed as a URL against the origin of `start_url`. A value that resolves to another origin is rejected; Chromium logs `property 'id' ignored, should be same origin as document.` and falls back to the default. |
| Default | the resolved `start_url`. If `id` is absent, empty, or unparsable, the identity remains tied to the launch URL. Set a valid value to separate them. |
| Example value | `"/?homescreen=1"`, which for an app on `https://example.com` resolves to `https://example.com/?homescreen=1`. |

When processing a manifest, the browser compares the resolved value against the identities of
installed apps. A match means "update this app"; no match means "a new app". Because the comparison
is on the full resolved URL, `"/"` and `"/?v=2"` are different apps, and a value should be
chosen once and left alone. Chromium's update check runs once a day for an installed app and
applies most field changes only after the app has no open windows (web.dev, "How Chrome
handles updates to the web app manifest"); a changed `start_url` is accepted as an update only
when `id` is present and unchanged.

`navigator.getInstalledRelatedApps()` does not read `id`: it reports related native apps and,
on Chrome 80+, a PWA listed in `related_applications` with `platform: "webapp"`, matched by
manifest URL, without using `id`.

:::note
When a manifest has no `id`, DevTools' [`AppManifestView.ts`](https://github.com/ChromeDevTools/devtools-frontend/blob/main/front_end/panels/application/AppManifestView.ts) shows a note in the **Identity** section saying that `start_url` is used instead and suggesting the `id` value that matches the current identity, with a button that copies it. Chrome's [manifest `id` article](https://developer.chrome.com/blog/pwa-manifest-id) explains that once an `id` is set, the browser uses that `id` to identify the app, replacing `start_url` or the manifest path as the identity key, and that Chrome generates one from `start_url` when it is missing.
:::

## Examples

Set `id` before the first release, or recover the existing identity before adding it to a published app.

### Fixing the identity before the first install

A short root-relative path is enough; the member resolves against the origin of `start_url`,
so a scheme and host add nothing. The launch URL carries an analytics parameter that may
change later without touching the identity.

```json
{
  "name": "Ledger",
  "id": "/",
  "start_url": "/app/?source=pwa",
  "scope": "/app/",
  "display": "standalone"
}
```

Chrome 96+ and Safari 16.4+ record the identity as `https://example.com/`; a later manifest
with `"start_url": "/dashboard/?source=pwa"` updates the installed app instead of creating a
second one.

### Moving start_url without a duplicate install

With the identity fixed, a redesign that changes the launch path only edits `start_url` and
`scope`. The identity line is the one that must not move.

```json
{
  "name": "Ledger",
  "id": "/",
  "start_url": "/home/",
  "scope": "/",
  "display": "standalone"
}
```

On Chrome 155 the installed app picks up the new `start_url` at the next daily manifest check
and applies it after the last app window closes; on a browser that ignores `id`, the same
change still works provided that browser has not used `start_url` as the identity key.

### Adopting id for an app that shipped without one

An app installed before `id` was declared has the identity Chromium computed from its
`start_url`. To keep those installs, set `id` to exactly the computed value shown in DevTools;
this script reads the manifest linked by the page and prints the value to copy, falling back
to a note when the manifest fetch fails.

```js
async function suggestedId() {
  const link = document.querySelector('link[rel="manifest"]');
  if (!link || !('fetch' in window)) return null; // Nothing to inspect.
  const manifest = await fetch(link.href).then((r) => r.json()).catch(() => null);
  if (!manifest) return null;
  if (manifest.id) return new URL(manifest.id, location.origin).href;
  return new URL(manifest.start_url ?? '/', link.href).href; // Chromium's default identity.
}

const id = await suggestedId();
console.log(id ? `Set "id" to ${new URL(id).pathname + new URL(id).search}` : 'Manifest not readable');
```

For `"start_url": "/app/?source=pwa"` the printed value is `/app/?source=pwa`; declaring that
string as `id` freezes the identity existing users already have, after which `start_url` is
free to change.

## See also

- [start_url manifest member](/reference/manifest/start-url/)
- [How installed PWAs pick up manifest changes](/reference/manifest/manifest-updates/)
- [The N+1 install problem: one PWA, multiple independent installs](/reference/installation/n-plus-one/)
- [getInstalledRelatedApps(): detecting an installed native or PWA counterpart](/reference/installation/get-installed-related-apps/)
- [Web Application Manifest: id member](https://www.w3.org/TR/appmanifest/#id-member) (w3.org)
- [Uniquely identifying PWAs with the web app manifest id property](https://developer.chrome.com/docs/capabilities/pwa-manifest-id) (developer.chrome.com)
- [WebKit Features in Safari 16.4](https://webkit.org/blog/13966/webkit-features-in-safari-16-4/) (webkit.org)