I'm trying to initialize the Firebase Admin SDK, in go, using only environment variables (no access to a filesystem).
I have the service-account-file.json
file, and can get it working locally via:
export GOOGLE_APPLICATION_CREDENTIALS="/path/to/service-account-file.json"
...
myfile.go:
app, err := firebase.NewApp(context.Background(), nil)
However, I'd like to put the contents of service-account-file.json
into an env var, and init the firebase Admin SDK with its value.
There is an open issue that claims you can do it via CredentialsFromJSON, however I can't quite figure it out.
Does anyone have this working? If so can you please provide an example?