Skip to content

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

chore: Repurpose CostWarning component as partial only (#46996)

Jeremias Menichelli90b15736aa25
diff --git a/apps/docs/components/AuthSmsProviderConfig/AuthSmsProviderConfig.Warnings.tsx b/apps/docs/components/AuthSmsProviderConfig/AuthSmsProviderConfig.Warnings.tsx
deleted file mode 100644
index d1bb35b32f5..00000000000
--- a/apps/docs/components/AuthSmsProviderConfig/AuthSmsProviderConfig.Warnings.tsx
+++ /dev/null
@@ -1,27 +0,0 @@
-import Link from 'next/link'
-import { Admonition } from 'ui-patterns/admonition'
-
-const CostWarning = () => (
- <Admonition type="warning">
- <p>
- To keep SMS sending costs under control, make sure you adjust your project&apos;s rate limits
- and{' '}
- <Link href="/guides/auth/auth-captcha">
- <u>configure CAPTCHA</u>
- </Link>
- . See the{' '}
- <Link href="/guides/platform/going-into-prod">
- <u>Production Checklist</u>
- </Link>{' '}
- to learn more.
- </p>
- <br />
- <p>
- Some countries have special regulations for services that send SMS messages to users, (e.g
- India&apos;s TRAI DLT regulations). Remember to look up and follow the regulations of
- countries where you operate.
- </p>
- </Admonition>
-)
-
-export { CostWarning }
diff --git a/apps/docs/components/AuthSmsProviderConfig/MessageBirdConfig.mdx b/apps/docs/components/AuthSmsProviderConfig/MessageBirdConfig.mdx
index eab1e5a6517..248e71f417d 100644
--- a/apps/docs/components/AuthSmsProviderConfig/MessageBirdConfig.mdx
+++ b/apps/docs/components/AuthSmsProviderConfig/MessageBirdConfig.mdx
@@ -1,5 +1,4 @@
import { Admonition } from 'ui-patterns/admonition'
-import { CostWarning } from './AuthSmsProviderConfig.Warnings'
<Admonition type="warning">
@@ -15,8 +14,6 @@ You'll need:
- A Supabase project (create one [here](https://supabase.com/dashboard))
- A mobile phone capable of receiving SMS
-<CostWarning />
-
## Set up MessageBird as your SMS provider
Start by logging into your MessageBird account and verify the mobile number you'll be using to test with [here](https://dashboard.messagebird.com/en/getting-started/sms). This is the number that will be receiving the SMS OTPs.
diff --git a/apps/docs/components/AuthSmsProviderConfig/TextLocalConfig.mdx b/apps/docs/components/AuthSmsProviderConfig/TextLocalConfig.mdx
index 58a6d7a4a53..e37f7396a82 100644
--- a/apps/docs/components/AuthSmsProviderConfig/TextLocalConfig.mdx
+++ b/apps/docs/components/AuthSmsProviderConfig/TextLocalConfig.mdx
@@ -1,5 +1,4 @@
import { Admonition } from 'ui-patterns/admonition'
-import { CostWarning } from './AuthSmsProviderConfig.Warnings'
## Prerequisites
@@ -9,8 +8,6 @@ Before you begin, ensure you have the following:
- **A Supabase project**: Necessary for SMS authentication integration. Create your project in the [Supabase Dashboard](https://supabase.com/dashboard).
- **A mobile phone**: To receive SMS messages and test your setup.
-<CostWarning />
-
## Setting up Textlocal as your SMS provider
To integrate Textlocal with Supabase:
diff --git a/apps/docs/components/AuthSmsProviderConfig/TwilioConfig.mdx b/apps/docs/components/AuthSmsProviderConfig/TwilioConfig.mdx
index 6442246ef7c..371b9fd0475 100644
--- a/apps/docs/components/AuthSmsProviderConfig/TwilioConfig.mdx
+++ b/apps/docs/components/AuthSmsProviderConfig/TwilioConfig.mdx
@@ -1,5 +1,4 @@
import { Admonition } from 'ui-patterns/admonition'
-import { CostWarning } from './AuthSmsProviderConfig.Warnings'
## Prerequisites
@@ -11,8 +10,6 @@ You'll need:
SMS Authentication can be done with either Twilio Verify or Twilio Programmable Messaging. [Twilio Verify](https://www.twilio.com/en-us/trusted-activation/verify) is a specialized OTP solution and is recommended for most developers that need over-the-phone authentication. Alternatively you can use [Twilio Programmable Messaging](https://www.twilio.com/docs/messaging) which offers generic SMS sending support.
-<CostWarning />
-
## Twilio Verify
To set up Twilio Verify, you will need to:
diff --git a/apps/docs/components/AuthSmsProviderConfig/VonageConfig.mdx b/apps/docs/components/AuthSmsProviderConfig/VonageConfig.mdx
index 25be98c1f8a..78f1dfdd534 100644
--- a/apps/docs/components/AuthSmsProviderConfig/VonageConfig.mdx
+++ b/apps/docs/components/AuthSmsProviderConfig/VonageConfig.mdx
@@ -1,5 +1,4 @@
import { Admonition } from 'ui-patterns/admonition'
-import { CostWarning } from './AuthSmsProviderConfig.Warnings'
## Prerequisites
@@ -9,8 +8,6 @@ You'll need:
- A Supabase project (create one here: https://supabase.com/dashboard)
- A mobile phone capable of receiving SMS
-<CostWarning />
-
## Set up Vonage as an SMS provider
### Getting your Vonage credentials
diff --git a/apps/docs/content/_partials/cost_warning.mdx b/apps/docs/content/_partials/cost_warning.mdx
new file mode 100644
index 00000000000..6f8c536f5bb
--- /dev/null
+++ b/apps/docs/content/_partials/cost_warning.mdx
@@ -0,0 +1,7 @@
+<Admonition type="caution">
+
+To keep SMS sending costs under control, make sure you adjust your project's rate limits and [configure CAPTCHA](/docs/guides/auth/auth-captcha). See the [Production Checklist](/docs/guides/platform/going-into-prod) to learn more.
+
+Some countries have special regulations for services that send SMS messages to users, (e.g India's TRAI DLT regulations). Remember to look up and follow the regulations of countries where you operate.
+
+</Admonition>
diff --git a/apps/docs/content/guides/auth/passwords.mdx b/apps/docs/content/guides/auth/passwords.mdx
index 4ad2eb6aafb..4548d785ba8 100644
--- a/apps/docs/content/guides/auth/passwords.mdx
+++ b/apps/docs/content/guides/auth/passwords.mdx
@@ -1111,6 +1111,8 @@ If you want users to confirm their phone number on signup, you need to set up an
<AuthSmsProviderConfig />
+<$Partial path="cost_warning.mdx" />
+
### Signing up with a phone number and password
To sign up the user, call [`signUp()`](/docs/reference/javascript/auth-signup) with their phone number and password:
diff --git a/apps/docs/content/guides/auth/phone-login.mdx b/apps/docs/content/guides/auth/phone-login.mdx
index 8d3399d9c91..7f5615ff944 100644
--- a/apps/docs/content/guides/auth/phone-login.mdx
+++ b/apps/docs/content/guides/auth/phone-login.mdx
@@ -19,7 +19,7 @@ Phone OTP login can:
- Increase security by reducing the risk of password-related security breaches
- Reduce support burden of dealing with password resets and other password-related flows
-<CostWarning />
+<$Partial path="cost_warning.mdx" />
## Enabling phone login
diff --git a/apps/docs/features/docs/MdxBase.shared.tsx b/apps/docs/features/docs/MdxBase.shared.tsx
index 591a8bf20cb..b47ebf114e8 100644
--- a/apps/docs/features/docs/MdxBase.shared.tsx
+++ b/apps/docs/features/docs/MdxBase.shared.tsx
@@ -3,7 +3,6 @@ import { AiSkillsIndex } from '~/app/guides/getting-started/ai-skills/AiSkillsIn
import { AppleSecretGenerator } from '~/components/AppleSecretGenerator'
import AuthProviders from '~/components/AuthProviders'
import { AuthSmsProviderConfig } from '~/components/AuthSmsProviderConfig'
-import { CostWarning } from '~/components/AuthSmsProviderConfig/AuthSmsProviderConfig.Warnings'
import ButtonCard from '~/components/ButtonCard'
import { ComputeDiskLimitsTable } from '~/components/ComputeDiskLimitsTable'
import { Extensions } from '~/components/Extensions'
@@ -75,7 +74,6 @@ const components = {
CodeSampleDummy,
CodeSampleWrapper,
ComputeDiskLimitsTable,
- CostWarning,
ErrorCodes,
Extensions,
GlassPanel,