View Source Plausible.Billing.Plans (Plausible v0.0.1)
Summary
Functions
Finds a plan by product ID.
Returns a list of plans available for the user to choose.
Returns the limit of sites a user can have.
Returns the most appropriate plan for a user based on their usage during a given cycle.
List yearly plans product IDs.
Functions
@spec find(String.t() | Plausible.Billing.Subscription.t(), [ Plausible.Billing.Plan.t() ]) :: Plausible.Billing.Plan.t() | nil
@spec find(nil, any()) :: nil
Finds a plan by product ID.
Returns nil when plan can't be found.
@spec for_user(Plausible.Auth.User.t()) :: [Plausible.Billing.Plan.t()]
Returns a list of plans available for the user to choose.
As new versions of plans are introduced, users who were on old plans can still choose from old plans.
@spec monthly_pageview_limit(Plausible.Billing.Subscription.t()) :: non_neg_integer() | nil
@spec site_limit(Plausible.Auth.User.t()) :: non_neg_integer() | :unlimited
Returns the limit of sites a user can have.
For enterprise customers, returns :unlimited. The site limit is checked in a background job so as to avoid service disruption.
@spec suggest(Plausible.Auth.User.t(), non_neg_integer()) :: Plausible.Billing.Plan.t()
Returns the most appropriate plan for a user based on their usage during a given cycle.
If the usage during the cycle exceeds the enterprise-level threshold, or if the user already belongs to an enterprise plan, it suggests the :enterprise plan.
Otherwise, it recommends the plan where the cycle usage falls just under the plan's limit from the available options for the user.
@spec yearly_product_ids() :: [String.t()]
List yearly plans product IDs.