JavaScript PushManager registrations() Method

Beginner
⏱️ 10 min read
📚 Updated: Jul 2026
🎯 5 Examples
🚀 5 Try-it labs
Deprecated
Non-standard
Instance method

What You’ll Learn

PushManager.registrations() is a deprecated, non-standard instance method that listed existing push endpoint registrations as an array of PushRegistration objects. Learn what it did, why MDN replaced it with getSubscription(), how to feature-detect it, and modern migration patterns—with five examples and try-it labs.

01

Kind

Instance method

02

Returns

DOMRequest

03

Result

array

04

Status

Deprecated

05

Replace

getSubscription

06

Spec

Non-standard

Introduction

Before reusing or creating push endpoints, legacy Mozilla code needed to know what was already registered. Early push drafts exposed registrations() on PushManager to list existing endpoints with their version numbers.

MDN now marks it deprecated and non-standard. The standardized replacement is getSubscription(), which returns a single PushSubscription (or null) for the current service worker registration. Modern PWAs should never call registrations() in new code.

⚠️
Array vs single subscription

Legacy registrations() could return multiple endpoints. Modern getSubscription() returns one PushSubscription per pushManager instance—simpler and spec-aligned.

Understanding registrations()

A legacy instance method on PushManager that queried existing push endpoint registrations.

  • Parameters — none.
  • ReturnsDOMRequest (not a Promise).
  • Success result — array of PushRegistration objects.
  • pushEndpoint — endpoint URL string on each object.
  • version — current version of the push endpoint.
  • Superseded bygetSubscription() (Baseline Widely available).
  • Available in Web Workers per MDN (where still supported).

📝 Syntax

JavaScript
pushManager.registrations()

Return value

A DOMRequest object. On success, req.result is an array of PushRegistration objects with pushEndpoint and version.

MDN legacy pattern

JavaScript
// Legacy — do not use in new code (MDN sample used navigator.push)
const req = navigator.push.registrations();

req.onsuccess = () => {
  req.result.forEach((registration) => {
    console.log(
      `Existing registration ${registration.pushEndpoint} ${registration.version}`
    );
  });
};

⚡ Quick Reference

GoalCode / note
Legacy listconst req = pushManager.registrations()
Each itemregistration.pushEndpoint, registration.version
Modern checkawait pushManager.getSubscription()
Feature detectif (pushManager.registrations)
MDN statusDeprecated · Non-standard
ReplacementgetSubscription()

🔍 At a Glance

Four facts to remember about registrations().

Async
DOMRequest

Not Promise

Result
array

PushRegistration

Status
deprecated

Avoid new use

Use
getSubscription

Instead

Examples Gallery

Examples explain legacy registrations() and show modern getSubscription() replacements. Use View Output or Try It Yourself.

📚 Legacy Usage

How registrations() worked (historical).

Example 1 — MDN registrations() Loop

List existing endpoints with pushEndpoint and version.

JavaScript
const req = navigator.push.registrations();

req.onsuccess = () => {
  if (req.result.length > 0) {
    req.result.forEach((registration) => {
      console.log(
        `Existing registration ${registration.pushEndpoint} ${registration.version}`
      );
    });
  } else {
    console.log("No existing registrations");
  }
};
Try It Yourself

How It Works

Each array item is a plain object with endpoint URL and version—not a full PushSubscription.

Example 2 — Feature Detect Before Calling

Safe pattern for maintaining legacy codebases.

JavaScript
function legacyRegistrations(pushManager) {
  if (typeof pushManager.registrations === "function") {
    return pushManager.registrations();
  }
  if (navigator.push && typeof navigator.push.registrations === "function") {
    return navigator.push.registrations();
  }
  return null; // not supported — use getSubscription()
}
Try It Yourself

How It Works

Most current browsers removed registrations()—fall back to getSubscription().

📈 Migration & Modern Flow

Replace registrations() with getSubscription().

Example 3 — Reuse Endpoints or Call register() (MDN)

Legacy flow: list registrations, or register if empty.

JavaScript
const req = navigator.push.registrations();

req.onsuccess = () => {
  if (req.result.length > 0) {
    // Reuse existing endpoints
    req.result.forEach((r) => sendEndpointToServer(r.pushEndpoint));
  } else {
    // Legacy: register for a new endpoint
    const registerReq = navigator.push.register();
    registerReq.onsuccess = () => {
      console.log(`Registered new endpoint: ${registerReq.result}`);
    };
  }
};
Try It Yourself

How It Works

Modern equivalent: getSubscription() then subscribe() if null.

Example 4 — Migrate to getSubscription() (MDN)

Recommended replacement for new push projects.

JavaScript
const registration = await navigator.serviceWorker.ready;

const subscription = await registration.pushManager.getSubscription();

if (subscription) {
  console.log("Existing:", subscription.endpoint);
  await syncSubscriptionToServer(subscription);
} else {
  console.log("Not subscribed — show enable UI");
}
Try It Yourself

How It Works

getSubscription() returns a full PushSubscription with keys—not just endpoint strings.

Example 5 — Page-Load Subscription Check

Modern pattern to restore push UI on every visit.

JavaScript
async function updatePushButton() {
  const registration = await navigator.serviceWorker.ready;
  const subscription = await registration.pushManager.getSubscription();
  const btn = document.querySelector(".js-push-button");

  if (subscription) {
    btn.textContent = "Push Enabled";
    btn.dataset.endpoint = subscription.endpoint;
  } else {
    btn.textContent = "Enable Push";
  }
}

updatePushButton();
Try It Yourself

How It Works

This replaces legacy registrations().length checks with a single Promise-based call.

🚀 Common Use Cases (Historical)

  • Reading old Mozilla push tutorials that call registrations().
  • Maintaining legacy Firefox OS apps with navigator.push.
  • Understanding why getSubscription() returns one object, not an array.
  • Migrating endpoint-list code to PushSubscription objects.
  • Pairing with deprecated register() in legacy flows.

🔧 How It Works

1

Call registrations

Legacy pushManager.registrations().

Deprecated
2

DOMRequest

Attach onsuccess / onerror.

Callback
3

Get array

pushEndpoint + version per item.

List
4

Migrate

Use getSubscription() for one Promise-based check.

📝 Notes

  • Deprecated & non-standard on MDN—not for new production code.
  • Superseded by getSubscription() (Baseline Widely available).
  • Not Experimental — it was Mozilla-specific and removed from specs.
  • DOMRequest — callback-based; unlike modern Promise APIs.
  • Multiple endpoints — legacy could return an array; modern API returns one subscription per SW.
  • Related learning: getSubscription(), register(), permissionState(), JavaScript hub.

Limited Browser Support

PushManager.registrations() is Deprecated and Non-standard on MDN. It is missing in modern browsers. Use getSubscription() instead. Logos use the shared browser-image-sprite.png sprite from this project.

Deprecated · Non-standard

PushManager.registrations()

Legacy push endpoint listing — avoid in new code.

Legacy Deprecated API
Google Chrome Removed — use getSubscription()
Not supported
Mozilla Firefox Legacy only — use getSubscription()
Legacy only
Apple Safari Never supported — use getSubscription()
Not supported
Microsoft Edge Follow Chromium — use getSubscription()
Not supported
Opera Follow Chromium
Not supported
Internet Explorer No Push API
Not supported
registrations() Limited

Bottom line: Feature-detect before calling. Prefer getSubscription() for existing subscription checks.

Conclusion

pushManager.registrations() was an early way to list push endpoints as an array of PushRegistration objects via DOMRequest. MDN deprecates it in favor of getSubscription(), which returns a single PushSubscription or null. Learn it for legacy code; build new features with the modern Push API.

Continue with navigator.serviceWorker, getSubscription(), register(), or the JavaScript hub.

💡 Best Practices

✅ Do

  • Use getSubscription() in new projects
  • Call it after navigator.serviceWorker.ready
  • Handle null and show enable-push UI
  • Feature-detect registrations in legacy maintenance
  • Sync full PushSubscription JSON to your server

❌ Don’t

  • Call registrations() in new production code
  • Assume DOMRequest APIs exist in modern browsers
  • Store only pushEndpoint without encryption keys
  • Loop an array when one subscription per SW suffices
  • Confuse registrations with permission checks

Key Takeaways

Knowledge Unlocked

Five things to remember about registrations()

Legacy push endpoint listing—and what to use instead.

5
Core concepts
🔄02

DOMRequest

callbacks

Returns
📋03

Array

endpoints

Result
🚀04

Replace

getSubscription

Modern
🚫05

Non-standard

off spec

Spec

❓ Frequently Asked Questions

It asked the system about existing push endpoint registrations. On success, the DOMRequest result was an array of PushRegistration objects with pushEndpoint and version properties.
MDN marks it Deprecated and Non-standard. It is not Experimental, but it is no longer recommended and has been superseded by getSubscription(). Do not use it in new code.
A DOMRequest object (Mozilla legacy pattern)—not a Promise. On success, req.result is an array of objects with pushEndpoint (URL string) and version.
Use PushManager.getSubscription() after navigator.serviceWorker.ready. It returns a Promise<PushSubscription | null> for the current service worker registration.
No. MDN documents registrations() with no parameters. Call it on a PushManager instance—or in very old Mozilla samples, via navigator.push.registrations().
You may encounter it paired with register() in legacy Mozilla push tutorials. Understanding it helps you migrate safely to getSubscription() and subscribe().
Did you know?

MDN’s registrations() sample paired with register()—if the array was empty, it called register() for a new endpoint. Modern code uses getSubscription() then subscribe() instead.

Check existing subscription

Learn getSubscription()—the modern replacement for registrations().

getSubscription() →

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.

5 people found this page helpful