-
-
Save sharp2448/47a7a403583eb8be71bbf6774041402f to your computer and use it in GitHub Desktop.
Exemple save Google key json
This file contains hidden or 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
| GOOGLE_SERVICE_ACCOUNT_JSON={"type":"service_account","project_id":"my-project-id",...} | |
| // Copy this entire JSON as a minified string |
This file contains hidden or 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
| // Load the service account JSON from environment variable | |
| const serviceAccountJson = process.env.GOOGLE_SERVICE_ACCOUNT_JSON; | |
| if (!serviceAccountJson) { | |
| // Throw an error if the env variable is not set | |
| throw new Error("Missing GOOGLE_SERVICE_ACCOUNT_JSON env variable"); | |
| } | |
| // Parse the JSON string into a JavaScript object | |
| export const googleServiceAccount = JSON.parse(serviceAccountJson); |
This file contains hidden or 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
| { | |
| "type": "service_account", | |
| "project_id": "my-project-id", | |
| "private_key_id": "abc123", | |
| "private_key": "-----BEGIN PRIVATE KEY-----\nMIIE...\n-----END PRIVATE KEY-----\n", | |
| "client_email": "my-service-account@my-project-id.iam.gserviceaccount.com", | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment