-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e7b9e7e
commit 68891e8
Showing
9 changed files
with
14 additions
and
427 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# .env | ||
PROJECT_ID= | ||
CLIENT_EMAIL= | ||
PRIVATE_KEY= |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,20 @@ | ||
const dotenv = require('dotenv'); | ||
const { BigQuery } = require('@google-cloud/bigquery'); | ||
|
||
// Load environment variables from .env file | ||
dotenv.config(); | ||
|
||
// Credentials to connect to BigQuery. | ||
const credentials = require('../api_keys/sciplay-5a03294800fe.json'); | ||
// const credentials = require('../api_keys/sciplay-5a03294800fe.json'); | ||
|
||
// Create a BigQuery client | ||
const bigqueryClient = new BigQuery({ | ||
projectId: credentials.project_id, | ||
projectId: process.env.PROJECT_ID, | ||
credentials: { | ||
client_email: credentials.client_email, | ||
private_key: credentials.private_key, | ||
client_email: process.env.CLIENT_EMAIL, | ||
private_key: process.env.PRIVATE_KEY, | ||
}, | ||
}); | ||
|
||
|
||
module.exports.bigqueryClient = bigqueryClient; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.