Providers / PostHog

Analytics

PostHog API keys and credentials

What every PostHog credential a founder holds does, whether it expires, and what tends to break. Each fact links to PostHog's own docs.

Last checked 2026-11-06 · posthog.com

At a glance

CredentialExpiryPermissions
PostHog dashboard loginNot documented–
Personal API key (phx_)Not documentedCan be scoped
Project token (phc_, used in frontend snippet)Not documentedFull access only
Project secret API key (beta, server-to-server)Not documentedCan be scoped

Each credential

PostHog dashboard login

Dashboard login. Session and 2FA policy not documented on the pages reviewed. Access to projects is controlled through organization membership.

PostHog docs

Personal API key (phx_)

Created under account settings > Personal API keys; the value is shown only once. Scopes are chosen at creation (examples such as insight:read or * for full access) and can be changed later. Access can be organization-wide, specific projects, or all projects. Up to 10 keys per account. No expiry setting is documented on the pages reviewed. Keys can be rolled (new value, old value invalidated) or revoked individually. Keys are deleted when their user is removed. A key leaked to public GitHub is automatically rolled and the user is emailed.

PostHog docs

Project token (phc_, used in frontend snippet)

Found on the Project page. The same token is embedded in the frontend snippet posthog.init(...) and used for public endpoints (event capture, flag evaluation). The docs do not say whether it can be rotated or expires; the phc_ prefix was not confirmed on the page reviewed.

PostHog docs

Project secret API key (beta, server-to-server)

Intended for server-to-server access not tied to a user. Scoped to a single project with only the scopes granted. Rolling out gradually; may not be available in every organization. Expiry and rotation details not documented on the pages reviewed.

PostHog docs

What usually goes wrong

Renewals and billing

Usage-based product analytics with a free tier per the pricing page headline. Billing cadence, invoice access and billing API were not confirmed on the pricing page reviewed (content truncated).

What PostHog's docs don't say

We couldn't confirm these from official docs, so don't rely on them either way:

Rotating or replacing a PostHog key

The steps are the same for most providers: make the new key, deploy it everywhere the old one is used, check it works, then revoke the old one. Our guides walk through it:

Sources

Keep track of every PostHog key

StackHangar stores your PostHog keys in an encrypted vault, grouped by the product they belong to, warns you before they expire, and walks you through rotating them. We can't read your secrets.