Skip to content Skip to sidebar Skip to footer

Im Failing To Authenticate Big Query From My Node.js Firebase Functions Index.js File

I am using the big query API in my firebase functions index.js file, but I keep getting an internal server error when initializing the Big query instance, my first attempt was to i

Solution 1:

If you are using Cloud Functions for Firebase (i.e. Cloud Functions deployed via the Firebase CLI), you should not pass any options when creating the BigQuery client. Just do as follows:

const { BigQuery } = require('@google-cloud/bigquery');
const bigquery = newBigQuery();

As a matter of fact, Cloud Functions for Firebase use the App Engine default service account, i.e. {project-id}@appspot.gserviceaccount.com, which has an Editor role, which, by default, contains permissions to interact with BigQuery.

You can check here if the Editor "basic" role has the desired permissions.

Post a Comment for "Im Failing To Authenticate Big Query From My Node.js Firebase Functions Index.js File"