W3cubDocs

/Web APIs

Clients: get() method

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨April 2018⁩.

Note: This feature is only available in Service Workers.

The get() method of the Clients interface gets a service worker client matching a given id and returns it in a Promise.

Syntax

get(id)

Parameters

id

A string representing the id of the client you want to get.

Return value

A Promise that resolves to a Client object or undefined.

Examples

self.clients.get(id).then((client) => {
  self.clients.openWindow(client.url);
});

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS
get 51 17 45 38 11.1 51 45 41 11.3 5.0 51 No

© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/Clients/get