files/en-us/web/api/backgroundfetchmanager/get/index.md
{{APIRef("Background Fetch API")}}{{SeeCompatTable}}{{AvailableInWorkers}}
The get() method of the {{domxref("BackgroundFetchManager")}} interface returns a {{jsxref("Promise")}} that resolves with the {{domxref("BackgroundFetchRegistration")}} associated with the provided id or {{jsxref("undefined")}} if the id is not found.
get(id)
id
A {{jsxref("Promise")}} that resolves with a {{domxref("BackgroundFetchRegistration")}} or {{jsxref("undefined")}}.
The following examples shows how to use get() to retrieve a {{domxref("BackgroundFetchRegistration")}}. With an active service worker, use the {{domxref('ServiceWorkerRegistration.backgroundFetch')}} to access the BackgroundFetchManager object and call its get() method.
navigator.serviceWorker.ready.then(async (swReg) => {
const bgFetch = await swReg.backgroundFetch.get("my-fetch");
});
// my code block
{{Specifications}}
{{Compat}}