posthog integration

Twig's integration with PostHog is what sets it apart from other code editors. By connecting to your product analytics, twig can help you make development decisions informed by real user behavior.

why analytics in your editor?

Most development decisions are made without direct access to user data:

  • "Do users actually use this feature?"
  • "What's the most common path through this flow?"
  • "Is this error happening frequently?"

Developers usually have to context-switch to a dashboard, run queries, then return to coding. Twig brings that data directly into your development environment.

what twig can access

When connected to PostHog, twig can:

  • view events - see what actions users take in your product
  • check feature flags - know which features are enabled for which users
  • access insights - reference your existing dashboards and charts
  • query data - ask the agent questions about user behavior

privacy and security

Twig accesses PostHog through your authenticated session:

  • your credentials - you sign in with your PostHog account
  • your permissions - twig can only access what you can access
  • project scope - data access is limited to selected projects
  • no storage - twig doesn't store analytics data locally

The agent may reference analytics data in conversations, but this stays within your twig session.

use cases

data-informed bug fixes

Instead of guessing about impact:

how many users are affected by errors in the checkout flow this week?

feature prioritization

Understand what users actually do:

what percentage of users use the advanced search filters?

validating changes

Check if your changes had the intended effect:

compare the conversion rate before and after we updated the signup form

understanding user flows

See how users navigate your product:

what's the most common path users take after landing on the pricing page?

connecting to posthog

For setup instructions, see connecting posthog.

For detailed information about PostHog features, visit the PostHog documentation.