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

Use Credentials from .env and not from json #63

Closed
jansgescheit opened this issue Sep 19, 2020 · 2 comments
Closed

Use Credentials from .env and not from json #63

jansgescheit opened this issue Sep 19, 2020 · 2 comments

Comments

@jansgescheit
Copy link

Is it possible to get the firebase service credentials not from a json file but from an environment or as Firebase offers as a server auth token?

Like here https://github.com/laravel-notification-channels/fcm/tree/v1#setting-up-the-fcm-service

My problem ist that i can easily set environment in my deployment but not a file.

@jeromegamez
Copy link
Member

While it's not documented on purpose, it's possible with setting the environment variable FIREBASE_CREDENTIALS with the minified output of the JSON file. You can create it, for example, with jq and the following command

$ jq -c . < /path/to/service_account.json

@jansgescheit
Copy link
Author

@jeromegamez thanks for the hint, i could have guessed that too.
I put the content of the service_account.json to that environment. Works like a charm!

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

2 participants