Skip to content
Dashboard

PostHog joins the Vercel Marketplace

Marketplace Team
flags.ts
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<{ distinctId: string }>
export const myFlag = flag({
key: 'my-flag',
adapter: postHogAdapter.isFeatureEnabled(),
identify,
})

Create a flags.ts file with a simple identify function and a function to check your flag