---
title: "Make the app installable"
description: "Let people install your app on their phone or desktop: a web app manifest from your brand and two icons, the one service worker push already uses, what each browser offers, including the Home Screen install that iPhone and iPad need for push, and an install button of your own."
canonical_url: "https://nuxt-backend.dev/docs/build/email/notifications/installable"
---
# Make the app installable

> Let people install your app on their phone or desktop: a web app manifest from your brand and two icons, the one service worker push already uses, what each browser offers, including the Home Screen install that iPhone and iPad need for push, and an install button of your own.

Version: nuxt-backend 0.6.x · Tab: Build · Kind: how-to · Status: stable

Every page: [llms.txt](https://nuxt-backend.dev/llms.txt) · Skill for coding agents: [nuxt-backend](https://nuxt-backend.dev/.well-known/skills/nuxt-backend/SKILL.md)

Commands use npm; use your project's package manager.

- **You get:** an app people install on their phone or desktop, opening in its own window, and push on iPhone and iPad.
- **Powered by:** the web app manifest and the install flows each browser offers.
- **The package adds:** a manifest built from your brand and two icons, the Apple tags, and the service worker push already uses.

Let people keep your app beside their other apps. An installed app opens in its own window, without the browser's toolbar. On iPhone and iPad it is also the only way to receive [web push](https://nuxt-backend.dev/docs/build/email/notifications/web-push). The module makes your app installable from your brand and two icons, with no PWA module to add.

## What the module adds

Once the two icons below are in `public/`, the module serves what browsers look for:

- **A web app manifest** at `/manifest.webmanifest`, linked from every page: the app's name from `appConfig.backend.brand.name`, your icons, `start_url: '/'` and `display: 'standalone'`, and the colours and maskable icons the `installable` option gives.
- **The service worker** that shows push notifications on Chromium and Firefox. It caches nothing, so the app still needs a connection, as it does in a tab.
- **The Apple tags** iOS reads: the touch icon, the standalone mode and the title.
- **The install events** Chrome and Edge fire, kept for [`useInstallPrompt()`](#offer-the-install-from-your-app).

The module reads the brand name and checks for the icons as it starts (`dev`, `build`), so restart it after you add them.

An app that already ships a manifest of its own, from `@vite-pwa/nuxt` for one, or as `manifest.webmanifest`, `manifest.json` or `site.webmanifest` in `public/`, keeps it: the module adds none, and its push worker lives beside yours.

## Add the icons

Put two square PNG icons in `public/`, the sizes Chromium-based browsers require:

```text
public/
  icon-192.png   # 192 × 192 px
  icon-512.png   # 512 × 512 px
```

Give the icons a solid background: a home screen shows them on any wallpaper. Without them, or without a brand name, the module adds no manifest, and `npx nuxt-backend doctor` says which is missing (`installable`): it warns once the app reaches for it, with one icon in place.

The module also finds the icons [RealFaviconGenerator](https://realfavicongenerator.net) writes, `web-app-manifest-192x192.png` and `web-app-manifest-512x512.png`, and links its `apple-touch-icon.png` when `public/` holds one.

## Colours, maskable icons and other paths

The `installable` option says the rest of what the manifest carries:

```ts [nuxt.config.ts]
export default defineNuxtConfig({
  modules: ['nuxt-backend'],
  backend: {
    installable: {
      themeColor: { light: '#ffb900', dark: '#1e1a4d' },
      backgroundColor: '#ffb900',
      description: 'Turn your photos into a comic.',
      id: '/',
      lang: 'en',
      orientation: 'any',
      maskable: true,
    },
  },
})
```

<table>
<thead>
  <tr>
    <th>
      Key
    </th>
    
    <th>
      What it does
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        themeColor
      </code>
    </td>
    
    <td>
      The colour of the title bar, the task switcher and Android's address bar. One colour, or <code>
        { light, dark }
      </code>
      
      : the manifest takes the light one, and every page carries a <code>
        theme-color
      </code>
      
       meta tag per scheme
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        backgroundColor
      </code>
    </td>
    
    <td>
      The splash screen's background while the installed app opens. Default: the theme colour, its light one
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        description
      </code>
    </td>
    
    <td>
      One line on what the app does, in the install dialog
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        id
      </code>
    </td>
    
    <td>
      The app's identity, a path on the site such as <code>
        /
      </code>
      
      : what a browser tells one installed app from another by. Set it before the first install and never change it, or each install becomes a second app. Default: none, which browsers read as <code>
        start_url
      </code>
      
      , <code>
        /
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        lang
      </code>
    </td>
    
    <td>
      The language the name and the description are in, a language tag such as <code>
        en
      </code>
      
       or <code>
        pt-BR
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        orientation
      </code>
    </td>
    
    <td>
      The orientation the installed app opens in: <code>
        any
      </code>
      
      , <code>
        natural
      </code>
      
      , <code>
        portrait
      </code>
      
       or <code>
        landscape
      </code>
      
      , or a <code>
        -primary
      </code>
      
       or <code>
        -secondary
      </code>
      
       one of the last two. Default: the device's
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        icons
      </code>
    </td>
    
    <td>
      The two icons' paths on the site, <code>
        { 192: '/brand/app-192.png', 512: '/brand/app-512.png' }
      </code>
      
      , when they are not where the module looks
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        maskable
      </code>
    </td>
    
    <td>
      Icons a platform crops to its own shape (a circle on Android, a squircle on macOS). <code>
        true
      </code>
      
       when your two icons are already full-bleed, so each is listed for both purposes; their own two paths otherwise. Default: <code>
        icon-maskable-192.png
      </code>
      
       and <code>
        icon-maskable-512.png
      </code>
      
       when <code>
        public/
      </code>
      
       holds them
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        browserBanner
      </code>
    </td>
    
    <td>
      Chrome's own install banner on Android, the mini-infobar. <code>
        false
      </code>
      
       stops it, so your button offers the install instead (<a href="#offer-the-install-from-your-app">
        Offer the install from your app
      </a>
      
      ). Default: <code>
        true
      </code>
    </td>
  </tr>
</tbody>
</table>

A maskable icon keeps its artwork inside the middle 80%: the platform cuts the rest. `installable: false` serves no manifest at all, and `doctor` stops asking for the icons. A `<link rel="manifest">` of your own in `app.head` counts as your own manifest too.

The module checks the option as it starts: a `browserBanner` that is not `true` or `false`, a colour that is no CSS colour, an `id` that is not a path on the site, a `lang` that is no language tag, an `orientation` it does not know, an icon path that is not shaped as a path on the site (one leading `/`, no other origin, no `..`) and a pair without both sizes stop the build with what to change. Whether `public/` holds the files is checked as the build runs, and only warned of: an `icons` pair it does not hold leaves the app with no manifest, and a maskable pair it does not hold is left out of the manifest.

## What each browser offers

A browser offers the install once the app is served over HTTPS, or from `localhost` in development:

- **Chrome and Edge, on desktop and Android**, show an install button in the address bar, and hand over their install dialog for a button of yours ([Offer the install from your app](#offer-the-install-from-your-app)).
- **Safari on macOS**, from Safari 17, installs any site from **File → Add to Dock**.
- **iPhone and iPad**, from iOS 16.4, install from the **Share** menu with **Add to Home Screen**, in Safari, Chrome, Edge and Firefox. iOS fires no `beforeinstallprompt`, so tell people where to look. `usePushSubscription()`'s `needsInstall` says when a device must install before it can get push.
- **Firefox on desktop** does not install apps from a manifest.

## Offer the install from your app

`useInstallPrompt()` puts the install behind a button of your own. The module listens for Chromium's `beforeinstallprompt` from the app's start and keeps the dialog it hands over, so the event is caught even when it fires before your page mounts:

```vue [app/components/InstallApp.vue]
<script setup lang="ts">
const { canInstall, needsShareMenu, prompt } = useInstallPrompt()
</script>

<template>
  <button v-if="canInstall" type="button" @click="prompt">
    Install the app
  </button>
  <p v-else-if="needsShareMenu">
    To install the app, tap Share, then Add to Home Screen.
  </p>
</template>
```

<table>
<thead>
  <tr>
    <th>
      Return
    </th>
    
    <th>
      What it is
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        canInstall
      </code>
    </td>
    
    <td>
      The browser handed over its install dialog: Chrome and Edge, once the app is installable and not installed. <code>
        false
      </code>
      
       on the server, while the page hydrates, in other browsers, and once the dialog was answered, from your button or the browser's banner
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        installed
      </code>
    </td>
    
    <td>
      The app runs in its own window or from the Home Screen, or was just installed from this page. An app installed with <code>
        display: 'fullscreen'
      </code>
      
       reads <code>
        false
      </code>
      
      : a browser tab in fullscreen matches the same display mode
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        needsShareMenu
      </code>
    </td>
    
    <td>
      An iPhone or iPad where the app is not installed: the install is <strong>
        Share → Add to Home Screen
      </strong>
      
      , which no page can open, so say where to look. <code>
        false
      </code>
      
       on the server, while the page hydrates, and on every other device
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        prompt()
      </code>
    </td>
    
    <td>
      Opens the dialog, from a click. Resolves <code>
        'accepted'
      </code>
      
      , <code>
        'dismissed'
      </code>
      
      , or <code>
        'unavailable'
      </code>
      
       when there is no dialog to show or the browser refused to show it. A call outside a click is refused and keeps the dialog for the next one. A browser shows each dialog once, so <code>
        canInstall
      </code>
      
       turns <code>
        false
      </code>
      
       after it
    </td>
  </tr>
</tbody>
</table>

Where both are `false` and the app isn't installed, the example says nothing, because the composable can't tell those browsers apart. Chrome and Edge, before they hand the dialog over or once it was answered, still install from the address bar or their menu. Safari on a Mac installs from **File → Add to Dock**, and Firefox on Android from its menu. Firefox on desktop doesn't install apps. It works the same with a manifest of your own.

### The browser's own banner

Chrome on Android shows its own install banner, the mini-infobar, on a visit once the app is installable. If the person dismisses it, Chrome doesn't show it again for about three months. The module leaves it alone by default, and your button opens the dialog all the same: the dialog doesn't depend on the banner. When the banner and your button both answer the same dialog, the first answer spends it, and `canInstall` turns `false`.

To offer the install from your button alone, set `browserBanner: false`:

```ts [nuxt.config.ts]
export default defineNuxtConfig({
  backend: {
    installable: { browserBanner: false },
  },
})
```

The browser shows its banner unless the page cancels `beforeinstallprompt` while the event fires, once the page has loaded and often before any page has mounted, so the module adds a listener that does it as the client bundle loads, before any plugin runs. Chrome's address bar and menu keep their own install entry. `browserBanner` also works beside a manifest of your own. With `installable: false` there is no switch to set, so the banner shows.

## Related

- [Send web push notifications](https://nuxt-backend.dev/docs/build/email/notifications/web-push): the notifications an installed app receives.
- [Brand your emails](https://nuxt-backend.dev/docs/build/email/templates/theme#write-the-brand-once): the brand in app config the manifest reads.
- [Build the app shell](https://nuxt-backend.dev/docs/build/ui/app-shell): the frame an installed app opens into.


## Sitemap

See the full [sitemap](https://nuxt-backend.dev/sitemap.md) for all pages.
