Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

feat(billing): notify code alpha plan users about june 4 migration (#57629)

posthog[bot]616e4ff7ecf5
diff --git a/frontend/src/scenes/billing/CodeSeatsSection.tsx b/frontend/src/scenes/billing/CodeSeatsSection.tsx
index 246128c2d06d..7d7f894cbf6f 100644
--- a/frontend/src/scenes/billing/CodeSeatsSection.tsx
+++ b/frontend/src/scenes/billing/CodeSeatsSection.tsx
@@ -1,6 +1,6 @@
import { useActions, useValues } from 'kea'
-import { LemonButton, LemonDialog, LemonTable, LemonTag } from '@posthog/lemon-ui'
+import { LemonBanner, LemonButton, LemonDialog, LemonTable, LemonTag } from '@posthog/lemon-ui'
import { dayjs } from 'lib/dayjs'
import { More } from 'lib/lemon-ui/LemonButton/More'
@@ -8,10 +8,21 @@ import { Tooltip } from 'lib/lemon-ui/Tooltip'
import { billingLogic } from './billingLogic'
import { CODE_PLAN_PRO } from './constants'
-import { canReactivateSeat, isProPlanKey, seatBillingLogic, seatPriceFromPlanKey } from './seatBillingLogic'
+import {
+ canReactivateSeat,
+ isAlphaPlanKey,
+ isProPlanKey,
+ seatBillingLogic,
+ seatPriceFromPlanKey,
+} from './seatBillingLogic'
import type { SeatData, SeatStatus } from './types'
+const ALPHA_PLAN_MIGRATION_DATE = 'June 4, 2026'
+
function planLabel(planKey: string): string {
+ if (isAlphaPlanKey(planKey)) {
+ return 'Alpha'
+ }
if (isProPlanKey(planKey)) {
return 'Pro'
}
@@ -44,8 +55,16 @@ function statusColor(status: SeatStatus): 'success' | 'warning' | 'muted' | 'pri
}
export function CodeSeatsSection(): JSX.Element {
- const { displaySeats, orgSeatsLoading, isAdmin, members, activeCount, cancelingCount, monthlyTotal } =
- useValues(seatBillingLogic)
+ const {
+ displaySeats,
+ orgSeatsLoading,
+ isAdmin,
+ members,
+ activeCount,
+ cancelingCount,
+ monthlyTotal,
+ hasAlphaSeats,
+ } = useValues(seatBillingLogic)
const { adminCancelSeat, adminUpgradeSeat, adminReactivateSeat } = useActions(seatBillingLogic)
const { billing } = useValues(billingLogic)
@@ -75,6 +94,12 @@ export function CodeSeatsSection(): JSX.Element {
)}
</div>
</div>
+ {hasAlphaSeats && (
+ <LemonBanner type="info" className="mb-4">
+ Alpha plan seats will be moved to the free plan automatically on {ALPHA_PLAN_MIGRATION_DATE}. After
+ that, you'll be able to upgrade them to the Pro plan.
+ </LemonBanner>
+ )}
<LemonTable
loading={orgSeatsLoading}
dataSource={displaySeats}
@@ -106,11 +131,22 @@ export function CodeSeatsSection(): JSX.Element {
title: 'Plan',
key: 'plan',
align: 'center',
- render: (_, seat: SeatData) => (
- <LemonTag type={isProPlanKey(seat.plan_key) ? 'primary' : 'muted'}>
- {planLabel(seat.plan_key)}
- </LemonTag>
- ),
+ render: (_, seat: SeatData) => {
+ if (isAlphaPlanKey(seat.plan_key)) {
+ return (
+ <Tooltip
+ title={`Alpha seats will be migrated to the free plan on ${ALPHA_PLAN_MIGRATION_DATE}.`}
+ >
+ <LemonTag type="completion">{planLabel(seat.plan_key)}</LemonTag>
+ </Tooltip>
+ )
+ }
+ return (
+ <LemonTag type={isProPlanKey(seat.plan_key) ? 'primary' : 'muted'}>
+ {planLabel(seat.plan_key)}
+ </LemonTag>
+ )
+ },
},
{
title: 'Status',
@@ -146,7 +182,10 @@ export function CodeSeatsSection(): JSX.Element {
if (!billing?.has_active_subscription || !isAdmin) {
return null
}
- const canUpgrade = seat.status === 'active' && !isProPlanKey(seat.plan_key)
+ const canUpgrade =
+ seat.status === 'active' &&
+ !isProPlanKey(seat.plan_key) &&
+ !isAlphaPlanKey(seat.plan_key)
const canCancel = seat.status === 'active'
const canReactivate = canReactivateSeat(seat)
diff --git a/frontend/src/scenes/billing/seatBillingLogic.spec.ts b/frontend/src/scenes/billing/seatBillingLogic.spec.ts
index b168c0dcc5bb..544e3267e69a 100644
--- a/frontend/src/scenes/billing/seatBillingLogic.spec.ts
+++ b/frontend/src/scenes/billing/seatBillingLogic.spec.ts
@@ -1,4 +1,10 @@
-import { canReactivateSeat, isFreePlanKey, isProPlanKey, seatPriceFromPlanKey } from './seatBillingLogic'
+import {
+ canReactivateSeat,
+ isAlphaPlanKey,
+ isFreePlanKey,
+ isProPlanKey,
+ seatPriceFromPlanKey,
+} from './seatBillingLogic'
describe('seatBillingLogic plan key helpers', () => {
describe('isProPlanKey', () => {
@@ -17,6 +23,21 @@ describe('seatBillingLogic plan key helpers', () => {
})
})
+ describe('isAlphaPlanKey', () => {
+ it.each([
+ ['posthog-code-pro-0-20260422', true],
+ ['posthog-code-pro-200-20260301', false],
+ ['posthog-code-pro-500-20270101', false],
+ ['posthog-code-free-20260301', false],
+ ['some-other-plan', false],
+ ['', false],
+ [null, false],
+ [undefined, false],
+ ])('isAlphaPlanKey(%p) === %p', (planKey, expected) => {
+ expect(isAlphaPlanKey(planKey)).toBe(expected)
+ })
+ })
+
describe('isFreePlanKey', () => {
it.each([
['posthog-code-free-20260301', true],
diff --git a/frontend/src/scenes/billing/seatBillingLogic.ts b/frontend/src/scenes/billing/seatBillingLogic.ts
index aa060a6febe3..6234f4029f04 100644
--- a/frontend/src/scenes/billing/seatBillingLogic.ts
+++ b/frontend/src/scenes/billing/seatBillingLogic.ts
@@ -22,8 +22,12 @@ export function isFreePlanKey(planKey: string | null | undefined): boolean {
return !!planKey && planKey.startsWith(CODE_FREE_PLAN_PREFIX)
}
+export function isAlphaPlanKey(planKey: string | null | undefined): boolean {
+ return planKey === CODE_PLAN_ALPHA_PRO
+}
+
export function canReactivateSeat(seat: Pick<SeatData, 'plan_key' | 'status'> | null | undefined): boolean {
- return !!seat && seat.status === 'canceling' && seat.plan_key !== CODE_PLAN_ALPHA_PRO
+ return !!seat && seat.status === 'canceling' && !isAlphaPlanKey(seat.plan_key)
}
// TODO: Replace with `seat.price` once billing exposes it via SeatSerializer
@@ -111,9 +115,14 @@ export const seatBillingLogic = kea<seatBillingLogicType>([
],
isPro: [(s) => [s.mySeat], (mySeat): boolean => isProPlanKey(mySeat?.plan_key)],
isFree: [(s) => [s.mySeat], (mySeat): boolean => isFreePlanKey(mySeat?.plan_key)],
+ isAlpha: [(s) => [s.mySeat], (mySeat): boolean => isAlphaPlanKey(mySeat?.plan_key)],
canUpgrade: [
(s) => [s.mySeat],
- (mySeat): boolean => !!mySeat && mySeat.status === 'active' && isFreePlanKey(mySeat.plan_key),
+ (mySeat): boolean =>
+ !!mySeat &&
+ mySeat.status === 'active' &&
+ isFreePlanKey(mySeat.plan_key) &&
+ !isAlphaPlanKey(mySeat.plan_key),
],
canCancel: [(s) => [s.mySeat], (mySeat): boolean => !!mySeat && mySeat.status === 'active'],
canReactivate: [(s) => [s.mySeat], (mySeat): boolean => canReactivateSeat(mySeat)],
@@ -146,6 +155,11 @@ export const seatBillingLogic = kea<seatBillingLogicType>([
(s) => [s.displaySeats],
(displaySeats): number => displaySeats.filter((s: SeatData) => s.status === 'active').length,
],
+ hasAlphaSeats: [
+ (s) => [s.displaySeats, s.mySeat],
+ (displaySeats, mySeat): boolean =>
+ displaySeats.some((s: SeatData) => isAlphaPlanKey(s.plan_key)) || isAlphaPlanKey(mySeat?.plan_key),
+ ],
cancelingCount: [
(s) => [s.displaySeats],
(displaySeats): number => displaySeats.filter((s: SeatData) => s.status === 'canceling').length,