PostHog
Integrate PostHog to track user behavior and analytics in your documentation, including page views, feature usage, and user interactions.
Provide the API key at publish time
The ${POSTHOG_API_KEY} syntax reads the key from an environment variable at publish time, so the variable must be present in whatever environment runs fern generate --docs.
When you publish with a GitHub Actions workflow, map the secret into the publish step’s env:
.github/workflows/publish-docs.yml
For a full list of events Fern forwards to your PostHog instance, see the analytics events reference.