PostHog/posthog:构建自驱动产品的开源平台,集成 MCP、Claude Code 等 Agent
英文标题:🔥 PostHog/posthog
PostHog 是一站式开源平台,提供产品分析、会话回放、特性标志、AI 可观测性等十余种工具,助力构建“自驱动产品”。它能捕获 Agent 所需的全部上下文,将错误、愤怒点击等信号自动转化为可供合并的 PR,实现主动诊断与修复。每月免费额度包含 100 万事件、5k 会话录制等,支持 Slack、Web、桌面版及 MCP 集成至 Claude Code、Cursor 等 Agent 环境。对开发者而言,PostHog 以透明定价和开源模式降低了自动化产品改进的门槛,为 AI 驱动型团队提供了从数据洞察到代码修复的完整链路。
29.8 KB
143.5 KB
210.7 KB
4.4 KB
1.8 KB
3.1 KB
1.9 KB
1.5 KB
4.4 KB
2.5 KB
2.3 KB
1.9 KB
1.6 KB
7.2 KB
1.3 KB
中文
文档 - 社区 - 路线图 - 为何选择 PostHog? - 更新日志 - 报告错误
PostHog 是用于构建自驱动产品的开源平台
PostHog 为你提供构建成功产品所需的全部工具,并捕获 Agent 主动诊断问题、发现机会、交付修复所需的全部上下文:
- 自驱动模式:将产品数据中的信号(错误、愤怒点击、失败的查询等)转化为可供审查和合并的研究报告与拉取请求。
- 产品分析:自动捕获或手动埋点,以事件为基础分析用户行为,并通过可视化或 SQL 分析数据。
- 网站分析:通过类似 Google Analytics 的仪表盘监控网站流量和用户会话。轻松监测转化、网站核心指标和收入。
- 会话回放:观看用户与你网站或移动应用的交互真实会话,以诊断问题并理解用户行为。
- 特性标志:通过特性标志,安全地向选定用户或群组推出功能。
- 实验:测试变更并衡量其对目标指标的统计影响。也可通过无代码方式设置实验。
- 错误追踪:追踪错误、接收警报并解决问题,以改进你的产品。
- 日志:采集、搜索和分析日志数据,与其他产品数据一起使用。
- 问卷:使用我们丰富的无代码问卷模板提问,或通过问卷构建器创建自定义问卷。
- 数据仓库:从 Stripe、Hubspot、你的数据仓库等外部工具同步数据,并与你的产品数据一起查询。
- 数据管道:对流入数据执行自定义过滤和转换。实时发送至 25+ 工具或任何 Webhook,或批量导出大量数据至你的仓库。
- AI 可观测性:捕获 LLM 驱动应用的追踪、生成、延迟和成本。
- 工作流:创建工作流来自动执行操作或向你的用户发送消息。
你可以通过 Slack、Web、桌面版(PostHog Code)或通过 MCP 在你自己的编辑器中操控这一切。
最棒的是,所有这些都可通过每个工具慷慨的月度免费额度免费使用。立即注册 PostHog Cloud US 或 PostHog Cloud EU 开始使用。
PostHog 入门
PostHog Cloud(推荐)
开始使用 PostHog 最快、最可靠的方式是免费注册 PostHog Cloud 或 PostHog Cloud EU。每月前 100 万事件、5k 录制、100 万次标志请求、100k 异常和 1500 份问卷回复免费,超出后按用量付费。
自行托管开源爱好者部署(高级)
如果你想自行托管 PostHog,可以在 Linux 上通过 Docker(建议 4GB 内存)一键部署爱好者实例:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/posthog/posthog/HEAD/bin/deploy-hobby)"
开源部署预计可扩展至每月约 100k 事件,之后我们建议迁移至 PostHog Cloud。
我们 不 为开源部署提供客户支持或保证。详情请见我们的自托管文档、问题排查指南和免责声明。
拥有 PostHog 实例后,你可以通过安装我们的 JavaScript 网页片段、其中一个 SDK 或使用我们的 API 来进行设置。你还可以连接 MCP,将 PostHog 引入 Claude Code、Cursor 或任何兼容 MCP 的 Agent。
我们为流行的语言和框架提供 SDK 和库,例如:
除此之外,我们还提供针对 Go、.NET/C#、Django、Angular、WordPress、Webflow 等更多内容的文档和指南。
安装 PostHog 后,参阅我们的产品文档以了解如何设置产品分析、网站分析、会话回放、特性标志、实验、错误追踪、问卷、数据仓库等。
进一步了解 PostHog
我们开源的不仅仅是代码 😳。我们还开源了我们的公司手册,其中详细说明了我们的战略、工作方式和流程。
好奇如何充分利用 PostHog?我们编写了一份玩转 PostHog 的指南,带你了解衡量激活、追踪留存和捕获营收的基础知识。
我们 ❤️ 大大小小的贡献:
本仓库适用 MIT expat 许可证,但 ee 目录(如适用,有其自有许可证)除外。
需要 完全 💯% 开源?查看我们的 posthog-foss 仓库,那里已移除所有专有代码和功能。
我们付费计划的定价完全透明,可在我们的定价页上查看。
嘿!如果你读到了这里,证明你是一个专注的 README 阅读者。
你也可能会成为我们团队中出色的一员。我们正在快速发展,非常期待你加入我们。
English / 原文
Docs - Community - Roadmap - Why PostHog? - Changelog - Bug reports
PostHog is the open source platform for building self-driving products
PostHog provides every tool you need to build a successful product, and captures all the context agents need to proactively diagnose problems, uncover opportunities, and ship fixes:
- Self-driving mode: Turn signals in your product data (errors, rage clicks, failed queries, and more) into researched reports and pull requests you review and merge.
- Product analytics: Autocapture or manually instrument event-based analytics to understand user behavior and analyze data with visualization or SQL.
- Web analytics: Monitor web traffic and user sessions with a GA-like dashboard. Easily monitor conversion, web vitals, and revenue.
- Session replays: Watch real user sessions of interactions with your website or mobile app to diagnose issues and understand user behavior.
- Feature flags: Safely roll out features to select users or cohorts with feature flags.
- Experiments: Test changes and measure their statistical impact on goal metrics. Set up experiments with no-code too.
- Error tracking: Track errors, get alerts, and resolve issues to improve your product.
- Logs: Ingest, search, and analyze log data alongside the rest of your product data.
- Surveys: Ask anything with our collection of no-code survey templates, or build custom surveys with our survey builder.
- Data warehouse: Sync data from external tools like Stripe, Hubspot, your data warehouse, and more. Query it alongside your product data.
- Data pipelines: Run custom filters and transformations on your incoming data. Send it to 25+ tools or any webhook in real time or batch export large amounts to your warehouse.
- AI observability: Capture traces, generations, latency, and cost for your LLM-powered app.
- Workflows: Create workflows that automate actions or send messages to your users.
You can steer it all from Slack, web, desktop (PostHog Code), or your own editor via the MCP.
Best of all, all of this is free to use with a generous monthly free tier for each tool. Get started by signing up for PostHog Cloud US or PostHog Cloud EU.
Getting started with PostHog
PostHog Cloud (Recommended)
The fastest and most reliable way to get started with PostHog is signing up for free to PostHog Cloud or PostHog Cloud EU. Your first 1 million events, 5k recordings, 1M flag requests, 100k exceptions, and 1500 survey responses are free every month, after which you pay based on usage.
Self-hosting the open-source hobby deploy (Advanced)
If you want to self-host PostHog, you can deploy a hobby instance in one line on Linux with Docker (recommended 4GB memory):
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/posthog/posthog/HEAD/bin/deploy-hobby)"
Open source deployments should scale to approximately 100k events per month, after which we recommend migrating to a PostHog Cloud.
We do not provide customer support or offer guarantees for open source deployments. See our self-hosting docs, troubleshooting guide, and disclaimer for more info.
Once you've got a PostHog instance, you can set it up by installing our JavaScript web snippet, one of our SDKs, or by using our API. You can also connect the MCP to bring PostHog into Claude Code, Cursor, or any MCP-compatible agent.
We have SDKs and libraries for popular languages and frameworks like:
Beyond this, we have docs and guides for Go, .NET/C#, Django, Angular, WordPress, Webflow, and more.
Once you've installed PostHog, see our product docs for more information on how to set up product analytics, web analytics, session replays, feature flags, experiments, error tracking, surveys, data warehouse, and more.
Learning more about PostHog
Our code isn't the only thing that's open source 😳. We also open source our company handbook which details our strategy, ways of working, and processes.
Curious about how to make the most of PostHog? We wrote a guide to winning with PostHog which walks you through the basics of measuring activation, tracking retention, and capturing revenue.
We <3 contributions big and small:
For an overview of the codebase structure, see monorepo layout and products.
This repo is available under the MIT expat license, except for the ee directory (which has its license here) if applicable.
Need absolutely 💯% FOSS? Check out our posthog-foss repository, which is purged of all proprietary code and features.
The pricing for our paid plan is completely transparent and available on our pricing page.
Hey! If you're reading this, you've proven yourself as a dedicated README reader.
You might also make a great addition to our team. We're growing fast and would love for you to join us.
