I\'m making an app using Google Calendar API, and planning to build it on Heroku.
I have a problem about authentication. Usually I use credential json file for that, but
You can create the JSON key file by adding a .profile file to the repo, which will be executed when Heroku starts up the container.
Set a config variables:
heroku config:set GOOGLE_APPLICATION_CREDENTIALS=gcp_key.json
heroku config:set GOOGLE_CREDENTIALS=
The GOOGLE_CREDENTIALS is easier to set in the Heroku dashboard.
Create a .profile with a line to write the json file:
echo ${GOOGLE_CREDENTIALS} > /app/gcp_key.json
Obviously, commit the changes to .profile and push to heroku.
The recommended buildpack doesn't work anymore and, in any case, this feels more direct without being hard.