Skip to content

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

feat: add twilio guide

awalias3f8c0b8cae15
diff --git a/web/docs/guides/auth/auth-twilio.mdx b/web/docs/guides/auth/auth-twilio.mdx
new file mode 100644
index 00000000000..d504c34c83e
--- /dev/null
+++ b/web/docs/guides/auth/auth-twilio.mdx
@@ -0,0 +1,69 @@
+---
+id: auth-twilio
+title: SMS OTP with Twilio
+description: How to set up and use Mobile OTP with Twilio and Supabase.
+---
+
+In this guide we'll show you how to authenticate your users with SMS based OTP (One-Time Password) tokens.
+
+There are two reasons to use Supabase SMS OTP tokens:
+- You want users to log in with mobile + password, and the mobile should be verified via SMS
+- You want users to log in with mobile ONLY (i.e. passwordless login)
+
+We'll cover:
+- Finding your Twilio credentials
+- Using OTP with password based logins
+- Using OTP as a passwordless sign-in mechanism
+
+What you'll need:
+- A twilio account (sign up here: https://www.twilio.com/try-twilio)
+- A Supabase project (create one here: https://app.supabase.io)
+- A mobile phone capable of receiving SMS
+
+## Finding your Twilio credentials
+
+Start by logging into your Twilio account and starting a new project: https://www.twilio.com/console/projects/create
+
+Give your project a name and verify the mobile number you'll be using to test with. This is the number that will be receiving the SMS OTPs.
+
+![Name your twilio prject](/img/guides/auth-twilio/1.png)
+![verify your own phone number](/img/guides/auth-twilio/2.png)
+
+Select 'SMS', 'Indentity & Verification', and 'With code' as options on the welcome form.
+
+![Form Fields](/img/guides/auth-twilio/3.png)
+
+When you're back on the https://www.twilio.com/console screen, you need to scroll down and click 'Get a trial phone number' - this is the number that you'll be sending SMSs from.
+
+![Get a trial phone number](/img/guides/auth-twilio/4.png)
+
+![Successful phone number](/img/guides/auth-twilio/5.png)
+
+You should now be able to see all three values you'll need to get started:
+- Account SID
+- Auth Token
+- Sender Phone Number
+
+![All the credentials you'll need](/img/guides/auth-twilio/6.png)
+
+Now go to the Auth > Settings page in the Supabase dashboard (https://app.supabase.io/project/YOUR-PROJECT-REF/auth/settings).
+
+You should see an option to enable Phone Signup.
+
+![Enable Phone Sign-Up](/img/guides/auth-twilio/7.png)
+
+Toggle it on, and copy the 3 values over from the twilio dashboard. Click save.
+
+Note: for "Twilio Message Service SID" you can use the Sender Phone Number generate above.
+
+![Plug in Twilio credentials](/img/guides/auth-twilio/8.png)
+
+Now the backend should be setup, we can proceed to adding our clientside code!
+
+
+## Using OTP with password based logins
+
+In this use case we'll be using the user's mobile phone number as an alternative to an email address. You may want to think hard about the permanency of this however. It is not uncommon for mobile phone numbers
+
+## Using OTP as a passwordless sign-in mechanism
+
diff --git a/web/sidebar_spec_postgres.js b/web/sidebar_spec_postgres.js
index d45dcbdcd95..a33d3af5072 100644
--- a/web/sidebar_spec_postgres.js
+++ b/web/sidebar_spec_postgres.js
@@ -23,6 +23,6 @@ module.exports = {
label: 'Database Configuration',
items: ['reference/postgres/database-passwords', 'reference/postgres/changing-timezones'],
collapsed: true,
- },
+ }
],
}
\ No newline at end of file