Definition
appinstalled event
appinstalled is a window event, listened for with window.addEventListener("appinstalled", () => { ... }), that fires after the browser has finished installing the PWA — regardless of whether the install was triggered via the native beforeinstallprompt flow or a browser menu item. It fires exactly once per successful install and carries no event detail beyond the fact that installation completed.
It complements beforeinstallprompt's userChoice promise: userChoice tells you what the user chose in the moment, while appinstalled is the authoritative confirmation that the OS actually finished registering the app, which can matter if the process is interrupted between those two points.
A common pattern hides a persistent "Install app" banner permanently for that browser profile once appinstalled fires, storing a flag in localStorage since there is no browser API to query "is this PWA currently installed" after the fact on most platforms.
The event does not fire on iOS Safari, since Apple's manual share-sheet install flow has no corresponding JavaScript signal — measuring iOS installs generally relies on the display-mode media query or navigator.standalone at next launch instead.
Chrome for Android also fires this event for installs completed via the browser's own menu ("Add to Home screen") even when a site never called prompt() itself, so listening for it captures installs your own UI did not directly initiate.