diff --git a/src/components/cost-calculator/CostCalculator.astro b/src/components/cost-calculator/CostCalculator.astro new file mode 100644 index 0000000..a8a36da --- /dev/null +++ b/src/components/cost-calculator/CostCalculator.astro @@ -0,0 +1,278 @@ +--- +// The static tables are the no-JavaScript version of the calculator, so they print every +// published price in pricing.ts and nothing the script could not also show. +import { + type Auth0Plan, + auth0MauSteps, + auth0Plans, + okta, + selfHost, + selfHostMonthlyUsd, + sources, + usd, +} from './pricing' + +const plansFor = (useCase: 'b2c' | 'b2b') => auth0Plans.filter((plan) => plan.useCase === useCase) + +type Cell = { text: string; salesUrl?: string } + +const cell = (plan: Auth0Plan, mau: number): Cell => { + const tier = plan.tiers.find((t) => mau <= t.upToMau) + if (tier) return { text: usd(tier.monthlyUsd) } + if (plan.aboveTiers === 'unavailable') return { text: 'Not on plan' } + return { text: 'Contact sales', salesUrl: sources.auth0Sales.url } +} + +const steps = [ + ...auth0MauSteps.map((mau) => ({ label: mau.toLocaleString('en-US'), mau })), + { label: 'Above 30,000', mau: Number.POSITIVE_INFINITY }, +] + +const selfHostSummary = `${usd(selfHostMonthlyUsd)} per month at any MAU (${selfHost.provider} ${usd( + selfHost.app.monthlyUsd, +)} Droplet plus ${usd(selfHost.database.monthlyUsd)} managed PostgreSQL, checked ${ + selfHost.app.source.checked +})` +--- + +
+ Auth0 list prices per month, monthly billing, from auth0.com/pricing (checked {sources.auth0.checked}). A MAU count between two steps uses the next step up. +
+ { + (['b2c', 'b2b'] as const).map((useCase) => ( +| MAU up to | + {plansFor(useCase).map((plan) => ( +{plan.name} | + ))} +Enterprise | +
|---|---|---|
| {label} | + {plansFor(useCase).map((plan) => { + const { text, salesUrl } = cell(plan, mau) + return{salesUrl ? {text} : text} | + })} ++ Contact sales + | +
+ Okta Customer Identity, from okta.com/pricing (checked { + sources.okta.checked + }): the Enterprise base platform starts at {usd(okta.basePlatformFromUsd)} per month, { + okta.billing + }, with usage-priced add-ons quoted by sales. The B2C Suite and B2B Suite are contact sales. +
+Seamless Auth self-hosted: {selfHostSummary}.
+