Plan

The Plan interface represents a subscription plan defined in the application’s configuration.

The Plan interface defines the structure for a subscription plan, as configured within the global.saasConfig.plans array. These plans are used to determine pricing, features, and Stripe product/price associations.

Interface Definition

export interface Plan {
    id: string;
    titleKey: string;
    popular: boolean;
    priceIds: string[];
    currency: string;
    price: number;
    frequency: string;
    descriptionKeys: string[];
    free: boolean;
    legacy: boolean;
}

Properties

PropertyTypeDescription
idstringA unique identifier for the plan (e.g., 'basic-monthly', 'pro-yearly').
titleKeystringA key used for internationalization (i18n) to retrieve the plan’s display title.
popularbooleanA flag indicating if this plan should be highlighted as popular.
priceIdsstring[]An array of Stripe Price IDs associated with this plan. A plan can have multiple prices (e.g., for different features or metered billing).
currencystringThe currency code (e.g., 'usd') for the plan’s price.
pricenumberThe numerical price of the plan (e.g., 10.00).
frequencystringThe billing frequency (e.g., 'monthly', 'yearly').
descriptionKeysstring[]An array of i18n keys for features or benefits included in this plan.
freebooleanA flag indicating if this is a free plan.
legacybooleanA flag indicating if this is a legacy plan, potentially for grandfathered users.

Usage

Plan objects are part of the global application configuration (global.saasConfig) and are used by functions like createSubscription and changeSubscriptionPlan to validate plan IDs and retrieve associated Stripe price information.


Last modified August 17, 2025: cloud functions doc (4817130)