> For the complete documentation index, see [llms.txt](https://nvsbl.gitbook.io/apphafen/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nvsbl.gitbook.io/apphafen/chrome-web-store.md).

# Chrome Web Store

This app needs five values for a Chrome Web Store connection:

* `Client ID`
* `Client Secret`
* `Refresh Token`
* `Publisher ID`
* `Extension URLs or IDs`

## What each value is

### Client ID and Client Secret

These come from a Google Cloud OAuth client that is allowed to use the Chrome Web Store API.

{% stepper %}
{% step %}

### Open the [Chrome Web Store API setup guide](https://developer.chrome.com/docs/webstore/using-api).

{% endstep %}

{% step %}

### Open Google Cloud Console and create or select a project.

{% endstep %}

{% step %}

### Enable the `Chrome Web Store API`.

{% endstep %}

{% step %}

### Configure the OAuth consent screen.

{% endstep %}

{% step %}

### Go to `Credentials`.

{% endstep %}

{% step %}

### Create an `OAuth client ID`.

{% endstep %}

{% step %}

### Choose `Web application`.

{% endstep %}

{% step %}

### Add this redirect URI exactly:

```
https://developers.google.com/oauthplayground
```

{% endstep %}
{% endstepper %}

Google will then show the `Client ID` and `Client Secret`.

### Refresh Token

Generate the refresh token in OAuth Playground with the same OAuth client.

{% stepper %}
{% step %}

### Open [OAuth Playground](https://developers.google.com/oauthplayground).

{% endstep %}

{% step %}

### Click the gear icon.

{% endstep %}

{% step %}

### Enable `Use your own OAuth credentials`.

{% endstep %}

{% step %}

### Paste the exact `Client ID` and `Client Secret` created above.

{% endstep %}

{% step %}

### Use this scope:

```
https://www.googleapis.com/auth/chromewebstore
```

{% endstep %}

{% step %}

### Click `Authorize APIs`.

{% endstep %}

{% step %}

### Sign in with the Google account that owns the Chrome Web Store items you want to manage.

{% endstep %}

{% step %}

### Click `Exchange authorization code for tokens`.

{% endstep %}

{% step %}

### Copy the `refresh_token`.

{% endstep %}
{% endstepper %}

{% hint style="warning" %}

* The refresh token must be created with the same OAuth client whose `Client ID` and `Client Secret` are stored in this app.
* The Google account used during authorization must own the Chrome Web Store publisher and items being tracked.
  {% endhint %}

### Publisher ID

Find the `Publisher ID` in the Chrome Web Store Developer Dashboard.

{% stepper %}
{% step %}

### Open the [Developer Dashboard](https://chrome.google.com/webstore/devconsole).

{% endstep %}

{% step %}

### Switch to the correct publisher context if needed.

{% endstep %}

{% step %}

### Open the `Account` section.

{% endstep %}

{% step %}

### Copy the displayed `Publisher ID`.

{% endstep %}
{% endstepper %}

If you use a group publisher, make sure you have switched into that group before copying the ID.

### Extension URLs or IDs

This app accepts any of the following and extracts the extension IDs automatically:

* Chrome Web Store listing URLs
* Chrome Web Store dashboard URLs
* Raw 32-character extension IDs

Examples:

```
https://chromewebstore.google.com/detail/my-extension/abcdefghijklmnopqrstuvwxzyabcdef
https://chrome.google.com/webstore/detail/my-extension/abcdefghijklmnopqrstuvwxzyabcdef
abcdefghijklmnopqrstuvwxzyabcdef
```

You can paste them one per line or comma-separated.

## Required Google-side prerequisites

* The `Chrome Web Store API` must be enabled in the same Google Cloud project as the OAuth client.
* If the OAuth app is still in testing mode, the Google account you use must be listed as a test user on the OAuth consent screen.
* Google requires 2-step verification on the Google account for Chrome Web Store publishing and update workflows.

## Quick validation checklist

If the app shows `Chrome authentication failed.`, check these in order:

{% stepper %}
{% step %}

### Confirm the `Chrome Web Store API` is enabled in the Google Cloud project.

{% endstep %}

{% step %}

### Confirm the OAuth client is type `Web application`.

{% endstep %}

{% step %}

### Confirm the OAuth client contains this redirect URI:

```
https://developers.google.com/oauthplayground
```

{% endstep %}

{% step %}

### Confirm the refresh token was generated with the exact same `Client ID` and `Client Secret` you entered in this app.

{% endstep %}

{% step %}

### Confirm the Google account used in OAuth Playground owns the publisher and extensions you want to track.

{% endstep %}

{% step %}

### Confirm the `Publisher ID` is copied from the correct publisher context.

{% endstep %}
{% endstepper %}

## Direct token test

You can verify the OAuth credentials outside the app with:

```bash
curl "https://oauth2.googleapis.com/token" \
  -d "client_id=YOUR_CLIENT_ID" \
  -d "client_secret=YOUR_CLIENT_SECRET" \
  -d "refresh_token=YOUR_REFRESH_TOKEN" \
  -d "grant_type=refresh_token"
```

Expected success shape:

```json
{
  "access_token": "ya29...",
  "expires_in": 3600,
  "scope": "https://www.googleapis.com/auth/chromewebstore",
  "token_type": "Bearer"
}
```

Common failures:

* `invalid_client`: wrong `Client ID` or `Client Secret`
* `invalid_grant`: bad, expired, revoked, or mismatched refresh token
* `unauthorized_client`: OAuth client or project setup issue

## Direct API test

If token refresh works, verify one item directly:

```bash
curl -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  "https://chromewebstore.googleapis.com/v2/publishers/YOUR_PUBLISHER_ID/items/YOUR_EXTENSION_ID:fetchStatus"
```

Interpretation:

* `200`: credentials and ownership are correct
* `403`: the authenticated Google account does not have access to that publisher or extension
* `404`: wrong publisher ID or wrong extension ID

## Sources

* [Use the Chrome Web Store API](https://developer.chrome.com/docs/webstore/using-api)
* [Chrome Web Store API reference](https://developer.chrome.com/docs/webstore/api/reference/rest)
* [Chrome Web Store API V1 reference](https://developer.chrome.com/docs/webstore/api/v1)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://nvsbl.gitbook.io/apphafen/chrome-web-store.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
