snippets-web icon indicating copy to clipboard operation
snippets-web copied to clipboard

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

Open nileshzala005 opened this issue 1 year ago • 0 comments

To receive the push notification in the background , need to init firebase sdk in the background using service worker as per this doc

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?

nileshzala005 avatar Dec 06 '24 12:12 nileshzala005