Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Show correct subscription plan features for AWS billed org [GEN-8844] (#22824)

Thomas124205b27f1a
diff --git a/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/EnterpriseCard.tsx b/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/EnterpriseCard.tsx
index 2bf411ae287..d85e884eae3 100644
--- a/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/EnterpriseCard.tsx
+++ b/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/EnterpriseCard.tsx
@@ -1,15 +1,16 @@
import clsx from 'clsx'
import { PricingInformation } from 'shared-data'
import { Button, IconCheck } from 'ui'
+import { pickFeatures } from 'shared-data/plans'
export interface EnterpriseCardProps {
plan: PricingInformation
isCurrentPlan: boolean
- billingViaPartner: boolean
+ billingPartner: 'fly' | 'aws' | undefined
}
-const EnterpriseCard = ({ plan, isCurrentPlan, billingViaPartner }: EnterpriseCardProps) => {
- const features = billingViaPartner ? plan.featuresPartner : plan.features
+const EnterpriseCard = ({ plan, isCurrentPlan, billingPartner }: EnterpriseCardProps) => {
+ const features = pickFeatures(plan, billingPartner)
return (
<div
diff --git a/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/PlanUpdateSidePanel.tsx b/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/PlanUpdateSidePanel.tsx
index e6bcdf25432..aa32afb4edb 100644
--- a/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/PlanUpdateSidePanel.tsx
+++ b/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/PlanUpdateSidePanel.tsx
@@ -21,7 +21,7 @@ import { useCheckPermissions, useSelectedOrganization } from 'hooks'
import { PRICING_TIER_PRODUCT_IDS } from 'lib/constants'
import { formatCurrency } from 'lib/helpers'
import Telemetry from 'lib/telemetry'
-import { plans as subscriptionsPlans } from 'shared-data/plans'
+import { pickFeatures, pickFooter, plans as subscriptionsPlans } from 'shared-data/plans'
import { useOrgSettingsPageStateSnapshot } from 'state/organization-settings'
import {
Button,
@@ -95,6 +95,7 @@ const PlanUpdateSidePanel = () => {
)
const billingViaPartner = subscription?.billing_via_partner === true
+ const billingPartner = subscription?.billing_partner
const paymentViaInvoice = subscription?.payment_method_type === 'invoice'
const {
@@ -195,7 +196,8 @@ const PlanUpdateSidePanel = () => {
const price = planMeta?.price ?? 0
const isDowngradeOption = planMeta?.change_type === 'downgrade'
const isCurrentPlan = planMeta?.id === subscription?.plan?.id
- const features = billingViaPartner ? plan.featuresPartner : plan.features
+ const features = pickFeatures(plan, billingPartner)
+ const footer = pickFooter(plan, billingPartner)
if (plan.id === 'tier_enterprise') {
return (
@@ -203,7 +205,7 @@ const PlanUpdateSidePanel = () => {
key={plan.id}
plan={plan}
isCurrentPlan={isCurrentPlan}
- billingViaPartner={billingViaPartner}
+ billingPartner={billingPartner}
/>
)
}
@@ -326,11 +328,9 @@ const PlanUpdateSidePanel = () => {
</ul>
</div>
- {(plan.footer || (billingViaPartner && plan.footerPartner)) && (
+ {footer && (
<div className="border-t pt-4 mt-4">
- <p className="text-foreground-light text-xs">
- {billingViaPartner ? plan.footerPartner || plan.footer : plan.footer}
- </p>
+ <p className="text-foreground-light text-xs">{footer}</p>
</div>
)}
</div>
diff --git a/apps/www/components/Pricing/PricingPlans.tsx b/apps/www/components/Pricing/PricingPlans.tsx
index f156ca5f69e..0ccd0795d2f 100644
--- a/apps/www/components/Pricing/PricingPlans.tsx
+++ b/apps/www/components/Pricing/PricingPlans.tsx
@@ -1,12 +1,12 @@
import React, { FC } from 'react'
import Link from 'next/link'
import { useRouter } from 'next/router'
-import { Button, IconCheck, cn } from 'ui'
+import { Button, cn, IconCheck } from 'ui'
import Telemetry, { TelemetryEvent } from '~/lib/telemetry'
import { useTelemetryProps } from 'common/hooks/useTelemetryProps'
import gaEvents from '~/lib/gaEvents'
-import { plans } from 'shared-data/plans'
+import { pickFeatures, pickFooter, plans } from 'shared-data/plans'
const PricingPlans: FC = () => {
const router = useRouter()
@@ -23,6 +23,8 @@ const PricingPlans: FC = () => {
{plans.map((plan) => {
const isPromoPlan = plan.name === 'Pro'
const isTeamPlan = plan.name === 'Team'
+ const features = pickFeatures(plan)
+ const footer = pickFooter(plan)
return (
<div
@@ -140,7 +142,7 @@ const PricingPlans: FC = () => {
<p className="text-foreground-lighter text-[13px] mt-2 mb-4">{plan.preface}</p>
)}
<ul className="text-[13px] flex-1 text-foreground-lighter">
- {plan.features.map((feature) => (
+ {features.map((feature) => (
<li
key={typeof feature === 'string' ? feature : feature[0]}
className="flex flex-col py-2 first:mt-0"
@@ -169,9 +171,9 @@ const PricingPlans: FC = () => {
<div className="flex flex-col gap-6 mt-auto prose">
<div className="space-y-2 mt-12">
- {plan.footer && (
+ {footer && (
<p className="text-[13px] leading-5 text-foreground-lighter whitespace-pre-wrap mb-0">
- {plan.footer}
+ {footer}
</p>
)}
</div>
diff --git a/packages/shared-data/plans.ts b/packages/shared-data/plans.ts
index b3f34090ae7..ba4c9b1c029 100644
--- a/packages/shared-data/plans.ts
+++ b/packages/shared-data/plans.ts
@@ -10,10 +10,8 @@ export interface PricingInformation {
warningTooltip?: string
description: string
preface: string
- features: (string | string[])[]
- featuresPartner: (string | string[])[]
- footer?: string
- footerPartner?: string
+ features: { partners: string[]; features: (string | string[])[] }[]
+ footer?: { partners: string[]; footer: string }[]
cta: string
}
@@ -29,23 +27,38 @@ export const plans: PricingInformation[] = [
description: 'Perfect for passion projects & simple websites.',
preface: 'Get started with:',
features: [
- 'Unlimited API requests',
- '50,000 monthly active users',
- ['500 MB database space', '2 Core shared CPU • 1 GB RAM'],
- '5 GB bandwidth',
- '1 GB file storage',
- 'Community support',
+ {
+ partners: [],
+ features: [
+ 'Unlimited API requests',
+ '50,000 monthly active users',
+ ['500 MB database space', '2 Core shared CPU • 1 GB RAM'],
+ '5 GB bandwidth',
+ '1 GB file storage',
+ 'Community support',
+ ],
+ },
+ {
+ partners: ['fly'],
+ features: [
+ 'Unlimited API requests',
+ '50,000 monthly active users',
+ ['500 MB database space', '2 Core shared CPU • 1 GB RAM'],
+ '5 GB bandwidth',
+ 'Community support',
+ ],
+ },
],
- featuresPartner: [
- 'Unlimited API requests',
- '50,000 monthly active users',
- ['500 MB database space', '2 Core shared CPU • 1 GB RAM'],
- '5 GB bandwidth',
- 'Community support',
+ footer: [
+ {
+ partners: [],
+ footer: 'Free projects are paused after 1 week of inactivity. Limit of 2 active projects.',
+ },
+ {
+ partners: ['fly'],
+ footer: 'Free projects are paused after 1 week of inactivity. Limit of 1 active project.',
+ },
],
- footer: 'Free projects are paused after 1 week of inactivity. Limit of 2 active projects.',
- footerPartner:
- 'Free projects are paused after 1 week of inactivity. Limit of 1 active project.',
cta: 'Start for Free',
},
{
@@ -59,20 +72,28 @@ export const plans: PricingInformation[] = [
priceMonthly: 25,
description: 'For production applications with the option to scale.',
features: [
- ['100,000 monthly active users', 'then $0.00325 per MAU'],
- ['8 GB database space', 'then $0.125 per GB'],
- ['250 GB bandwidth', 'then $0.09 per GB'],
- ['100 GB file storage', 'then $0.021 per GB'],
- 'Email support',
- 'Daily backups stored for 7 days',
- '7-day log retention',
- ],
- featuresPartner: [
- ['8 GB database space', 'then $0.125 per GB'],
- ['250 GB bandwidth', 'then $0.09 per GB'],
- 'Email support',
- 'Daily backups stored for 7 days',
- '7-day log retention',
+ {
+ partners: [],
+ features: [
+ ['100,000 monthly active users', 'then $0.00325 per MAU'],
+ ['8 GB database space', 'then $0.125 per GB'],
+ ['250 GB bandwidth', 'then $0.09 per GB'],
+ ['100 GB file storage', 'then $0.021 per GB'],
+ 'Email support',
+ 'Daily backups stored for 7 days',
+ '7-day log retention',
+ ],
+ },
+ {
+ partners: ['fly'],
+ features: [
+ ['8 GB database space', 'then $0.125 per GB'],
+ ['250 GB bandwidth', 'then $0.09 per GB'],
+ 'Email support',
+ 'Daily backups stored for 7 days',
+ '7-day log retention',
+ ],
+ },
],
preface: 'Everything in the Free plan, plus:',
cta: 'Get Started',
@@ -88,22 +109,18 @@ export const plans: PricingInformation[] = [
priceMonthly: 599,
description: 'Collaborate with different permissions and access patterns.',
features: [
- 'SOC2',
- 'HIPAA available as paid add-on',
- 'Read only and Billing member roles',
- 'SSO for Supabase Dashboard',
- 'Priority email support & SLAs',
- 'Daily backups stored for 14 days',
- '28-day log retention',
- ],
- featuresPartner: [
- 'SOC2',
- 'HIPAA available as paid add-on',
- 'Read only and Billing member roles',
- 'SSO for Supabase Dashboard',
- 'Priority email support & SLAs',
- 'Daily backups stored for 14 days',
- '28-day log retention',
+ {
+ partners: [],
+ features: [
+ 'SOC2',
+ 'HIPAA available as paid add-on',
+ 'Read only and Billing member roles',
+ 'SSO for Supabase Dashboard',
+ 'Priority email support & SLAs',
+ 'Daily backups stored for 14 days',
+ '28-day log retention',
+ ],
+ },
],
preface: 'Everything in the Pro plan, plus:',
cta: 'Get Started',
@@ -114,25 +131,35 @@ export const plans: PricingInformation[] = [
href: 'https://forms.supabase.com/enterprise',
description: 'For large-scale applications managing serious workloads.',
features: [
- 'Designated Support manager',
- 'Uptime SLAs',
- 'On-premise support',
- '24×7×365 premium enterprise support',
- 'Private Slack channel',
- 'Custom Security Questionnaires',
- ],
- featuresPartner: [
- 'Designated Support manager',
- 'Uptime SLAs',
- 'On-premise support',
- '24×7×365 premium enterprise support',
- 'Private Slack channel',
- 'Custom Security Questionnaires',
+ {
+ partners: [],
+ features: [
+ 'Designated Support manager',
+ 'Uptime SLAs',
+ 'On-premise support',
+ '24×7×365 premium enterprise support',
+ 'Private Slack channel',
+ 'Custom Security Questionnaires',
+ ],
+ },
],
priceLabel: '',
priceMonthly: 'Custom',
preface: '',
- footer: '',
cta: 'Contact Us',
},
]
+
+export function pickFeatures(plan: PricingInformation, billingPartner: string = '') {
+ return (
+ plan.features.find((f) => f.partners.includes(billingPartner))?.features ||
+ plan.features.find((f) => f.partners.length === 0)!.features
+ )
+}
+
+export function pickFooter(plan: PricingInformation, billingPartner: string = '') {
+ return (
+ plan.footer?.find((f) => f.partners.includes(billingPartner))?.footer ||
+ plan.footer?.find((f) => f.partners.length === 0)!.footer
+ )
+}