feat(docs-site): add PostHog analytics to the documentation site

Merged
ST
4d ago
+7-0

Summary

  • The documentation site (docs-site/, which Mintlify builds and serves at docs.quivr.thevibecompany.co) now sends analytics to the PostHog project "Quivr Docs" (US cloud).
  • It uses Mintlify's built-in PostHog integration: an integrations.posthog block in docs-site/docs.json with the public project key and apiHost: https://us.i.posthog.com. The repo has no JavaScript build for the docs, so there is no posthog-js dependency. Mintlify loads PostHog, captures pageviews and keeps PostHog's autocapture defaults.
  • sessionRecording is set to false. Mintlify turns recordings on by default, this change only asks for pageviews and autocapture, and the API playground is where readers type bearer tokens. Set it to true to turn recordings on; PostHog also needs the docs domain in its authorized URLs for that.
  • No changes to the Go engine or to any other frontend.

Configuration

  • Environment variables: none. Mintlify reads docs.json as static configuration and has no environment-variable substitution for integrations. The key is committed in docs.json; it is the public phc_ project key, which Mintlify documents as safe to commit. No other secret is added.
  • Reverse proxy: not set up. When apiHost is unset, Mintlify uses its own proxy (https://ph.mintlify.com); this PR points apiHost straight at https://us.i.posthog.com instead.
  • Accounts: the documentation site has no user accounts, so there is no identify, reset or signed_up event.
  • Local preview: Mintlify has no switch to turn the integration off in mint dev. In a scripted headless Chrome session on make docs-preview, the page loaded PostHog's config.js and called /flags/ on us.i.posthog.com. It sent no event requests, including after a client-side navigation. That is one local observation, not a documented guarantee.

How to test

  1. After merge and the Mintlify deploy, open https://docs.quivr.thevibecompany.co and click a few pages in the sidebar.
  2. In PostHog, project "Quivr Docs" → Activity / Live events: expect $pageview events for the first load and for each sidebar navigation.

Verification

  • make docs-site-check (Mintlify validate + broken-links --check-anchors, pinned mint@4.2.952) passes. mint validate checks the integrations.posthog schema: a non-boolean sessionRecording makes it fail.
  • make docs passes
  • make denylist passes; both commit messages pass scripts/denylist.py --stdin
  • Production pageview capture, including client-side route changes, is not verified: it depends on Mintlify's hosted build and can only be checked after deploy (see How to test).

Review gate

  • review-code-dev v2 (OCR v1.12.1), 1/1 files reviewed. One low finding (session recording on by default) was fixed in this PR. The re-review is clean.

Notes

  • docs-site/docs.json is hand-written site settings, not a living page declared in docs/inventory.toml, so no documentation page changes.
  • There is no Linear ticket for this change. It was requested and approved directly.

šŸ¤– Generated with Claude Code


Open workspace in Conductor


Summary by cubic

Adds PostHog analytics to the documentation site so pageviews and autocapture events land in the new "Quivr Docs" PostHog project (US cloud).

Uses Mintlify's built-in PostHog integration configured in docs-site/docs.json, with no new dependencies, environment variables, or engine changes. Session recording is explicitly disabled because Mintlify turns it on by default and the API playground accepts bearer tokens. No changes to the Go engine or any other frontend.