payload-posthog

Introduction

A full-featured, fully customizable PostHog integration for Payload CMS.

payload-posthog connects a Payload CMS site to PostHog: server-side event capture, user identification, feature flags, error tracking, session replay and surveys inside the admin panel, a reverse ingestion proxy, inbound webhooks, and group analytics — as one plugin. It also ships a public-site provider so the same PostHog project powers visitor analytics on your Next.js frontend.

Every feature is independently toggleable, and every automatic behavior (event names, captured properties, distinctId resolution) has an override. The underlying posthog-node client is also exported directly, so anything the plugin doesn't wrap is still one import away.

Why

Wiring PostHog into a Payload site by hand usually means repeating the same handful of decisions on every project: which collections to instrument, how to identify the acting user, where to put the reverse proxy, how to gate a feature flag in an endpoint. payload-posthog makes those decisions once, as sensible defaults, while keeping every one of them overridable.

Next steps

On this page