You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[x ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
Current behavior
Right now, Service Worker package do not have sync feature. Since Angular follows a plugin mechanism to add service worker apis, I feel this is a major feature which is required.
Should be able to register a background sync easily using @angular/service-worker package.
Minimal reproduction of the problem with instructions
N/A
What is the motivation / use case for changing the behavior?
This is required to make sure that user is able to do actions even on unstable internet connections.
Reacted by Simon Kunz, andrea-spotsoftware, MurlidharVarma, Axel Laurelut, Gianluca Lazzari, Andrii Kharsun, Majid Hajian, Maxim Salnikov, AJ Liptak, Fotis Karalis and 56 more
Without allowing customisation of the service worker angular is falling behind to Vue (yes I know, vue uses workbox). I don't want to use workbox with angular, I'll use what the framework I'm using says I should.
With Google pushing PWAs everywhere it's very sad that there's still no proper serviceworker support in Angular.
Even registering a click handler on a web push notification is not possible right now.
I switched to using workbox in all of my Angular projects...
Hello Oscar! Both NGSW and Workbox have listeners of fetch event which might make the combination quite challenging. But in theory, this is possible - read "multiple fetch handlers" section of this answer: https://stackoverflow.com/a/45285119/1310228
It seems like you have to create your own SW and importScripts() NGSW and parts of Workbox there.
any official position of the Angular team about this feature?
Note: I believe that instead of inventing the wheel, the time could be spent to majestically integrate with Google's workbox(https://developers.google.com/web/tools/workbox) library.
Where it already has many features and it would not need to be developed from scratch.
There are currently no specific plans/timeline for implementing this. Keep in mind that this feature is still unstandardized and not supported by some browsers (such as Firefox and Safari) afaict.
The Angular SW aims to be super easy to set up and configure and cover the most common needs for a PWA. That unfortunately comes at the cost of being flexible and extensible. For more advanced usecases you can always either "extend" the Angular SW as described in #22145 (comment) or use another library, such as Workbox.
(Of course, we will revisit this in the future is the status of the feature changes (e.g. it gets standardized, gains more widespread adoption by browsers, etc.).)
@gkalpak Thanks for the feedback.
I hope one day to be able to work with more features like background sync, in an easy way as it is done today using angular pwa.
Activity
SimonKunz commentedon Mar 13, 2018
I think this feature is crucial for real offline capable applications.
Is there already some kind of roadmap for this?
niveditaece commentedon Jun 15, 2018
is there an alternative way to achieve background sync in angular?
DaSchTour commentedon Jun 15, 2018
Just don't use angulars serviceworker but workbox
And I think angular should do the same, but that's another story
yonexbat commentedon Jul 21, 2018
It would be nice if custom code can be added to the generated service worker file. Or is it already possible?
deryfebriantara commentedon Jul 31, 2018
I already use angular service worker and trying to add background sync functionality, I considered try to use workbox for a while.
ajaynavgale commentedon Sep 25, 2018
Can someone point me to any guidance/best practice on how to implement background sync in Angular App? Thank you. @mhevery
siegenthalerroger commentedon Sep 30, 2018
Without allowing customisation of the service worker angular is falling behind to Vue (yes I know, vue uses workbox). I don't want to use workbox with angular, I'll use what the framework I'm using says I should.
jvitor83 commentedon Nov 6, 2018
@alxhub Do we have any ETA for that? Even in some alpha release?
kdesimini commentedon Nov 13, 2018
Yeah workbox is a nightmare. Is this even being considered?
SimonKunz commentedon Nov 16, 2018
With Google pushing PWAs everywhere it's very sad that there's still no proper serviceworker support in Angular.
Even registering a click handler on a web push notification is not possible right now.
I switched to using workbox in all of my Angular projects...
royanon commentedon Jan 9, 2019
This is sad. It is useless if background sync is not working.
This genius has save the world. Check it out.
https://golb.hplar.ch/2018/12/background-sync-ng.html
kdesimini commentedon Jan 9, 2019
It appears Google workbox background sync with Angular doesn't work on mobile devices either which sucks.
5 remaining items
ozzabozza commentedon Sep 20, 2020
Hi Maxim, I have seen some of your presentations about ngsw en workbox. Would it be possible to combine basic ngsw with workbox background sync?
webmaxru commentedon Sep 20, 2020
Hello Oscar! Both NGSW and Workbox have listeners of
fetchevent which might make the combination quite challenging. But in theory, this is possible - read "multiple fetch handlers" section of this answer: https://stackoverflow.com/a/45285119/1310228It seems like you have to create your own SW and
importScripts()NGSW and parts of Workbox there.Please keep us posted about your progress!
ozzabozza commentedon Sep 20, 2020
Thanks, Ill give it a try!
GlauberF commentedon Jun 21, 2021
any official position of the Angular team about this feature?
Note: I believe that instead of inventing the wheel, the time could be spent to majestically integrate with Google's workbox(https://developers.google.com/web/tools/workbox) library.
Where it already has many features and it would not need to be developed from scratch.
gkalpak commentedon Jun 21, 2021
There are currently no specific plans/timeline for implementing this. Keep in mind that this feature is still unstandardized and not supported by some browsers (such as Firefox and Safari) afaict.
The Angular SW aims to be super easy to set up and configure and cover the most common needs for a PWA. That unfortunately comes at the cost of being flexible and extensible. For more advanced usecases you can always either "extend" the Angular SW as described in #22145 (comment) or use another library, such as Workbox.
(Of course, we will revisit this in the future is the status of the feature changes (e.g. it gets standardized, gains more widespread adoption by browsers, etc.).)
GlauberF commentedon Jun 21, 2021
@gkalpak Thanks for the feedback.
I hope one day to be able to work with more features like background sync, in an easy way as it is done today using angular pwa.
naveedahmed1 commentedon May 15, 2022
Any update on this?
irapopova commentedon May 10, 2023
Any update on this?
wadlieb commentedon Oct 8, 2023
Any update on this?
leherv commentedon Jan 14, 2025
Any update on this?
JeanMeche commentedon Aug 27, 2025
Per #63364, we won't be addressing this issue.
The message is also visible here: https://angular.dev/ecosystem/service-workers
angular-automatic-lock-bot commentedon Sep 27, 2025
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.