I am using this nodejs bigquery client
I have the service account json in string\text, I want to avoid to write it to temporary file due to security reasons.
Is there an option to do new BigQuery()
and provide the service account as string and not as filepath?
Couldn't find this option anythere, in all the examples need to provide the filepath or export the GOOGLE_APPLICATION_CREDENTIALS variable.
Thanks.
It is possible to use the values in your service account as string for authentication. You can use BigQueryOptions and pass a credentials object. Credentials object will need
client_email
andprivate_key
which can be found in your service account json.Using the sample code you linked in your question,
BigQueryOptions
can be implemented in this manner.The whole code will be:
Snippet of the output: