{"id":15711261,"url":"https://github.com/plasmohq/gcp-refresh-token","last_synced_at":"2025-05-12T21:21:22.291Z","repository":{"id":40461115,"uuid":"480515988","full_name":"PlasmoHQ/gcp-refresh-token","owner":"PlasmoHQ","description":"A cli util to retrieve a Google OAuth 2.0 refresh token","archived":false,"fork":false,"pushed_at":"2024-01-24T09:48:33.000Z","size":112,"stargazers_count":3,"open_issues_count":4,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-03T08:43:30.657Z","etag":null,"topics":["browser-extension","chrome-extension","chrome-webstore","gcp","refresh-token"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/gcp-refresh-token","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PlasmoHQ.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-04-11T19:07:01.000Z","updated_at":"2024-04-24T15:31:21.000Z","dependencies_parsed_at":"2024-01-24T11:47:56.777Z","dependency_job_id":null,"html_url":"https://github.com/PlasmoHQ/gcp-refresh-token","commit_stats":{"total_commits":109,"total_committers":3,"mean_commits":"36.333333333333336","dds":0.01834862385321101,"last_synced_commit":"e9d0d5c05bce36b13d96e5c3c37000481a069020"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":"PlasmoHQ/qtt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PlasmoHQ%2Fgcp-refresh-token","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PlasmoHQ%2Fgcp-refresh-token/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PlasmoHQ%2Fgcp-refresh-token/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PlasmoHQ%2Fgcp-refresh-token/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PlasmoHQ","download_url":"https://codeload.github.com/PlasmoHQ/gcp-refresh-token/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253823701,"owners_count":21969891,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["browser-extension","chrome-extension","chrome-webstore","gcp","refresh-token"],"created_at":"2024-10-03T21:12:20.141Z","updated_at":"2025-05-12T21:21:22.268Z","avatar_url":"https://github.com/PlasmoHQ.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Google Cloud Platform Refresh Token\n\n`gcp-refresh-token` is a cli util from [plasmo](https://www.plasmo.com/) to retrieve a refresh token as specified in [Google's OAuth 2.0 Refresh Token Flow](https://developers.google.com/identity/protocols/oauth2/native-app#programmatic-extraction).\n\nThe key usecase is to leverage GCP in an external CI pipeline. The original goal of this package is to resolve [`chrome-webstore-api`](https://github.com/PlasmoHQ/chrome-webstore-api)'s [#12](https://github.com/PlasmoHQ/chrome-webstore-api/issues/12), with further discussion [here](https://github.com/fregante/chrome-webstore-upload/issues/59). However, it can be extended for other usecases (by adding an option for more scopes).\n\n## Usage\n\n1. [Configure a GCP project](https://developer.chrome.com/docs/webstore/using_webstore_api/#enable-cws-api) for the CI process\n1. Create an OAuth client key following [this guide](https://developer.chrome.com/docs/webstore/using_webstore_api/#get-keys).\n1. Download the JSON key file and store it as `key.json` file.\n1. Run `gcp-refresh-token`, replacing `pnpm dlx` with your preferred package manager equivalent (`npx` or `yarn dlx`):\n\n```sh\n## *** DO NOT PUSH key.json TO GIT ***\n# If no key file is found, it will generate a sample key.json file for you to fill out or replace\npnpm dlx gcp-refresh-token\n```\n\nThe resulted refresh token will be written into the `key.json` under the `chrome` property, ready to be used in your CI pipeline. If you use [`bpp`](https://www.browser.market), simply copy it:\n\n```json\n{\n  \"installed\": {},\n  \"chrome\": {\n    \"clientId\": \"etc\",\n    \"clientSecret\": \"etc\",\n    \"refreshToken\": \"etc\"\n  }\n}\n```\n\n\u003e You can also install and use it globally:\n\n```sh\npnpm add -g gcp-refresh-token\n\ngcp-refresh-token # or gcprt\n```\n\n\u003e For custom scope, add a `scope` property to the `key.json`:\n\n```json\n{\n  \"installed\": {},\n  \"scope\": [\"https://www.googleapis.com/auth/chromewebstore\"]\n}\n```\n\n## Development\n\n### Terminal 1:\n\n```sh\n# install deps\npnpm i\n\n# link global\npnpm link --global\n\n# run dev server\npnpm dev\n```\n\n### Terminal 2:\n\n```\ngcprt help\n```\n\n## Publish process\n\n1. Commit any changes to the repository.\n2. `pnpm version patch | minor | major`\n3. `pnpm publish`\n\n# Support\n\nJoin the [Discord channel](https://discord.browser.market)!\n\n# Acknowledgment\n\n- [@daneroo/get-me-a-googleapi-refresh-token](https://github.com/daneroo/get-me-a-googleapi-refresh-token)\n\n# License\n\n[MIT](./LICENSE) 🖖 [Plasmo Corp.](https://plasmo.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplasmohq%2Fgcp-refresh-token","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplasmohq%2Fgcp-refresh-token","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplasmohq%2Fgcp-refresh-token/lists"}