# PostHog Product analytics and feature flags - Package: @bijectionhq/posthog - Category: Analytics - Status: Preview - License: MIT - Bijection source (repository access required): https://github.com/bijectionhq/posthog/tree/5fcadbc07c351596f783d27070d556a46658de67/packages/convex - Upstream: https://github.com/PostHog/posthog-js/tree/3ddaa65402896c91dcb7b04cfe433e0b1d2f3313/packages/convex - Documentation: https://docs.bijection.com/components/using - Directory: https://bijection.com/components/posthog ## Get the source Bijection repository access is required. Request access at https://bijection.com/contact. ```sh git clone https://github.com/bijectionhq/posthog.git cd posthog git checkout 5fcadbc07c351596f783d27070d556a46658de67 cd packages/convex ``` ## Before using this component Read the package README at the recorded revision for setup, dependencies, and API examples. Upstream documentation describes the original package and may differ from the Bijection adaptation. This is a source candidate for evaluation. Catalog inclusion does not establish npm availability or runtime qualification. Check compatibility with your SDK and deployment before adoption. External providers run their own compute. ## Upstream package documentation Recorded 2026-10-23. This describes @posthog/convex; check the Bijection adaptation separately. The PostHog Convex package integrates PostHog analytics and feature flags directly into your Convex backend. It enables event tracking, product analytics, and feature flag evaluation from within Convex functions without requiring client-side instrumentation for backend events. This is the official PostHog library for Convex, maintained by the PostHog team. ### Use cases - Tracking server-side events from Convex mutations and actions, such as user signups, purchases, or data changes, without relying on client-side tracking - Evaluating PostHog feature flags inside Convex functions to gate backend logic or return different data based on flag state - Capturing analytics for LLM or AI workflows running in Convex actions, where client-side SDKs cannot reach - Sending structured logs and error tracking data from Convex backend functions to PostHog for observability - Instrumenting multi-step backend pipelines with product analytics events to understand funnel performance at the server level ### How it works Install the package with `npm install @posthog/convex` and configure it with your PostHog project API key. The library is designed to be used inside Convex functions, including queries, mutations, and actions, giving you access to PostHog's event capture and feature flag APIs from the server context. Feature flag evaluation and event capture happen via the PostHog API, which means actions are the appropriate function type when network calls are required, since Convex queries and mutations cannot perform arbitrary fetch requests. The package abstracts the PostHog API surface so you can call it using familiar PostHog SDK patterns without managing HTTP requests manually. Full SDK usage examples and configuration options are maintained in the official PostHog documentation at posthog.com/docs/libraries/convex, which is kept up to date alongside the package. A working demo is available at the linked example in the PostHog monorepo. ### Upstream README # PostHog Convex package

npm version Convex Component

Please see the main [PostHog docs](https://posthog.com/docs). SDK usage examples and code snippets live in the official documentation so they stay up to date. ## Documentation - [Convex library docs](https://posthog.com/docs/libraries/convex)