Skip to content

Releases: Rynvo/payload-posthog

payload-posthog@0.2.0

Choose a tag to compare

Minor Changes

  • 6ea197d: Add a public-site (non-admin) PostHog provider under a new payload-posthog/react entry.

    The existing payload-posthog/client provider is admin-scoped (it reads @payloadcms/ui config and identifies the logged-in admin), so it can't be reused on a public marketing/frontend site. The new PostHogProvider from payload-posthog/react:

    • has no @payloadcms/ui dependency and never calls the admin-authenticated config endpoint;
    • takes a public key/host from props or NEXT_PUBLIC_POSTHOG_KEY / NEXT_PUBLIC_POSTHOG_HOST;
    • captures $pageview on the initial load and on App Router client-side navigations (capture_pageview: 'history_change');
    • supports consent gating for a CMP via optOutCapturingByDefault + a reactive consent prop, plus usePostHog and usePostHogConsent hooks for imperative opt-in/opt-out.