PostHog 加入 Vercel Marketplace
发布: (2026年2月10日 GMT+8 21:00)
2 分钟阅读
原文: Vercel Blog
Source: Vercel Blog


PostHog 现已在 Vercel Marketplace 上提供,作为功能标记、实验和分析服务商。
功能
- 使用 Flags SDK 和
@flags-sdk/posthog适配器在代码中声明标记。 - 实时为特定用户或用户群体切换功能。
- 通过基于百分比的滚动发布逐步推出更改。
- 运行 A/B 测试,在全面发布前验证影响。
此集成帮助在 Vercel 上构建的团队更有信心地交付:在生产环境中测试、降低发布风险,并基于真实用户行为做出数据驱动的决策,全部在您现有的 Vercel 工作流中完成。
入门指南
创建一个 flags.ts 文件,包含 identify 函数和标记定义:
import { postHogAdapter } from '@flags-sdk/posthog';
import { flag, dedupe } from 'flags/next';
import type { Identify } from 'flags';
export const identify = dedupe(async () => ({
distinctId: 'user_distinct_id' // replace with real user ID
})) satisfies Identify;
export const myFlag = flag({
key: 'my-flag',
adapter: postHogAdapter.isFeatureEnabled(),
identify,
});
查看 PostHog 模板 以了解更多关于此集成的信息。