The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
docs: add RN videos and discoverability improvements. (#18633)
Thor 雷神 Schaeffee18b5ac1f0a
diff --git a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.tsindex ad5064ed70f..6b625f1ad11 100644--- a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts+++ b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts@@ -513,9 +513,15 @@ export const auth = {items: [...PhoneLoginsItems],},{- name: 'Social Login',+ name: 'Social Login (OAuth)',url: '/guides/auth/social-login',- items: [...SocialLoginItems],+ items: [+ {+ name: 'Native Mobile OAuth',+ url: '/guides/auth/native-mobile-deep-linking',+ },+ ...SocialLoginItems,+ ],},{name: 'Native Mobile Login',@@ -523,7 +529,7 @@ export const auth = {items: [...NativeMobileLoginItems,{- name: 'Deep Linking',+ name: 'OAuth Deep Linking',url: '/guides/auth/native-mobile-deep-linking',},],diff --git a/apps/docs/pages/guides/auth/native-mobile-deep-linking.mdx b/apps/docs/pages/guides/auth/native-mobile-deep-linking.mdxindex a4aab18bd58..c3ba884e73c 100644--- a/apps/docs/pages/guides/auth/native-mobile-deep-linking.mdx+++ b/apps/docs/pages/guides/auth/native-mobile-deep-linking.mdx@@ -6,6 +6,7 @@ import { NativeMobileLoginItems } from '~/components/Navigation/NavigationMenu/Nexport const meta = {title: 'Native Mobile Deep Linking',description: 'Learn how to handle deep linking for OAuth and email based login.',+ tocVideo: '8TZ6O1C8ujE',}In certain auth scenarios you will need to handle linking back into your application to finish the user's sign in.diff --git a/apps/docs/pages/guides/auth/passwordless-login/auth-magic-link.mdx b/apps/docs/pages/guides/auth/passwordless-login/auth-magic-link.mdxindex 4e0e228dee1..1078bc1de2b 100644--- a/apps/docs/pages/guides/auth/passwordless-login/auth-magic-link.mdx+++ b/apps/docs/pages/guides/auth/passwordless-login/auth-magic-link.mdx@@ -46,10 +46,31 @@ async function signInWithEmail() {}```+</TabPanel>+<TabPanel id="react-native" label="Expo React Native">+Follow the [Expo Quickstart Guide](/docs/guides/getting-started/tutorials/with-expo-react-native#initialize-a-react-native-app) to initialize `supabase-js` with React Native.++To start the sign in process call [signInWithOtp()](/docs/reference/javascript/auth-signinwithotp) with their email address:++```ts+import { makeRedirectUri } from 'expo-auth-session'++const redirectTo = makeRedirectUri()++const { error } = await supabase.auth.signInWithOtp({+ email: '[email protected]',+ options: {+ emailRedirectTo: redirectTo,+ },+})+```++Read the [Deep Linking Documentation](/docs/guides/auth/native-mobile-deep-linking) to learn how to handle deep linking.+</TabPanel><TabPanel id="dart" label="Dart">-When your user signs in, call [signIn()](/docs/reference/dart/auth-signinwithotp) with their email address:+To start the sign in process call [signIn()](/docs/reference/dart/auth-signinwithotp) with their email address:```dartFuture<void> signInWithEmail() async {@@ -60,7 +81,7 @@ Future<void> signInWithEmail() async {</TabPanel><TabPanel id="kotlin" label="Kotlin">-When your user signs in, call [sendOtpTo()](/docs/reference/kotlin/auth-signinwithotp) with their email address:+To start the sign in process call [sendOtpTo()](/docs/reference/kotlin/auth-signinwithotp) with their email address:```kotlinsuspend fun loginWithEmail() {diff --git a/apps/docs/pages/guides/auth/social-login/auth-apple.mdx b/apps/docs/pages/guides/auth/social-login/auth-apple.mdxindex ee38d819df4..103c7b0cab4 100644--- a/apps/docs/pages/guides/auth/social-login/auth-apple.mdx+++ b/apps/docs/pages/guides/auth/social-login/auth-apple.mdx@@ -5,6 +5,7 @@ export const meta = {id: 'auth-apple',title: 'Login with Apple',description: 'Use Sign in with Apple with Supabase',+ tocVideo: '-tpcZzTdvN0',}Supabase Auth supports using [Sign in with Apple](https://developer.apple.com/sign-in-with-apple/) on the web and in native apps for iOS, macOS, watchOS or tvOS.diff --git a/apps/docs/pages/guides/auth/social-login/auth-google.mdx b/apps/docs/pages/guides/auth/social-login/auth-google.mdxindex 404baeea85f..095de776f87 100644--- a/apps/docs/pages/guides/auth/social-login/auth-google.mdx+++ b/apps/docs/pages/guides/auth/social-login/auth-google.mdx@@ -4,6 +4,7 @@ export const meta = {id: 'auth-google',title: 'Login with Google',description: 'Use Sign in with Google on the web, in native apps or with Chrome extensions',+ tocVideo: 'vojHmGUGUGc',}Supabase Auth supports Sign in with Google on the web, native Android applications and Chrome extensions.diff --git a/apps/docs/pages/guides/functions/examples/send-emails.mdx b/apps/docs/pages/guides/functions/examples/send-emails.mdxindex a54187849b8..4b721f5e528 100644--- a/apps/docs/pages/guides/functions/examples/send-emails.mdx+++ b/apps/docs/pages/guides/functions/examples/send-emails.mdx@@ -3,6 +3,7 @@ import Layout from '~/layouts/DefaultGuideLayout'export const meta = {title: 'Sending Emails',description: 'Sending emails from Edge Functions using the Resend API.',+ tocVideo: 'Qf7XvL1fjvo',}Sending emails from Edge Functions using the [Resend API](https://resend.com/).diff --git a/apps/docs/pages/guides/getting-started/tutorials/with-expo-react-native.mdx b/apps/docs/pages/guides/getting-started/tutorials/with-expo-react-native.mdxindex 604144f04d3..859147ec7d7 100644--- a/apps/docs/pages/guides/getting-started/tutorials/with-expo-react-native.mdx+++ b/apps/docs/pages/guides/getting-started/tutorials/with-expo-react-native.mdx@@ -3,6 +3,7 @@ import Layout from '~/layouts/DefaultGuideLayout'export const meta = {title: 'Build a User Management App with Expo React Native',description: 'Learn how to use Supabase in your React Native App.',+ tocVideo: 'AE7dKIKMJy4',}<QuickstartIntro />@@ -40,8 +41,8 @@ npx expo install @supabase/supabase-js @react-native-async-storage/async-storageNow let's create a helper file to initialize the Supabase client.We need the API URL and the `anon` key that you copied [earlier](#get-the-api-keys).-These variables will be exposed on the browser, and that's completely fine since we have-[Row Level Security](/docs/guides/auth#row-level-security) enabled on our Database.+These variables are safe to expose in your Expo app since Supabase has+[Row Level Security](/docs/guides/auth#row-level-security) enabled on your Database.<Tabsscrollablediff --git a/apps/www/_blog/2023-06-27-native-mobile-auth.mdx b/apps/www/_blog/2023-06-27-native-mobile-auth.mdxindex 177bd713110..e67564d1bc4 100644--- a/apps/www/_blog/2023-06-27-native-mobile-auth.mdx+++ b/apps/www/_blog/2023-06-27-native-mobile-auth.mdx@@ -22,93 +22,8 @@ In full transparency, this was always sort-of possible but there were some edgeBehind the scenes, these native sign in methods use ID tokens. They’re a formalized version of a JWT that is issued by Apple or Google and contain profile information. Supabase Auth now can properly validate the ID tokens and create new or link to existing user accounts based on email similarity.-### Using Sign in with Google in a Flutter App--To setup Sign in with Google in your Flutter native app, you need to set up your Google Cloud project for each platform:--- For iOS apps: [Get started with Google Sign In for iOS and macOS](https://developers.google.com/identity/sign-in/ios/start-integrating#get_an_oauth_client_id)-- For Android apps: [Get started with One Tap sign-in and sign-up for Android](https://developers.google.com/identity/one-tap/android/get-started)--We’ve revamped the Google provider [configuration screen in the Supabase Dashboard](https://supabase.com/dashboard/project/_/auth/providers). Besides the existing OAuth flow, you can now add additional _Authorized Client IDs_ meant for native sign in.--The client ID you obtained from the setup instructions above should be added to _Authorized Client IDs._----It really is as simple as that.--### Using Sign in with Apple in a Flutter App--We introduced support for native Sign in with Apple in our [previous launch week](https://supabase.com/blog/supabase-auth-sso-pkce#native-apple-login-on-ios#native-apple-login-on-ios), but today we are adding support for multiple apps on a single Supabase project.--All you need to do is to register all of the bundle IDs of your apps in the [Supabase Dashboard](https://supabase.com/dashboard/project/_/auth/providers) under _Authorized Client IDs_ as a comma separated string.----## Using Sign in with Apple and Google in React Native Apps--If you use React Native to build your native apps, you can still benefit. Please check out these resources to see how you can show the native authentication dialog and obtain an ID token from the operating system:--- https://github.com/invertase/react-native-apple-authentication-- [Expo AppleAuthentication](https://docs.expo.dev/versions/latest/sdk/apple-authentication/)-- https://github.com/react-native-google-signin/google-signin--You would still need to configure the _Authorized Client IDs_ as shown in the Flutter examples above.--Finally, once you’ve received a valid ID token from the operating system you can call `supabase.auth.signInWithIdToken()` to complete the sign in with your Supabase project.--For Sign in with Apple:--```tsx-await supabase.auth.signInWithIdToken({- provider: 'apple',- token: '<id token>',-})-```--For Sign in with Google:--```tsx-await supabase.auth.signInWithIdToken({- provider: 'google',- token: '<id token>',-})-```--We also have some sample implementation for Expo apps in our [create-t3-turbo example](https://github.com/supabase-community/create-t3-turbo/blob/main/apps/expo/src/app/profile.tsx#L47).--## Using Sign in with Apple and Google in Flutter Apps--Once you have configured your Supabase instance, you can utilize third party libraries like **[sign_in_with_apple](https://pub.dev/packages/sign_in_with_apple) or [google_one_tap_sign_in](https://pub.dev/packages/google_one_tap_sign_in) to perform naive sign in, and pass the ID token to Supabase to complete the sign in.**--For Sign in with Apple:--```dart-final credential = await SignInWithApple.getAppleIDCredential(- scopes: [- AppleIDAuthorizationScopes.email,- AppleIDAuthorizationScopes.fullName,- ],-);--await supabase.auth.signInWithIdToken(- provider: Provider.apple,- idToken: credential.identityToken!,-);-```--And for Google:--```dart-var result = await GoogleOneTapSignIn.handleSignIn(webClientId: '<client ID>');--supabase.auth.signInWithIdToken(- provider: Provider.google,- idToken: result.data!.idToken!,-);-```--You can find more detailed instructions on the [here](https://github.com/supabase/supabase-flutter#authentication).+- Sign in with Apple [[Web](/docs/guides/auth/social-login/auth-apple?platform=web) | [React Native](/docs/guides/auth/social-login/auth-apple?platform=react-native) | [Flutter](/docs/guides/auth/social-login/auth-apple?platform=flutter) | [Swift](/docs/guides/auth/social-login/auth-apple?platform=swift) | [Kotlin](/docs/guides/auth/social-login/auth-apple?platform=kotlin)]+- Sign in with Google [[Web](/docs/guides/auth/social-login/auth-google?platform=web) | [React Native](/docs/guides/auth/social-login/auth-google?platform=react-native) | [Flutter](/docs/guides/auth/social-login/auth-google?platform=flutter) | [Android](/docs/guides/auth/social-login/auth-google?platform=android) | [Chrome Extensions](/docs/guides/auth/social-login/auth-google?platform=chrome-extensions)]## Sign in with Apple JS, Google One Tap and Chrome Extensions