PostHog 加入 Vercel Marketplace

发布: (2026年2月10日 GMT+8 21:00)
2 分钟阅读

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 模板 以了解更多关于此集成的信息。

0 浏览
Back to Blog

相关文章

阅读更多 »

在 AI Gateway 上使用 MiniMax M2.5

概述 MiniMax M2.5 现已在 AI Gateway 上可用。M2.5 在构建之前进行规划,拆解功能、结构和 UI 设计,然后再编写代码。它 ha...

Vercel Flags 已进入公开测试版

概览 Vercel Flags https://vercel.com/docs/flags/vercel-flags 是内置于 Vercel 平台的 feature‑flag 提供商。它允许您创建和管理功能…

支持使用 Apple 登录

登录体验 现在登录体验支持 Sign in with Apple,帮助拥有 Apple 账户的用户更快速地访问。!Sign in with Apple – Light modeht...