Skip to content

Latest commit

 

History

History
58 lines (33 loc) · 3.16 KB

token.md

File metadata and controls

58 lines (33 loc) · 3.16 KB

How to generate Google API tokens

chrome-webstore-api invokes the official Chrome Web Store API.

Note: the names you enter here don't really matter. It's an app that only you will have access to. This will take approximately 10 minutes and Google likes to change these screens often 🤓...

Process

Here's how to get the 3 keys: clientId, clientSecret and refreshToken

  1. Visit https://console.developers.google.com/apis/credentials

  2. Create a project:

    Google APIs: Create project
  3. Enter chrome-webstore-upload and Create

  4. Visit https://console.cloud.google.com/apis/credentials/consent

  5. Select on External and Create

    OAuth Consent Screen
  6. Only enter the Application name (e.g. chrome-webstore-upload) and required email fields, and click Save

    Consent screen configuration
  7. On the 3rd screen, add your own email address:

    Test users selection
  8. Visit https://console.developers.google.com/apis/library/chromewebstore.googleapis.com

  9. Click Enable

  10. Visit https://console.developers.google.com/apis/credentials

  11. Click Create credentials > OAuth client ID:

    Create credentials
  12. Select Desktop app, enter Chrome Webstore Upload, and click Create

    Create OAuth client ID
  13. Download the OAuth client JSON key, save it into a key.json file:

    OAuth client created
  14. Visit https://console.cloud.google.com/apis/credentials/consent

  15. Click PUBLISH APP and confirm

Publish app

  1. Download the credentials and save it as key.json.

  2. Open a console/terminal where you stored your key.json file. Run the following, replacing pnpm dlx with npx or yarn dlx as needed:

    pnpm dlx gcp-refresh-token

  3. The command will open an OAuth consent screen on the web. Follow its steps and warnings (this is your own personal app). Make sure the local port is correct.

  4. Done. Now you should have ✅ clientId, ✅ clientSecret and ✅ refreshToken in key.json. You can use these for all your extensions, but don't share them!