🐸 Rybbit - open-source and privacy-friendly alternative to Google Analytics that is 10x more intuitive.
add tier 7
Bill Yang75e06be17031
diff --git a/client/src/components/SiteSettings/TrackingTab.tsx b/client/src/components/SiteSettings/TrackingTab.tsxindex 188292131..f36bda8e3 100644--- a/client/src/components/SiteSettings/TrackingTab.tsx+++ b/client/src/components/SiteSettings/TrackingTab.tsx@@ -91,7 +91,7 @@ export function TrackingTab({ siteMetadata, disabled = false }: TrackingTabPropsIS_CLOUD;const analyticsToggles: ToggleConfig[] = [- // Hide the replay toggle for AppSumo tiers without replays (1-3); tiers 4-6 include them+ // Hide the replay toggle for AppSumo tiers without replays (1-3); tiers 4-7 include them...(!isMobileSite &&!isSubscriptionLoading &&(!subscription?.planName?.startsWith("appsumo") || planIncludesReplay(subscription))diff --git a/client/src/lib/subscription/planUtils.tsx b/client/src/lib/subscription/planUtils.tsxindex 30961d6ed..063cfc6b7 100644--- a/client/src/lib/subscription/planUtils.tsx+++ b/client/src/lib/subscription/planUtils.tsx@@ -42,14 +42,14 @@ export function findPriceForTier(}// Whether a plan includes session replay: Pro plans (excluding large trials),-// AppSumo tiers 4-6, and custom (enterprise) plans. Mirrors the server-side+// AppSumo tiers 4-7, and custom (enterprise) plans. Mirrors the server-side// subscriptionIncludesReplay rule.export function planIncludesReplay(subscription: { planName: string; isTrial?: boolean; eventLimit?: number } | null | undefined): boolean {if (!subscription) return false;if (subscription.planName === "custom") return true;- if (/^appsumo-[456]$/.test(subscription.planName)) return true;+ if (/^appsumo-[4-7]$/.test(subscription.planName)) return true;const isLargeTrial = !!subscription.isTrial && (subscription.eventLimit ?? 0) >= 500_000;return subscription.planName.includes("pro") && !isLargeTrial;}diff --git a/server/src/api/stripe/getSubscription.ts b/server/src/api/stripe/getSubscription.tsindex acc24ee4a..411bfee58 100644--- a/server/src/api/stripe/getSubscription.ts+++ b/server/src/api/stripe/getSubscription.ts@@ -58,8 +58,8 @@ function computeLimits(return { memberLimit: BASIC_MEMBER_LIMIT, siteLimit: BASIC_SITE_LIMIT };}- // AppSumo tiers (e.g. "appsumo-1" through "appsumo-6")- const appsumoMatch = planName.match(/^appsumo-([123456])$/);+ // AppSumo tiers (e.g. "appsumo-1" through "appsumo-7")+ const appsumoMatch = planName.match(/^appsumo-([1-7])$/);if (appsumoMatch) {const tier = appsumoMatch[1];return {diff --git a/server/src/lib/const.ts b/server/src/lib/const.tsindex b2785f2e4..d20d109dd 100644--- a/server/src/lib/const.ts+++ b/server/src/lib/const.ts@@ -36,6 +36,7 @@ export const APPSUMO_SITE_LIMITS: Record<string, number | null> = {"4": 50,"5": 100,"6": null,+ "7": null,};export const APPSUMO_MEMBER_LIMITS: Record<string, number | null> = {"1": 1,@@ -44,6 +45,7 @@ export const APPSUMO_MEMBER_LIMITS: Record<string, number | null> = {"4": 25,"5": 50,"6": null,+ "7": null,};// AppSumo tier limits (lifetime plans with standard features)@@ -54,6 +56,7 @@ export const APPSUMO_TIER_LIMITS = {"4": 500_000,"5": 1_000_000,"6": 2_000_000,+ "7": 3_000_000,} as const;// Monthly session replay limits per AppSumo tier (0 = replays not included)@@ -64,6 +67,7 @@ export const APPSUMO_REPLAY_LIMITS: Record<string, number> = {"4": 500,"5": 1_000,"6": 2_000,+ "7": 3_000,};// Define a type for the plan objectsdiff --git a/server/src/lib/subscriptionUtils.ts b/server/src/lib/subscriptionUtils.tsindex 8b6bc1aed..602094363 100644--- a/server/src/lib/subscriptionUtils.ts+++ b/server/src/lib/subscriptionUtils.ts@@ -138,8 +138,8 @@ export async function getOverrideSubscription(organizationId: string): Promise<Oreturn null;}- // Check if it's an AppSumo tier override (e.g., "appsumo-1", "appsumo-2", "appsumo-3", "appsumo-4", "appsumo-5", "appsumo-6")- const appsumoMatch = org.planOverride.match(/^appsumo-([123456])$/);+ // Check if it's an AppSumo tier override (e.g., "appsumo-1" through "appsumo-7")+ const appsumoMatch = org.planOverride.match(/^appsumo-([1-7])$/);if (appsumoMatch) {const tier = appsumoMatch[1] as keyof typeof APPSUMO_TIER_LIMITS;const eventLimit = APPSUMO_TIER_LIMITS[tier];