PostHog
PostHog is product analytics, session replay, and feature flags in one service. In an app you build with Appsanic, you use it to see what people actually do - which screens they open, which actions they take - and to switch features on or off for a slice of users without a new release.
Connect it inside a project and that project can use it. Other projects keep separate connections.
What you get by connecting it
With PostHog connected, the agent can:
- Add explicit, preview-safe event capture through PostHog's HTTP endpoint.
- Add a typed
track()helper so the events you name have consistent properties. - Read feature-flag decisions through the preview-safe decide endpoint.
- Leave native SDK, autocapture, and session-replay setup instructions for after export.
Dashboards populate only after events actually arrive. Native autocapture and session replay require the PostHog React Native SDK and a development build; connecting the project key alone does not enable them.
Connecting it
PostHog uses a Project API key (it starts with phc_). An optional Personal API key (phx_) enables only a read-only connection probe. Appsanic does not use it to read insights, create dashboards, or manage feature flags during a build.
To find the project key, open PostHog and go to Settings then Project.
Open the Appsanic project build, select Connectors → PostHog, and enter the key or keys. Saved secret fields are shown as dots, never the value. Use Test now to re-check them and Disconnect to remove them from the project.
Keys and security
PostHog is a just connect connector. The project key is publishable - it is meant to live in client code - so the agent embeds it directly where the app needs it. There is no server-side relay for this connector.
The publishable project key and host are approved public connector metadata. An optional personal API key is encrypted with AES-256-GCM and represented to the browser and model only by a presence flag. The agent never asks for a private key in chat.
Useful links
- PostHog documentation: https://posthog.com/docs
- Appsanic guide: Analytics
Next
Read Analytics for how to decide what to track and how to read the numbers once events start flowing.
