Skip to content

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

feat: add SSO MAU usage

Kevin Grünebergc2dfb3aea728
diff --git a/studio/components/interfaces/Billing/Billing.constants.tsx b/studio/components/interfaces/Billing/Billing.constants.tsx
index 8cdefa548df..e25304cc61a 100644
--- a/studio/components/interfaces/Billing/Billing.constants.tsx
+++ b/studio/components/interfaces/Billing/Billing.constants.tsx
@@ -73,6 +73,19 @@ export const USAGE_BASED_PRODUCTS = [
</span>
),
},
+ {
+ key: 'monthly_active_sso_users',
+ attribute: 'total_auth_billing_period_sso_mau',
+ title: 'Monthly Single Sign-On Users',
+ units: 'absolute',
+ costPerUnit: 0.015,
+ tooltip: (
+ <span>
+ The amount of distinct Single Sign-On users requesting your API throughout the billing period. Resets
+ at the beginning of every billing period.
+ </span>
+ ),
+ },
],
},
{
diff --git a/studio/components/interfaces/Billing/SpendCapModal.tsx b/studio/components/interfaces/Billing/SpendCapModal.tsx
index cff279aba51..f5c8091a8ad 100644
--- a/studio/components/interfaces/Billing/SpendCapModal.tsx
+++ b/studio/components/interfaces/Billing/SpendCapModal.tsx
@@ -79,6 +79,42 @@ const SpendCapModal: FC<Props> = ({ visible, onHide }) => {
<p className="w-[25%] text-sm">$0.00325/user</p>
</div>
</div>
+ <div className="py-2">
+ <div className="flex items-center px-4 py-1">
+ <div className="flex w-[50%] items-center space-x-2">
+ <p className="text-sm">Single Sign-On (SAML 2.0) MAUs</p>
+ <Tooltip.Root delayDuration={0}>
+ <Tooltip.Trigger>
+ <IconHelpCircle
+ size={16}
+ strokeWidth={1.5}
+ className="transition opacity-50 cursor-pointer hover:opacity-100"
+ />
+ </Tooltip.Trigger>
+ <Tooltip.Portal>
+ <Tooltip.Portal>
+ <Tooltip.Content side="bottom">
+ <Tooltip.Arrow className="radix-tooltip-arrow" />
+ <div
+ className={[
+ 'rounded bg-scale-100 py-1 px-2 leading-none shadow', // background
+ 'border border-scale-200 ', //border
+ ].join(' ')}
+ >
+ <span className="text-xs text-scale-1200">
+ Single Sign-On Monthly Active Users: A user that has made an API
+ request in the last month
+ </span>
+ </div>
+ </Tooltip.Content>
+ </Tooltip.Portal>
+ </Tooltip.Portal>
+ </Tooltip.Root>
+ </div>
+ <p className="w-[25%] text-sm">50</p>
+ <p className="w-[25%] text-sm">$0.015/user</p>
+ </div>
+ </div>
<div className="py-2">
<div className="flex items-center px-4 py-1">
<p className="w-[50%] text-sm">Storage size</p>
diff --git a/studio/lib/constants/metrics.tsx b/studio/lib/constants/metrics.tsx
index 3c1044e536c..39ee4a62c4c 100644
--- a/studio/lib/constants/metrics.tsx
+++ b/studio/lib/constants/metrics.tsx
@@ -151,6 +151,12 @@ export const METRICS = [
provider: 'daily-stats',
category: METRIC_CATEGORIES.API_AUTH,
},
+ {
+ key: 'total_auth_billing_period_sso_mau',
+ label: 'Auth Monthly Active SSO User',
+ provider: 'daily-stats',
+ category: METRIC_CATEGORIES.API_AUTH,
+ },
{
key: 'total_auth_ingress',
label: 'Auth Ingress',