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

# PostHog

<img src="https://mintcdn.com/shipkit/HuQd_kWdB4hOr_Br/images/posthog.png?fit=max&auto=format&n=HuQd_kWdB4hOr_Br&q=85&s=61502bdca65aa5268a048905e3bb4dd4" alt="PostHog" width="2400" height="700" data-path="images/posthog.png" />

Posthog in ShipKit provides a comprehensive analytics toolkit for detailed user behavior tracking. From session recording to feature flags, Posthog allows you to dive deep into how users interact with your application. Its robust feature set supports advanced analysis, helping you refine and enhance user experience based on real usage data.

Sign up for a free <a href="https://posthog.com" target="_blank">Posthog</a> account.

## Environment variables

To enable PostHog in your project, simply add the following environment variables to your `.env` file:

<Tabs>
  <Tab title="Astro">
    ```ini theme={null}
    # .env
    PUBLIC_POSTHOG_KEY=
    PUBLIC_POSTHOG_HOST=
    ```
  </Tab>

  <Tab title="Next.js">
    ```ini theme={null}
    # .env
    NEXT_PUBLIC_POSTHOG_KEY=
    NEXT_PUBLIC_POSTHOG_HOST=
    ```
  </Tab>
</Tabs>
