Make a website installable and offline capable with one command.
Website · Check a site · Icon generator · Docs · Português
Run npx installkite init in your site folder. It writes the web app manifest, every icon size from one PNG or SVG, a service worker with an offline page, and the head tags for your HTML. Browsers can then install your site on a phone or a computer, with its own icon and window, and open it without a network. Visitors who just browse see the same site as before.
npx installkite init --dry-run # see a diff of every change first
npx installkite init # answer a few questions, or add --yes
npx installkite doctor # check what browsers look forDeploy over HTTPS. After each later site build, refresh the list of cached files:
npx installkite buildIt works on plain HTML folders and on Vite, Next.js (static export), Astro, WordPress and Laravel sites. The recipes cover each one.
| File | What it is |
|---|---|
manifest.webmanifest |
Name, colors, start URL, display mode, icons and shortcuts |
icons/, apple-touch-icon.png, favicon.ico |
Ten sizes, maskable icons with safe zone padding, the iPhone icon and favicons |
sw.js |
A service worker that caches your pages with content hashes |
offline.html |
A page in your colors for when there is no network |
installkite.js |
A 4.4 kB script: install button, iPhone install steps, update toast and offline badge |
installkite.config.json |
What init decided, so later runs ask nothing |
The head tags go between <!-- installkite:start --> and <!-- installkite:end --> in every page. Running init again updates that block in place and keeps tags you already had.
npx installkite init write everything and add the head tags
npx installkite build refresh the cached file list after a site build (--check for CI)
npx installkite doctor check the files on disk, or a live site with --url
npx installkite icons <img> only the icon set
npx installkite remove take the installkite tags out of the HTML
Every option is in the CLI docs.
<script src="/installkite.js" data-sw="/sw.js" data-install="auto" defer></script>
<button data-installkite-install hidden>Install the app</button>The button stays hidden until the browser can install the site. On iPhone and iPad it shows the Add to Home Screen steps instead. For more control:
installkite.on('installable', () => showMyButton());
const outcome = await installkite.install(); // 'accepted', 'dismissed', 'instructions' or 'unavailable'
installkite.on('update', ({ apply }) => showBanner('New version', apply));See the runtime API and the Node API.
- SVG logos are drawn by a small built in renderer. Text, masks, filters and patterns are skipped with a warning, so convert text to outlines first.
- The CLI reads PNG and SVG. The online generator also reads JPEG and WebP.
- iPhone and iPad have no install prompt, and desktop Firefox does not install sites. The offline page still works there.
- What makes a website installable
- Installing a website on iPhone and iPad
- An offline page with a service worker
- App icon sizes and maskable icons
Monsoon, Voodoo.js, breakhound, vueleap, graphemely, numberparrot, edgegoat, cookieowl, a11ymedic, fontsketch and kastor.
Made by Alexandre Kohler (GitHub, LinkedIn). The website is built with Monsoon, and its interactive parts with Voodoo.js.