I've a Go app that uses the Google Vision API and Google Video intelligence API. To enter my credentials, I set the environment variable called GOOGLE_APPLICATION_CREDENTIALS
. To do so, I assign a file path to this variable that points to the directory where my credentials are stored in.
Problem:
My credentials are not initially saved in a file. Instead they are assigned to a string variable inside my app. As a workaround, I store that value to a temporary file and then assign it's path to GOOGLE_APPLICATION_CREDENTIALS
, like described above.
Question:
Is it possible to set API credentials for cloud.google.com/go/vision/apiv1
without this file?
i do not know how it on Google Vision Api, but for the Google Sheets Api there is such stuff:
config, err := google.ConfigFromJSON(b, "https://www.googleapis.com/auth/spreadsheets.readonly")
so b is a slice taken from the file credentials.json
u can just take it from any other place by yourself