JavaScript Navigator getInstalledRelatedApps() Method

Beginner
⏱️ 10 min read
📚 Updated: Jul 2026
🎯 5 Examples
🚀 5 Try-it labs
Experimental

What You’ll Learn

navigator.getInstalledRelatedApps() asks: “Did this user already install our related Play / Windows / PWA app?” Learn the Promise result, manifest setup, hiding install prompts, five examples, and try-it labs.

01

Kind

Method

02

Returns

Promise<RelatedApp[]>

03

Status

Experimental

04

Context

Secure + top-level

05

Manifest

related_applications

06

Typical UX

Hide install banner

Introduction

Many sites show “Install our app” banners for a Play Store app, Windows app, or PWA. That banner is annoying if the user already installed it.

getInstalledRelatedApps() lets a properly configured site ask the browser for related apps that are already installed, then personalize the page — for example, hide the banner or skip a web-only push path when the native app handles it.

💡
Association first

The method only reports apps you declared in related_applications and linked on the platform side. Without that setup, the array is usually empty.

Understanding the getInstalledRelatedApps() Method

  • No parameters — call navigator.getInstalledRelatedApps().
  • Returns a Promise — resolves to an array of related-app objects.
  • Object fieldsplatform (required in practice), optional id, url, version.
  • Platform examplesplay, windows, webapp, chrome_web_store, and more.
  • Top-level only — not inside an iframe (InvalidStateError).
  • Secure context — HTTPS / localhost.

📝 Syntax

General form of the method:

JavaScript
navigator.getInstalledRelatedApps()

Parameters

  • None.

Return value

  • A Promise that fulfills with an array of related-app objects (may be empty).

Common patterns

JavaScript
// MDN-style usage
const relatedApps = await navigator.getInstalledRelatedApps();
console.table(relatedApps);

const psApp = relatedApps.find((app) => app.id === "com.example.myapp");
if (psApp) {
  // Related platform app is installed — customize UX
}

// Manifest sketch (required association)
// {
//   "related_applications": [
//     { "platform": "play", "id": "com.example.myapp", "url": "https://play.google.com/store/apps/details?id=com.example.myapp" }
//   ]
// }

⚡ Quick Reference

GoalCode
Feature detecttypeof navigator.getInstalledRelatedApps === "function"
Query installed related appsawait navigator.getInstalledRelatedApps()
Any related app installed?relatedApps.length > 0
Find by idrelatedApps.find((a) => a.id === "…")
Top-level?window.top === window.self
Secure context?window.isSecureContext

🔍 At a Glance

Four facts to remember about navigator.getInstalledRelatedApps().

Returns
Promise

Related app array

Status
Experimental

Not Baseline

Context
HTTPS

Top-level only

Needs
manifest

related_applications

📋 Install Banner With vs Without This API

Without the APIWith getInstalledRelatedApps()
Install promptOften shown even if native app existsCan hide when a related app is installed
SetupNoneManifest + platform association
SupportWorks everywhere as plain UIExperimental / limited browsers
FallbackN/AKeep showing install UI if API missing / empty

Examples Gallery

Examples follow MDN patterns. Prefer Try It Yourself — without a configured related_applications association most pages return an empty array or a missing method.

📚 Getting Started

Detect the API and query related installed apps.

Example 1 — Feature Detection

Check the method, secure context, and top-level browsing context.

JavaScript
const lines = [
  "getInstalledRelatedApps: " +
    (typeof navigator.getInstalledRelatedApps === "function"
      ? "available"
      : "missing"),
  "isSecureContext: " + window.isSecureContext,
  "topLevel: " + (window.top === window.self)
];
console.log(lines.join("\n"));
Try It Yourself

How It Works

If any of these checks fail, keep your normal install UI.

Example 2 — Query Related Apps (MDN)

Await the Promise and summarize how many related apps were returned.

JavaScript
async function queryRelatedApps() {
  if (!navigator.getInstalledRelatedApps) {
    return "API not supported";
  }
  try {
    const relatedApps = await navigator.getInstalledRelatedApps();
    console.table(relatedApps);
    return "related apps found: " + relatedApps.length;
  } catch (err) {
    return "Error: " + err.name;
  }
}

queryRelatedApps().then(console.log);
Try It Yourself

How It Works

Catch InvalidStateError if the page is embedded in an iframe.

📈 Practical Patterns

Find a specific app id, hide banners, and guard beginners from incomplete setups.

Example 3 — Find a Specific App Id

MDN pattern: search the array for your package / store id.

JavaScript
async function findRelatedApp(appId) {
  if (!navigator.getInstalledRelatedApps) {
    return "API not supported";
  }
  const relatedApps = await navigator.getInstalledRelatedApps();
  const psApp = relatedApps.find((app) => app.id === appId);
  if (!psApp) return "Related app not installed (or not associated)";
  return (
    "Found platform=" + psApp.platform +
    " version=" + (psApp.version || "n/a")
  );
}

findRelatedApp("com.example.myapp").then(console.log);
Try It Yourself

How It Works

Use the found app’s version to decide whether native push / features replace the web path.

Example 4 — Hide Install Banner When Related App Exists

Beginner UX: only show “Install app” when no related apps are installed.

JavaScript
async function shouldShowInstallBanner() {
  if (!navigator.getInstalledRelatedApps) {
    return { show: true, reason: "api-missing" };
  }
  try {
    const relatedApps = await navigator.getInstalledRelatedApps();
    if (relatedApps.length > 0) {
      return { show: false, reason: "related-app-installed", count: relatedApps.length };
    }
    return { show: true, reason: "none-installed" };
  } catch (err) {
    return { show: true, reason: err.name };
  }
}

shouldShowInstallBanner().then((result) => {
  console.log(JSON.stringify(result));
});
Try It Yourself

How It Works

Default to showing the banner when the API fails — never block installs on experimental support.

Example 5 — Safe Call Helper

Centralize detection, top-level checks, and error handling for reuse.

JavaScript
async function getRelatedAppsSafe() {
  if (typeof navigator.getInstalledRelatedApps !== "function") {
    return { ok: false, apps: [], reason: "unsupported" };
  }
  if (!window.isSecureContext) {
    return { ok: false, apps: [], reason: "insecure-context" };
  }
  if (window.top !== window.self) {
    return { ok: false, apps: [], reason: "not-top-level" };
  }
  try {
    const apps = await navigator.getInstalledRelatedApps();
    return { ok: true, apps: apps, reason: "ok" };
  } catch (err) {
    return { ok: false, apps: [], reason: err.name };
  }
}

getRelatedAppsSafe().then((result) => {
  console.log(JSON.stringify({
    ok: result.ok,
    reason: result.reason,
    count: result.apps.length
  }));
});
Try It Yourself

How It Works

Structured results make it easy to log why the check failed without throwing into UI code.

🚀 Common Use Cases

  • Hide install banners — skip “Get the app” when Play / Windows / PWA is installed.
  • Prefer native features — let the store app handle push if version supports it.
  • PWA + native pairs — avoid double-prompting when either form is present.
  • beforeinstallprompt tuning — combine with install events for smarter prompts.
  • Progressive enhancement — site works even when the API is missing.

🧠 How navigator.getInstalledRelatedApps() Works

1

Declare related apps

Add related_applications in the web app manifest.

Manifest
2

Prove the relationship

Link via Asset Links, URI handlers, or PWA self-entries.

Associate
3

Call the method

On a secure top-level page, await the related-app array.

Query
4

Personalize the UX

Hide install prompts or skip duplicate native-capable flows.

📝 Notes

  • Experimental & Limited availability — not Baseline; feature-detect always.
  • Not Deprecated or Non-standard — Experimental banner only.
  • Secure + top-level required (not an iframe).
  • Needs related_applications + platform association to return useful results.
  • Related: getUserMedia(), getGamepads(), serviceWorker, Window.

Limited / Experimental Support

navigator.getInstalledRelatedApps() is experimental and not Baseline. Support is strongest in some Chromium-based browsers with a configured related-apps association. Always feature-detect, use HTTPS on a top-level page, and keep install UI working without the API.

Experimental · Not Baseline

Navigator.getInstalledRelatedApps()

Promise → related installed apps — hide install banners when the native/PWA app is present.

Limited Experimental
Google Chrome Related Apps API where implemented + configured
Limited
Microsoft Edge Follow Chromium / Windows related-app support
Limited
Opera Follow Chromium where available
Limited
Mozilla Firefox Typically unavailable — feature-detect
Unavailable
Apple Safari Typically unavailable — feature-detect
Unavailable
Internet Explorer No getInstalledRelatedApps support
Unavailable
getInstalledRelatedApps() Limited

Bottom line: Detect the method, configure related_applications, query on a secure top-level page, and default to showing install UI when results are empty or unsupported.

Conclusion

navigator.getInstalledRelatedApps() is an experimental way to learn whether related store apps or PWAs are already installed. Configure the manifest association, call it from a secure top-level page, and use the result to soften install prompts — with a solid fallback when the API is missing.

Continue with getUserMedia(), serviceWorker, or the JavaScript hub.

💡 Best Practices

✅ Do

  • Feature-detect before calling
  • Use HTTPS on a top-level page
  • Configure related_applications + platform links
  • Hide banners only when related apps are found
  • Keep install UX if the API fails

❌ Don’t

  • Call from an iframe
  • Assume Baseline support
  • Expect results without manifest association
  • Block core browsing when the array is empty
  • Treat empty results as a hard error

Key Takeaways

Knowledge Unlocked

Five things to remember about getInstalledRelatedApps()

Experimental related-app check — hide install noise when already installed.

5
Core concepts
02

Status

Experimental

Limited
🔒 03

Context

HTTPS top-level

Required
📄 04

Setup

related_applications

Manifest
🎯 05

UX

hide install banner

Optional

❓ Frequently Asked Questions

It returns a Promise that resolves to an array of objects for related platform apps or PWAs the user already installed — useful to hide “install our app” prompts when the app is already present.
MDN marks it Experimental and Limited availability (not Baseline). It is not Deprecated or Non-standard. Always feature-detect and keep a normal install UX fallback.
List related apps in the web app manifest related_applications member, and define the relationship on the platform side (for example Digital Asset Links on Android, URI handlers on Windows, or PWA self-entries / assetlinks).
Yes. It requires a secure context. It must also run in a top-level browsing context — not inside an iframe (InvalidStateError otherwise).
At least platform; optionally id, url, and version. Platform values include play, windows, webapp, chrome_web_store, and others documented on MDN.
Usually no. Without a matching manifest association and a supporting browser, you get an empty array or a missing method. That is expected for beginners testing outside a configured PWA.
Did you know?

Browsers often hide their own PWA install UI when the app is already installed. getInstalledRelatedApps() helps you do the same for related Play / Windows apps that are not the web app itself.

Explore getUserMedia() Next

Learn the deprecated callback API and migrate to mediaDevices.

getUserMedia() →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful