Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

posts/firebase-authentication-service-worker/ #253

Open
utterances-bot opened this issue Nov 28, 2021 · 4 comments
Open

posts/firebase-authentication-service-worker/ #253

utterances-bot opened this issue Nov 28, 2021 · 4 comments

Comments

@utterances-bot
Copy link

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.

https://miyauchi.dev/posts/firebase-authentication-service-worker/?utterances=d41191807da7189e42e02865DvcGDuhsGlTxsDXTaPAKLDrarJrrvepQzi0iASPxTHr9dUdrzuhP2De51PuAvRRJbVYyGqbuuEYbZd7Y4DkgY0ncf44CvHAdQ1VLJk1TDzKRV3TjWxf9EXrMI6c%3D#build-the-service-worker

Copy link

Appreciate the article, do you have any links to source? I couldn't find anything on your github

@TomokiMiyauci
Copy link
Owner

Copy link

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?

@TomokiMiyauci
Copy link
Owner

@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

registration.active?.postMessage('')

If you have any other questions, ask me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants