posts/firebase-authentication-service-worker/
Authentication with Firebase Authentication in Service Worker | miyauci.me
Introduce how to use Firebase Authentication in Service Worker. It will also explain messaging with Service Worker and show how to share user IDs with Service Worker.
Appreciate the article, do you have any links to source? I couldn't find anything on your github
@leku451 Have a look at the following. https://github.com/TomokiMiyauci/me/blob/main/posts/firebase-authentication-service-worker/index.mdx
Tomoki-San, thank you for your reply. I meant that it seems your examples are incomplete.. is there a github repo or project where you have actually implemented this stuff?
@leku451 Thank you for your comment. I use it on this blog.
https://github.com/TomokiMiyauci/me/blob/main/src/workers/fetch.ts#L18
After bundling the service worker script above, I inserted it into gatsby-plugin-offline to use it.
https://github.com/TomokiMiyauci/me/blob/main/config/gatsby-plugins.ts#L277
The gatsby-plugin-offline contains a script to activate the service worker. Also, the uid exchange is done as follows https://github.com/TomokiMiyauci/me/blob/main/src/workers/message.ts#L7 https://github.com/TomokiMiyauci/me/blob/27b72c97c887ae65bab4e3d9ef99e7853e4ca8b3/src/hooks/user.ts#L25
If you have any other questions, ask me.