Skip to main content

PostHog

This connector captures data from PostHog into Estuary collections.

This connector is available for use in the Estuary web application. For local development or open-source workflows, ghcr.io/estuary/source-posthog:dev provides the latest connector image. You can also follow the link in your browser to see past image versions.

Supported data resources

The connector captures the following PostHog resources:

Snapshot resources (full refresh each sync interval):

  • Organizations
  • Projects
  • Persons
  • Cohorts
  • Annotations

Incremental resources (cursor-based change tracking):

  • Feature Flags
  • Events
info

The connector automatically discovers and captures data from all projects within the specified organization. You do not need to configure individual projects.

Prerequisites

  • A PostHog account on US Cloud, EU Cloud, or a self-hosted instance.

  • A Personal API Key with the appropriate scopes for the resources you want to capture:

    ScopeResources
    cohort:readCohorts
    feature_flag:readFeature Flags
    annotation:readAnnotations
    query:readEvents, Persons

    A wildcard scope grants access to all resources.

  • Your Organization ID (UUID), which you can find in your PostHog organization settings.

info

Resources that your API key doesn't have the required scopes to access are automatically omitted during discovery.

Configuration

You configure connectors either in the Estuary web app, or by directly editing the Data Flow specification file. See connectors to learn more about using connectors. The values and specification sample below provide configuration details specific to the PostHog source connector.

Properties

Endpoint

PropertyTitleDescriptionTypeRequired/Default
/credentialsAuthenticationPersonal API Key credentials for PostHog.objectRequired
/credentials/credentialsAPI KeyPostHog Personal API Key.stringRequired
/organization_idOrganization IDUUID of the PostHog organization to capture data from. The connector captures from all projects within this organization.stringRequired
/base_urlBase URLPostHog API base URL. Use https://app.posthog.com for US Cloud, https://eu.posthog.com for EU Cloud, or a custom URL for self-hosted instances.stringhttps://app.posthog.com
/start_dateStart DateUTC date and time in the format YYYY-MM-DDTHH:MM:SSZ. Data added on and after this date will be captured. If left blank, defaults to 30 days before the present.string30 days ago

Bindings

PropertyTitleDescriptionTypeRequired/Default
/nameNameName of the PostHog resource.stringRequired
/intervalIntervalInterval between data syncs.stringPT5M

Sample

captures:
${PREFIX}/${CAPTURE_NAME}:
endpoint:
connector:
image: ghcr.io/estuary/source-posthog:dev
config:
credentials:
credentials: <secret>
organization_id: "your-organization-uuid"
base_url: https://app.posthog.com
start_date: "2024-01-01T00:00:00Z"
bindings:
- resource:
name: Events
interval: PT5M
target: ${PREFIX}/Events
- resource:
name: Persons
interval: PT5M
target: ${PREFIX}/Persons
- resource:
name: FeatureFlags
interval: PT5M
target: ${PREFIX}/FeatureFlags
{...}