Generates a Google credential file (google-credentials.json) based on Heroku Config/Env Variables.
#ENABLE BUILD PACK
- CLI INSTALLATION Replace your-app-name with your app name
heroku buildpacks:set https://github.com/svikramjeet/google-credentials-heroku-buildpack.git -a your-app-name
- Via heroku dashbaord
a. Login to heroku
b. GO to APP setting page
c. check for buildpack section
d. paste https://github.com/svikramjeet/google-credentials-heroku-buildpack.git
and press enter
e. this should start reflecting from next build
#SET UP CONFIG VARS ON HEROKU
- Create Config Vars key
GOOGLE_CREDENTIALS
and paste the content of service account credential JSON file created via GCP. - Create a key under Config Vars
GOOGLE_APPLICATION_CREDENTIALS
and set a value asgoogle-credentials.json
asGOOGLE_APPLICATION_CREDENTIALS = google-credentials.json
This will hold the contents of the service account credential JSON file (copy and paste the JSON object into the text box)
Note: If you are using LARAVEL please set GOOGLE_APPLICATION_CREDENTIALS = ../google-credentials.json