This guide explains how to set up Chrome Web Store API access for automated extension publishing.
- Google Cloud Console access
- Chrome Web Store Developer Account
- Extension already published on Chrome Web Store
- Go to Google Cloud Console
- Create a new project or select existing project
- Navigate to APIs & Services > Library
- Search for "Chrome Web Store API"
- Click on it and press Enable
- Navigate to APIs & Services > Credentials
- Click Create Credentials > OAuth 2.0 Client IDs
- Configure the OAuth consent screen if prompted
- Choose Web application as the application type
- Add authorized redirect URIs:
http://localhost:8080https://oauth2.googleapis.com/token
- Click Create
- Note down the Client ID and Client Secret
- Go to Google OAuth2 Playground
- Click the settings icon (⚙️) in the top right
- Check "Use your own OAuth credentials"
- Enter your Client ID and Client Secret
- Close settings
- In the left panel, find and select:
- Chrome Web Store API v1
- https://www.googleapis.com/auth/chromewebstore
- Click Authorize APIs
- Sign in with your Google account
- Click Exchange authorization code for tokens
- Copy the Refresh token
# Step 1: Get authorization code
AUTH_URL="https://accounts.google.com/o/oauth2/auth?client_id=YOUR_CLIENT_ID&redirect_uri=http://localhost:8080&scope=https://www.googleapis.com/auth/chromewebstore&response_type=code&access_type=offline"
echo "Open this URL in your browser:"
echo "$AUTH_URL"
# Step 2: Exchange code for tokens
curl -X POST \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "client_id=YOUR_CLIENT_ID" \
-d "client_secret=YOUR_CLIENT_SECRET" \
-d "code=AUTHORIZATION_CODE" \
-d "grant_type=authorization_code" \
-d "redirect_uri=http://localhost:8080" \
"https://oauth2.googleapis.com/token"- Go to Chrome Web Store Developer Dashboard
- Find your extension
- Copy the Extension ID from the URL or extension details
Add the following secrets to your GitHub repository:
- Go to your repository > Settings > Secrets and variables > Actions
- Add the following secrets:
CHROME_CLIENT_ID: Your OAuth2 Client IDCHROME_CLIENT_SECRET: Your OAuth2 Client SecretCHROME_REFRESH_TOKEN: Your Refresh Token
Ensure your workflow uses the correct Extension ID:
env:
EXTENSION_ID: your-extension-id-here- Verify all OAuth2 credentials are correct
- Ensure Chrome Web Store API is enabled
- Check that Extension ID matches your published extension
- Verify your Chrome Web Store Developer Account is active
- Refresh tokens can expire - generate a new one
- Ensure OAuth2 client has the correct scopes
- Verify redirect URIs are properly configured
- Go to Google Cloud Console > APIs & Services > Library
- Search for "Chrome Web Store API" and enable it
- Never commit OAuth2 credentials to version control
- Use GitHub Secrets for all sensitive information
- Regularly rotate refresh tokens
- Monitor API usage in Google Cloud Console