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

# Connect WordPress

> Configure your API key to connect your WordPress site to Impossible.

# Connect WordPress

Connect your WordPress site to Impossible by entering your API key in the settings. The plugin connects to the Impossible API automatically.

## Prerequisites

* Impossible plugin installed and activated
* An API key from the [Impossible web app](https://impossible.sh)

## Configure settings

<Steps>
  <Step title="Open settings">
    In WordPress admin, go to **Impossible → Settings**.
  </Step>

  <Step title="Enter API key">
    Paste your API key in the **API Key** field. The key is stored securely and displayed masked after saving.
  </Step>

  <Step title="Local development (optional)">
    If you're using LocalWP or a local site behind ngrok, check **Are you using this on a local / development environment?** and paste your tunnel URL (e.g. from ngrok) so the orchestrator can reach your site.
  </Step>

  <Step title="Test connection">
    Click **Test Connection**. Wait for "Connection successful." This validates your key and registers your site.
  </Step>

  <Step title="Save">
    Click **Save** if you made changes. The builder will not work until Test Connection succeeds.
  </Step>
</Steps>

<Check>
  **Success:** When Test Connection succeeds, the plugin stores a site secret used for secure requests. You can now open the builder.
</Check>

## Settings reference

| Field                   | Description                                                                                                    |
| ----------------------- | -------------------------------------------------------------------------------------------------------------- |
| **API Key**             | From the Impossible web app (Dashboard → API Keys). Stored masked; paste the full key when saving.             |
| **Local / development** | Toggle to show Site URL Override. Use when running locally with ngrok so the orchestrator can reach your site. |
| **Site URL Override**   | Your ngrok or tunnel URL. Only visible when "Local / development" is checked.                                  |
| **Test Connection**     | Validates the API key and registers this site. Required before using the builder.                              |

## Environment-specific setup

<Tabs>
  <Tab title="Production">
    For production:

    * Enter only your API key. The plugin connects to the Impossible API automatically.
    * Do not set `WPA_DEV_MODE` — use Test Connection for proper authentication
    * Ensure your WordPress site has a public HTTPS URL
  </Tab>

  <Tab title="Local development">
    For local development with LocalWP or similar:

    * Check **Are you using this on a local / development environment?**
    * Run ngrok (or another tunnel) on your local WordPress site
    * Paste the tunnel URL in **Site URL Override**
    * Optional: Add `define('WPA_DEV_MODE', true);` to `wp-config.php` to skip HMAC during local testing (never use in production)
  </Tab>
</Tabs>

<Warning>
  Keep your API key private. Never commit it to version control or expose it in public code.
</Warning>
