RealComposer

PostHog Safe & Unsafe Practices

Direct Answer

The PostHog project API key (phc_) is public and can only ingest events. Personal API keys (phx_) can query all analytics data and manage the project, so they are server-only. Avoid sending personal data in event properties.

Credentials & Where They Belong

Client safe
Project API key (phc_)

Write-only event ingestion and feature flag evaluation.

Server only
Personal API key (phx_)

Reads insights, persons, and recordings across your projects.

Safe Practices

  • Scope personal keys to required projects and scopes

    Grant query:read for dashboards instead of full access.

  • Mask sensitive inputs in session replay

    Keep input masking on and block elements with personal data.

Unsafe Practices

  • Using a personal API key in a frontend dashboard

    Anyone can query every event and person in your project.

  • Capturing emails or names as event properties

    Analytics data is widely shared internally and is hard to purge later.

The RealComposer Pattern

Store POSTHOG_PERSONAL_KEY in the vault and expose a cached pipeline that returns aggregated metrics, never raw person records.

START BUILDING FREE

Frequently Asked Questions

Q:Is the PostHog project API key a secret?

No. It is designed for clients and can only send events. Personal API keys are the secrets.

Multi-API Aggregation

Combine intercom with posthog user events

Intercom conversation list plus PostHog person properties in one payload. For "combine intercom with posthog user events", store INTERCOM_ACCESS_TOKEN, POSTHOG_PERSONAL_API_KEY in Secret Vault, call https://api.intercom.io/contacts from a Worker, and let React hit only https://realcomposer.com/v1/workspace/combine-intercom-with-posthog-events with an rc_live_ client token.

Sub-10ms edgeView Recipe

Related Concepts