Skip to main content
Connect your PostHog account and access analytics events, feature flags, insights, and cohorts as local files.

Prerequisites

Get your PostHog API key

1

Open PostHog settings

Log in to PostHog and click your profile icon in the top right corner, then select Settings.
2

Create a personal API key

Navigate to Personal API Keys and click Create personal API key. Give it a descriptive name (e.g., “Airstore integration”).
3

Copy the key

Copy the generated key. It starts with phx_.

Connect PostHog

  1. Go to app.airstore.ai
  2. Navigate to Settings → Integrations
  3. Click PostHog → Connect
  4. Enter your API key and optionally a custom host URL

Available data

Once connected, you can access the following PostHog resources:
ResourceDescription
EventsAnalytics events tracked in your project (pageviews, custom events, etc.)
Feature flagsFeature toggles and their current status
InsightsSaved analyses like trends, funnels, and retention charts
CohortsUser segment definitions based on behavior or properties

Filesystem structure

After mounting, PostHog data appears under ~/airstore/posthog/:
~/airstore/posthog/
├── <smart-folder-name>/
│   ├── event_pageview_2024-01-15.md
│   ├── flag_new-onboarding-flow.md
│   ├── insight_signup-funnel.md
│   └── cohort_power-users.md

Smart folder queries

Create smart folders with natural language to query your PostHog data:
QueryWhat you get
”active feature flags”Currently enabled feature toggles
”pageview events from last week”Recent page view analytics data
”onboarding funnel insights”Saved funnel analyses for user onboarding
”power user cohort”User segment definitions
Airstore uses keyword-based routing to determine which PostHog resource to query. For example:
  • Words like “flag” or “toggle” route to feature flags
  • Words like “funnel” or “retention” route to insights
  • Words like “cohort” or “segment” route to cohorts
  • Event-related queries route to events by default
If you’re running PostHog on your own infrastructure, provide your custom host URL when connecting. Airstore will use this URL instead of the default PostHog Cloud endpoint.Via the dashboard, enter your host URL in the connection form. Via the CLI, use the --host flag:
airstore connection add ws_abc123 posthog \
  --api-key phx_xxxxxxxxxxxx \
  --host https://posthog.yourcompany.com

Next steps