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 once at the account level and every project in your account can use it.
What you get by connecting it
With PostHog connected, the agent:
- Initialises PostHog at the root of your app, so tracking is live from the first screen.
- Adds a typed
track()helper, so events are captured consistently with autocomplete on the event name and properties. - Wires up automatic screen-view tracking, so each navigation is recorded without you adding code per screen.
- Reads your feature flags, so you can gate a feature or run an experiment and have the app respond to the flag.
Session replay and the analytics dashboards then light up inside PostHog's own console as events arrive.
Connecting it
PostHog uses a Project API key (it starts with phc_). You can also add an optional Personal API key (it starts with phx_) if you want the connection to read data back, such as feature flag definitions.
To find the project key, open PostHog and go to Settings then Project.
Connect it in Dashboard then Connectors then PostHog, and paste the key (or keys) in. Saved secrets are shown as dots, never the value. The page has a Test connection control to re-check the key against PostHog, and a Disconnect control to remove it.
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.
Your stored keys are encrypted at rest with AES-256-GCM. The browser only ever sees that a secret exists, never its value, the AI never sees a decrypted key, and the agent never asks for a 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.
