files/en-us/web/api/cookiestoremanager/unsubscribe/index.md
{{securecontext_header}}{{APIRef("Cookie Store API")}}{{AvailableInWorkers("window_and_service")}}
The unsubscribe() method of the {{domxref("CookieStoreManager")}} interface stops the {{domxref("ServiceWorkerRegistration")}} from receiving previously subscribed events.
unsubscribe(subscriptions)
subscriptions
name
url
A {{jsxref("Promise")}} that resolves with {{jsxref("undefined")}} when the service worker has been unsubscribed.
subscriptions does not match the service worker registration's {{domxref("ServiceWorkerRegistration.scope","scope")}}.In this example, the {{domxref("ServiceWorkerRegistration")}} represented by registration is unsubscribing from change events on the cookie named "cookie1" with a scope of "/path1".
const subscriptions = [{ name: "cookie1", url: `/path1` }];
await registration.cookies.unsubscribe(subscriptions);
{{Specifications}}
{{Compat}}