Learning resourcesReviewed · Lovable

Connect your Lovable app to PostHog

This guide helps Lovable app builders add PostHog analytics and feature flags, but each connection uses one shared PostHog project and cannot access private admin APIs. It explains regional configuration, project-token handling, workspace sharing and browser or backend event capture.

Researched 15 Nov 2026

In short.

This setup guide is for Lovable app builders who want PostHog analytics and feature flags, but each connection shares one PostHog project across its linked apps. It documents a public phc_ project token exposed to browser code, direct requests to regional PostHog hosts, workspace access controls and connection management. It supports deciding whether this integration matches a project's needs; prices, SDK versions and runtime results are not established.

Researched and written by an AI model and checked by a second AI model. How it works

Coverage includes the complete page at [https://docs.lovable.dev/integrations/posthog.md], including its public-token warning, billing notice, permission defaults and deletion consequences. The original capture is selected-page.txt, acquired on 2026-11-15T16:18:46.692Z, with source revision sha256:2bac43f4257f335b764fa0f1ffbe8c41fd60e0813dfc19287225b44f801bde09. Linked pages, the documentation index and external sites are excluded. No implementation or service behavior was executed or tested.

The overview

Identity

The resource is Lovable's documentation guide for its PostHog app + chat connector at [https://docs.lovable.dev/integrations/posthog.md]. It explains how to configure a connection and link it to Lovable projects so their apps can capture events and evaluate feature flags.

The guide distinguishes this connector from the personal PostHog chat connector, which lets Lovable query analytics, flags and experiments as building context.

Assessment

The guide is useful for deciding whether shared project-level analytics and flags fit a Lovable app. It makes the token type, regional endpoints and access limitations explicit, reducing ambiguity about what the connection provides.

Its value is configuration guidance. It provides no complete implementation code or runtime evidence establishing successful event delivery, flag evaluation or production reliability.

Users

The intended users are Lovable builders adding signup tracking, product-usage events, gradual feature rollouts, conversion measurement or internal-tool analytics. Workspace administrators also need the permission and sharing details.

Beginners get a step-by-step connection procedure. Experienced developers get the credential prefixes, browser exposure rules, regional hosts and backend capture mechanism needed to assess architectural fit.

Capabilities

The documented connector supports browser event capture with posthog-js, feature-flag evaluation in browser or backend code, and server-side events sent to the PostHog capture API.

Examples cover product funnels, waitlist conversions, flagged onboarding, pricing-layout experiments and internal admin activity. Multiple connections can represent different PostHog projects or regions, including separate development and production environments.

Using it

Requirements

Setup requires a PostHog Cloud account and project, its numeric Project ID, a project token beginning phc_, the project's EU or US region, and permission to create connections in the Lovable workspace.

The page says connection creation defaults to admins on Business and Enterprise plans, while some Enterprise workspaces start with connections disabled. An admin or owner can change that setting. The documented procedure covers PostHog Cloud; support for self-hosted installations is not established.

Mechanism

Lovable syncs a PostHog project token for public capture and flag endpoints. Once linked, the token is exposed to browser code through a VITE_ environment variable. It is intentionally a public write key, so it must not be confused with a personal API key beginning phx_.

Apps contact eu.i.posthog.com or us.i.posthog.com directly according to the configured region. Requests do not pass through Lovable's connector gateway. Backend routes can also send capture events using the synced project token.

Setup

Copy the numeric Project ID and phc_ project token from PostHog project settings, then confirm the hosting region. In Lovable's Connectors catalog, select PostHog, choose Connect, and enter a display name, region, Project ID and token.

Connections are private by default. Sharing can grant access to named workspace members or the whole workspace. The page says Lovable validates the token before saving; an authorized builder can then ask Lovable in project chat to link the project to that connection.

Example

For a waitlist landing page, the guide proposes tracking page views, form starts and successful signups. These events would provide the inputs for examining where visitors leave the signup funnel in PostHog.

This is an illustrative use case. The page does not supply the event-handler code, an event schema or observed conversion results.

Assessment & evidence

Limitations

The connector rejects personal phx_ API keys, cannot cover private admin REST APIs requiring those keys, and does not provide per-end-user PostHog login. Each connection represents one PostHog project shared across its linked Lovable projects.

Deleting a connection removes its credentials from all linked projects, stopping dependent features until another connection is added. The page does not establish delivery guarantees, retry behavior, flag fallback behavior or SDK compatibility versions.

Fit rationale

The documented design fits apps that send telemetry and evaluate flags against a common PostHog project. Separate connections provide a documented way to separate environments or regions.

Applications requiring private administrative operations or individual PostHog accounts need capabilities outside this connector's stated scope. Because requests go directly to PostHog, regional endpoint access is also a practical deployment consideration.

Alternatives

The page identifies the PostHog chat connector, described as an MCP server, for letting Lovable query analytics, flags and experiments as personal building context. That serves a different need from configuring published apps to send events.

The linked chat-connector documentation is outside this page's coverage. Its setup, permissions and costs are unknown here, and the page provides no comparison with other analytics integrations.

Evidence

The evidence is the complete Lovable documentation page at [https://docs.lovable.dev/integrations/posthog.md]. It supports the described setup procedure, credential model, endpoint routing, sharing controls and stated limitations.

No runtime logs, benchmarks or completed application results are supplied. Nothing was executed; connection creation, token validation, event delivery, flag evaluation and deletion effects remain untested.

Access & freshness

Costs

Event capture, feature flags and other PostHog usage count toward the user's PostHog plan. PostHog handles that billing and quota directly.

Exact PostHog rates, included allowances, overage costs, Lovable charges and any separate connector fee are unknown from this page. The statement that app + chat connectors are available by default does not establish that usage is free.

Rights

The page provides no explicit documentation license or redistribution permission. It also does not establish the applicable SDK license, service terms, event-data rights or retention conditions.

Public exposure of the project token is a documented technical property. It does not establish permission to redistribute other credentials or collect particular user data.

Freshness

The available page was captured on 15 November 2026 at 16:18:46.692 UTC. That is the capture time, not an established publication or update date.

The text supplies no connector release number or pinned posthog-js version. Subsequent changes to Lovable settings, PostHog endpoints or service behavior are unknown.

Next steps

Confirm that shared project-level capture and flags meet the app's requirements. Gather the matching Project ID, phc_ token and region, confirm workspace permission, then create and link the connection with the intended sharing access.

Before relying on the integration, verify event arrival and flag behavior in the intended environment, review PostHog usage charges, and consult the applicable service and data terms. Use separate connections where development and production should send data to different PostHog projects.

Evidence for this report

selected-page.txtselected · checked 2026-11-15