[PM-44272] feat: add upgrade-nudge service abstraction and rollout flag (#24649)

* feat(billing): add premium upgrade-nudge service abstraction

* feat(billing): register feature-based upgrade paths rollout flag

* fix(billing): remove TOTP mentioning in comment
This commit is contained in:
Stephon Brown
2026-11-10 15:20:02 -05:00
committed by GitHub
parent 7dd65223f4
commit 3eca4f7da5
2 changed files with 18 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
export interface PremiumUpgradeNudgeOptions {
titleKey: string;
descriptionKey: string;
unlockedFeatureKeys?: string[];
imagePath?: string; // bundled UI screenshot;
checkoutFeatureNameKey?: string; // read only by the external-checkout service; web ignores it
}
export abstract class PremiumUpgradeNudgeService {
/**
* Determines if the user has a Premium subscription or should be shown an upgrade nudge.
* @param options The options for the premium upgrade nudge.
* @returns A promise that resolves to true if the user has Premium, false if the nudge is shown.
*/
abstract hasPremiumOrShowUpgradeNudge(options: PremiumUpgradeNudgeOptions): Promise<boolean>;
}

View File

@@ -55,6 +55,7 @@ export enum FeatureFlag {
PM29593_PremiumToOrganizationUpgrade = "pm-29593-premium-to-organization-upgrade",
PM38333_AnnualBillingSavings = "pm-38333-annual-billing-savings",
PamBillingSupport = "pm-39883-pam-billing-support",
PM42214_FeatureBasedUpgradePaths = "pm-42214-feature-based-upgrade-paths",
/* Key Management */
PrivateKeyRegeneration = "pm-12241-private-key-regeneration",
@@ -190,6 +191,7 @@ export const DefaultFeatureFlagValue = {
[FeatureFlag.DebugDisableSelfHostPremiumCheck]: FALSE,
[FeatureFlag.PM29593_PremiumToOrganizationUpgrade]: FALSE,
[FeatureFlag.PM38333_AnnualBillingSavings]: FALSE,
[FeatureFlag.PM42214_FeatureBasedUpgradePaths]: FALSE,
/* Key Management */
[FeatureFlag.PrivateKeyRegeneration]: FALSE,