Skip to content

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

fix: update docs

[email protected]1548a40dd46a
diff --git a/apps/docs/pages/guides/auth/phone-login/twilio.mdx b/apps/docs/pages/guides/auth/phone-login/twilio.mdx
index 3cb789e1793..00459f99ca8 100644
--- a/apps/docs/pages/guides/auth/phone-login/twilio.mdx
+++ b/apps/docs/pages/guides/auth/phone-login/twilio.mdx
@@ -300,42 +300,50 @@ The user does not have a password therefore will need to sign in via this method
In some cases, you may wish to use WhatsApp as a delivery channel instead. Here are some examples our users have cited:
- You want higher deliverability
-- You wish for a secure channel with end to end encryption
+- You wish for a secure channel
- Your users mostly use WhatsApp as a messaging platform
-To make use of WhatsApp OTP, please completed the following steps:
+To make use of WhatsApp OTP, please complete the following steps:
-- Upgrade Twilio account to a paid account
-- Please go through the [Twilio self sign up guide for WhatsApp](https://www.twilio.com/docs/whatsapp/self-sign-up)
-- Submit a template via the [Twilio Guide For Submitting WhatsApp templates](https://www.twilio.com/docs/whatsapp/tutorial/send-whatsapp-notification-messages-templates#creating-message-templates-and-submitting-them-for-approval).
+- Go through the [Twilio self sign up guide for WhatsApp](https://www.twilio.com/docs/whatsapp/self-sign-up)
+- Submit a template via the [Twilio Guide For Submitting WhatsApp templates](https://www.twilio.com/docs/whatsapp/tutorial/send-whatsapp-notification-messages-templates#creating-message-templates-and-submitting-them-for-approval)
+
+<Admonition type="caution">
+The message template submitted to Twilio must exactly match the SMS Body entered on the Supabase dashboard.
+</Admonition>
+
+The sign up and sign in process with WhatsApp is similar to the process for SMS. The key difference
+is that there is a `whatsapp` channel parameter under `options`:
```js
-let { user, error } = await supabase.auth.signInWithOtp({
- phone: '+13334445555',
- channel: 'whatsapp',
-})
+const {data, error }= await supabase.auth.signInWithOtp({
+ phone: '+57336567365',
+ options: {
+ channel:'whatsapp'
+ }
+ })
```
```js
-// After receiving a SMS with a OTP.
-const { data, error } = await supabase.auth.signInWithPassword({
- phone: '+13334445555',
- channel: 'whatsapp'
- password: 'testsupabasenow',
+const {data, error }= await supabase.auth.signUp({
+ phone: '+57336567365',
+ password: 'testsupabasenow',
+ options: {
+ channel:'whatsapp',
+ }
})
```
-<Caution>
-
-The message template submitted to Twilio must exactly match the message you enter on the Supabase dashboard.
-
-</Caution>
-
-Pre-requisites:
-- Please go through the Setting up a Whatsapp Verified Sender guide by Twilio
-- Please [submit WhatsApp message templates to Twilio for verification](https://www.twilio.com/docs/whatsapp/tutorial/send-whatsapp-notification-messages-templates#creating-message-templates-and-submitting-them-for-approval)
-We also support WhatsApp Logins
+There is no change in the verification process - do continue the `sms` type for verification
+```js
+// After receiving a WhatsApp OTP
+let { data, error } = await supabase.auth.verifyOtp({
+ phone: '+57336567365',
+ token: '123456',
+ type: 'sms',
+})
+```
## Resources
diff --git a/spec/supabase_js_v2.yml b/spec/supabase_js_v2.yml
index 99969942e9d..c68258c40e1 100644
--- a/spec/supabase_js_v2.yml
+++ b/spec/supabase_js_v2.yml
@@ -234,6 +234,7 @@ functions:
- The magic link's destination URL is determined by the [`SITE_URL`](/docs/reference/auth/config#site_url).
- See [redirect URLs and wildcards](/docs/guides/auth#redirect-urls-and-wildcards) to add additional redirect URLs to your project.
- Magic links and OTPs share the same implementation. To send users a one-time code instead of a magic link, [modify the magic link email template](https://app.supabase.com/project/_/auth/templates) to include `{{ .Token }}` instead of `{{ .ConfirmationURL }}`.
+ - See our [Twilio Phone Auth Guide](/docs/guides/auth/phone-login/twilio) for details about configuring WhatsApp sign in.
examples:
- id: sign-in-with-email
name: Sign in with email
@@ -261,13 +262,14 @@ functions:
- id: sign-in-with-whatsapp-otp
name: Sign in with WhatsApp OTP
isSpotlight: false
- description: The user will be sent a WhatsApp message which contains a OTP. By default, a given user can only request a OTP once every 60 seconds. Note that a user
- will need to have a Twilio linked WhatsApp account in order to use this feature.
+ description: The user will be sent a WhatsApp message which contains a OTP. By default, a given user can only request a OTP once every 60 seconds. Note that a user will need to have a valid WhatsApp account that is linked to Twilio in order to use this feature.
code: |
```js
const { data, error } = await supabase.auth.signInWithOtp({
phone: '+13334445555',
- channel: 'whatsapp'
+ options: {
+ channel:'whatsapp',
+ }
})
```
- id: sign-in-with-oauth