Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
Mirrored from https://github.com/Camo67/composio.git
Synced Nov 21, 06:00 UTC
| 1 | ## How do I connect PostHog with an API key? |
| 2 | |
| 3 | PostHog connects with a personal API key. There's no OAuth option. |
| 4 | |
| 5 | ### Create the PostHog personal API key |
| 6 | |
| 7 | 1. Sign in to [PostHog](https://posthog.com/). The key acts as your PostHog user, so use the account whose projects you want Composio to reach. |
| 8 | 2. Click **Settings**, then scroll to **Personal API keys** and start a new key. |
| 9 | 3. Give the key a descriptive label. |
| 10 | 4. Choose its scopes. You can limit the key to specific projects or organizations and to the resources your tools need. Avoid full access unless you need it. |
| 11 | |
| 12 |  |
| 13 | |
| 14 | 5. Click **Create** and copy the key right away. It starts with `phx_` and PostHog shows it only once. Don't use the `phc_` project key. |
| 15 | |
| 16 | ### Create the auth config in Composio |
| 17 | |
| 18 | 1. In the [Composio dashboard](https://dashboard.composio.dev/~/project/auth-configs?utm_source=docs&utm_medium=content&utm_campaign=toolkits-posthog), go to **Auth Configs** → **Create**, select **PostHog**, and click **Create Auth Config**. |
| 19 | 2. Click **Connect Account**. Paste the personal API key and set the region (see the next question). The default is `us`. |
| 20 | 3. Confirm the account shows **Active** on the auth config's **Connected Accounts** tab. |
| 21 | |
| 22 | See [custom auth configs](/docs/auth-configuration/custom-auth-configs) for the general flow. |
| 23 | |
| 24 | The key's PostHog scopes decide what the connection can do. To limit which Composio tools run as well, list them under **Tools Available for Execution** in the auth config's settings. |
| 25 | |
| 26 | ## How do I configure the PostHog region for US or EU Cloud? |
| 27 | |
| 28 | Set the PostHog region on the connection. Use `us` for US Cloud or `eu` for EU Cloud. Do not pass a full URL such as `https://eu.posthog.com`; the toolkit builds the host as `<region>.posthog.com` from the region value. The field also accepts `us.i` or `eu.i` if your PostHog URL uses those hosts, and a self-hosted instance uses its own subdomain. Check your PostHog URL to confirm. |
| 29 | |
| 30 | This matters because the PostHog API host is different for US and EU Cloud, and region is connection-specific rather than one fixed auth-config value for every connected account. A connection that should call `eu.posthog.com` but is left on the default `us` region can fail or return data from the wrong PostHog environment. |
| 31 | |
| 32 | In the Link flow, the user sees a prefilled Region field while connecting and can choose the correct region. In the Initiate flow, set the region during connected-account creation. Existing connections were migrated to keep their current region, so they do not need to reconnect only because of this field change. |