Skip to content

Connect your app to PostHog

Connect your app to PostHog to capture product analytics events, evaluate feature flags, and send server-side events from your RShift Sites app.

Updated View as Markdown

PostHog is a product analytics platform for event capture, feature flags, and experiments. The PostHog app + chat connector lets your RShift Sites app send events and evaluate flags with a PostHog project token, in the browser and from backend code.

Use If you want to
App + chat connector (this page) Work with a shared PostHog project token in the project chat and in your published apps
Chat connector (MCP server) Let RShift Sites query your PostHog analytics, flags, and experiments as context while you build (personal to you)

With PostHog, your app can:

  • Capture product analytics events with posthog-js using a project token
  • Evaluate feature flags for users in the browser or from backend code
  • Send events from server routes to the PostHog capture API
  • Build product experiences on top of analytics and feature flags

This connector syncs a project token (phc_) for PostHog’s public capture and flags endpoints. Your app calls PostHog ingest hosts directly. It does not use RShift Sites’ connector gateway, and it does not accept personal API keys (phx_).

Common use cases and example apps

Use PostHog when your RShift Sites app needs product analytics, feature flags, or server-side event capture tied to a PostHog project.

Example app Example prompt Description
Product analytics dashboard Use PostHog and build a SaaS app that tracks signups, feature usage, and retention events. Instrument the core product funnel with PostHog events.
The app initializes posthog-js, captures key actions, and sends them to your PostHog project.
Feature-flagged rollout Use PostHog and gate the new onboarding flow behind a feature flag so only flagged users see it. Ship features gradually with PostHog flags.
The app evaluates a flag for each user and renders the new or old experience based on the result.
Waitlist with conversion tracking Use PostHog and build a waitlist landing page that tracks page views, form starts, and successful signups. Measure landing-page conversion in PostHog.
The app captures funnel events so you can see where visitors drop off.
In-app experiment Use PostHog and A/B test two pricing page layouts, then track which variant converts more often. Run a simple experiment with PostHog.
The app assigns a layout from a flag and captures conversion events for each variant.
Backend event capture Use PostHog and send a server-side signup_completed event when a user finishes account creation on the backend. Record reliable server-side events in PostHog.
The app posts capture events from a backend route using the synced project token.
Internal admin analytics Use PostHog and add event tracking to our internal admin tools so we can see which workflows get used. Understand internal tool usage.
The app tracks admin actions and surfaces usage patterns in PostHog.

How to connect PostHog

Who can create PostHog connections depends on your plan and workspace settings. App + chat connectors are available by default on Free, Pro, and Business plans. On Enterprise plans, they are effectively disabled at first: Who can create connections and clients defaults to No one until an admin changes it in Connectors → Admin settings → App + chat connectors.

You can create multiple PostHog connections using different projects or regions, which is useful for separating environments (for example, development and production).

When the connection is created, you can link it to the projects where you want to use it. Anyone building in a project can ask RShift Sites in the project chat to link their project to it.

Prerequisites

Before connecting PostHog, make sure you have:

  • A PostHog Cloud account and project
  • The project’s numeric Project ID
  • A project token that starts with phc_
  • The cloud region where the project is hosted (eu or us)
  • Permission to create connections in your RShift Sites workspace (see Who can create connections and clients)

Step 1: Get your PostHog project details

You need three values from PostHog: region, project ID, and project token.

To find them:

Open your PostHog project

Sign in to PostHog (or your EU host if your project is on EU Cloud).

Open project settings

Go to Project settings.

Copy the project ID and project token

Copy the numeric Project ID and a Project API key / project token that starts with phc_.

Confirm your region

Note whether the project is on Europe (eu.i.posthog.com) or the United States (us.i.posthog.com). See PostHog API base URL.

See PostHog documentation for more: Project API keys.

Step 2: Connect PostHog to RShift Sites

You can create multiple connections using different PostHog projects or tokens.

Open PostHog in Connectors

Open Connectors and select PostHog. For the other places to open the catalog from, see Where to find connectors.

Add a connection

Click Add connection.

Configure the connection

  1. Display name: name the connection, for example PostHog Prod. This name is only used inside RShift Sites to identify the connection. 2. Region: select Europe (eu.i.posthog.com) or United States (us.i.posthog.com) to match where your PostHog project is hosted. 3. Project ID: paste the numeric PostHog project ID from Project settings. 4. Project token: paste the project token that starts with phc_.

Choose who can use this connection

Under Sharing, the connection is private to you by default and shows a Private label. To share it, click Share with others. Then add workspace members by email, or click Invite entire workspace to make the connection available to everyone in your RShift Sites workspace.

See Who can use connections and clients for more information.

Connect

Click Connect. RShift Sites validates the project token against PostHog before saving the connection.

When connected, anyone building in a project can ask RShift Sites in the project chat to link their project to PostHog (based on configured connection-level access). Your RShift Sites apps can then capture events and evaluate feature flags with the synced project token and region.

Limitations

The PostHog connector cannot:

  • Accept personal API keys (phx_). Use a project token (phc_) only.
  • Proxy PostHog requests through RShift Sites’ connector gateway. Your app calls PostHog ingest hosts directly (eu.i.posthog.com or us.i.posthog.com).
  • Cover PostHog private admin REST APIs that require a personal API key.
  • Support per-end-user PostHog login. Each connection represents a single PostHog project shared across all projects linked to it.

Manage your {connector_0} connection

Connections are managed from Connectors: select {connector_0}, then open the connection.

  • Unlink projects to remove {connector_0} access from specific projects while keeping the connection available for others. See Unlink projects from a connection for the steps.
  • Delete the connection to remove it from the workspace entirely. Deleting is permanent. It removes the credentials from all linked projects, and app features that use {connector_0} stop working until a new connection is added. See Delete a connection for the steps and who can delete.
Navigation

Search for a question, a feature, or a task.

↑↓ to navigate↵ to openEsc to close