firebase-admin-go icon indicating copy to clipboard operation
firebase-admin-go copied to clipboard

FR: Allow JSON string to be passed to GOOGLE_APPLICATION_CREDENTIALS

Open lordvidex opened this issue 1 year ago • 0 comments
trafficstars

  • Firebase Product: FCM

In order to use this library to send push notifications, it is necessary to pass the services_account.json file path to the environment variable GOOGLE_APPLICATION_CREDENTIALS. However, allowing the JSON string to be passed directly will also help for certain scenarios where the the secret do not necessary exist in a file.

In fact, the firebase_config is parsed this way.

For example:

secret := someSecretStore.Get("GOOGLE_CREDS")
os.Setenv("GOOGLE_APPLICATION_CREDENTIALS", secret)
...
# initialize firebase App

lordvidex avatar Dec 05 '23 13:12 lordvidex