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

# PostHog

> Access analytics, feature flags, and user insights from PostHog

## At a glance

* **Availability**: Experimental ([how to enable](/cloud/integrations)).
* **Auth**: API key.
* **Connection**: The key from `POSTHOG_API_KEY` is sent as the `Bearer` prefixed `Authorization` header.
* **Docs**: [https://posthog.com/docs/api](https://posthog.com/docs/api)

## Credentials

Set these per environment. See [Connect an integration](/cloud/integrations).

| Variable          | Required | Description                                                                                                                                                         |
| ----------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `POSTHOG_API_KEY` | Yes      | PostHog Personal API Key [Docs](https://posthog.com/docs/api/overview).                                                                                             |
| `POSTHOG_HOST`    | No       | PostHog API host (defaults to [https://us.posthog.com](https://us.posthog.com); app.posthog.com is the legacy US alias) [Docs](https://posthog.com/docs/self-host). |

## Tools

| Tool               | Access | Description                                    |
| ------------------ | ------ | ---------------------------------------------- |
| Get Trends         | Read   | Retrieve event trends and analytics data       |
| List Feature Flags | Read   | List all feature flags in your PostHog project |
| List Persons       | Read   | List persons/users tracked in PostHog          |
| Capture Event      | Write  | Track a custom event in PostHog                |

## Example prompts

* Show me the trends for key events in my PostHog project over the last 7 days.
* List all active feature flags and their current rollout status.
* Give me insights about recent user activity and top users in my PostHog project.
