diff --git a/GUIDE_API_KEY.md b/GUIDE_API_KEY.md index 5a9b65e..688b6c1 100644 --- a/GUIDE_API_KEY.md +++ b/GUIDE_API_KEY.md @@ -45,16 +45,3 @@ To configure multiple keys with per-key rate limits: ``` The app will round-robin requests across configured keys and respect `rateLimitPerMinute` values. - -## Storing keys safely - -- Do not commit `config.json` with keys to version control. Add `config.json` to `.gitignore`. -- Alternatively, keep a `config.json.example` in the repo and place the real keys in a local `config.json`. -- If you prefer to use environment variables, you can have a small loader script that reads an env var and writes `config.json` before running the app. - -## Troubleshooting - -- If you get quota or 403 errors, check API restrictions, project quotas, and whether the key is restricted to the wrong IP/referrer. -- Use multiple keys to spread requests if you hit per-key quotas. - -*** End of guide *** diff --git a/GUIDE_SERVICE_ACCOUNT.md b/GUIDE_SERVICE_ACCOUNT.md index 41a9be0..4a7f0b9 100644 --- a/GUIDE_SERVICE_ACCOUNT.md +++ b/GUIDE_SERVICE_ACCOUNT.md @@ -37,14 +37,20 @@ This guide explains how to create a Google service account, enable the Sheets AP ## 5. Configure the project -In `config.json`, set the `credentialsPath` field to the JSON file path, and remove any `apiKey` or `apiKeys` entries if you are using service account auth. - -Example: +In `config.json`, add the service account credentials under the `serviceAccounts` array. Here's an example using service account authentication: ```json { - "credentialsPath": "credentials.json", - "rateLimitPerMinute": 50, + "serviceAccounts": [ + { + "path": "credentials.json", + "rateLimitPerMinute": 50 + }, + { + "path": "credentials.json", + "rateLimitPerMinute": 50 + } + ], "documents": [ { "documentId": "YOUR_SPREADSHEET_ID", @@ -58,4 +64,6 @@ Example: } ] } -``` \ No newline at end of file +``` + +The app will round-robin requests across configured accounts and respect `rateLimitPerMinute` values. \ No newline at end of file diff --git a/config.example.json b/config.example.json index 6015870..06ec215 100644 --- a/config.example.json +++ b/config.example.json @@ -13,6 +13,10 @@ { "path": "credentials.json", "rateLimitPerMinute": 50 + }, + { + "path": "credentials_2.json", + "rateLimitPerMinute": 50 } ], "documents": [ @@ -25,6 +29,16 @@ "outputFilename": "sheet1.csv" } ] + }, + { + "documentId": "YOUR_SPREADSHEET_ID_2", + "outputDir": "output/your-document-2", + "sheets": [ + { + "name": "Sheet1", + "outputFilename": "sheet1.csv" + } + ] } ] }