> ## Documentation Index
> Fetch the complete documentation index at: https://docs.postqueen.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Chrome Extension

> Set up the PostQueen browser extension for cookie-based integrations

Skool has no public API, so she reaches it the way you do: through your own logged-in browser. The extension hands her the session cookie.

## How It Works

1. You install the PostQueen Chrome Extension in your browser.
2. When adding a cookie-based channel, the extension reads your session cookies for that platform.
3. The cookies go to her backend, where they are stored as an encrypted JWT.
4. The extension automatically refreshes cookies every 24 hours to keep connections alive.

<Warning>
  Using cookies to interact with platforms may violate their terms of service. Use this feature at your own risk.
</Warning>

<Note>
  The packaged PostQueen extension is coming soon to the Chrome Web Store. Until then, you build it
  from source.
</Note>

<Warning>
  **Until it is published, this needs an instance you administer.** `EXTENSION_ID` is read from the
  server environment, and every unpacked build gets its own ID, so the build in your browser has to
  be the one that instance was told about. On a hosted instance you do not control, your own build's
  ID will not match and the connect stops at *Extension Not Found* before anything reaches the
  network.
</Warning>

## Installation

<Steps>
  <Step title="Build the Extension">
    Build the extension from the [PostQueen monorepo](https://github.com/GkhanKINAY/postqueen-app). The extension has no dependencies of its own, so the workspace install at the repo root has to run first:

    ```bash theme={"system"}
    git clone https://github.com/GkhanKINAY/postqueen-app
    cd postqueen-app
    pnpm install
    cd apps/extension
    pnpm build
    ```

    Then load the `apps/extension/dist` folder as an unpacked extension in Chrome:

    1. Navigate to `chrome://extensions/`
    2. Enable **Developer mode** (top right toggle)
    3. Click **Load unpacked** and select the `dist` folder
  </Step>

  <Step title="Get the Extension ID">
    After loading the extension, you need its **Extension ID**:

    1. Go to `chrome://extensions/` in Chrome
    2. Find the **PostQueen** extension
    3. Copy the **ID** shown under the extension name (a 32-character string)

    Each unpacked build gets its own ID, so use the value Chrome shows for your build.
  </Step>

  <Step title="Configure the Environment Variable">
    Add the extension ID to your PostQueen environment variables:

    ```env theme={"system"}
    EXTENSION_ID="your-extension-id"
    ```

    Restart PostQueen after setting this variable.
  </Step>
</Steps>

## Supported Platforms

Skool is the one channel that needs it today:

<Card title="Skool" icon="https://mintcdn.com/forceplay/LL5FipRv-7nhg1To/images/channels/skool.svg?fit=max&auto=format&n=LL5FipRv-7nhg1To&q=85&s=8bd78662b4d4be75ea42ac2141fa0981" href="/providers/skool" width="64" height="64" data-path="images/channels/skool.svg">
  She posts to your communities once the extension is loaded
</Card>

## Self-Hosted Considerations

Running her on a domain other than `localhost` or `*.postqueen.ai`? You build a custom extension with your domain in the `externally_connectable` manifest field.

Edit `apps/extension/manifest.json` and add your domain:

```json theme={"system"}
{
  "externally_connectable": {
    "matches": [
      "http://localhost/*",
      "https://localhost/*",
      "https://*.postqueen.ai/*",
      "https://postqueen.example.com/*"
    ]
  }
}
```

Then rebuild the extension and load it as an unpacked extension in Chrome.

The manifest field is only half of it. The extension compiles its own allowed-origin list from
`FRONTEND_URL` and `NEXT_PUBLIC_BACKEND_URL` at build time, and any page outside that list is
answered with `Unauthorized origin`.

<Warning>
  **The build script does not read the repository's `.env`.** The watch build used during
  development does, the production `pnpm build` does not, so building without passing the values
  produces an extension that only trusts localhost. Pass them on the command line:

  ```bash theme={"system"}
  FRONTEND_URL="https://postqueen.example.com" \
  NEXT_PUBLIC_BACKEND_URL="https://postqueen.example.com/api" \
  pnpm build
  ```
</Warning>

## Troubleshooting

* **"Extension not found"**: make sure the `EXTENSION_ID` environment variable is set and PostQueen has been restarted.
* **"Extension not reachable"**: the extension may be disabled. Check `chrome://extensions/` and make sure PostQueen is enabled.
* **"Unauthorized origin"**: the extension was built without your `FRONTEND_URL`. Rebuild with it set.
* **"Could not get cookies"**: you must be logged in to the platform in the same Chrome browser where the extension is installed.
* **Cookies expire**: the extension automatically refreshes cookies every 24 hours. If a connection drops, try reconnecting the channel.
