firebase / firebase/snippets-web

How to set firebase config from env variable in service worker with next js?

Open
#387 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
802
Forks
285
PR merge metrics
No merged PRs in 30d

Description

To receive the push notification in the background , need to init firebase sdk in the background using service worker as per [this doc](https://firebase.google.com/docs/cloud-messaging/js/receive#setting_notification_options_in_the_service_worker)

here when the Firebase config is added statically everything is working fine .

In service worker, process.env.ENV_NAME is not available, how to init SDK in server worker which allows to inject firebase config dynamically in Next Js via environment variable?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.