Skip to content

🔑 Google Authentication

Set up Google Sign-In for your ExpoBase app.

Step 1: Get Google Client ID

  1. Go to Google Cloud Console:
  2. Enable Google Sign-In API:
    • Go to APIs & ServicesLibrary
    • Search for "Google Sign-In API"
    • Click Enable
  3. Create OAuth 2.0 Client (Web):
    • Go to APIs & ServicesCredentials
    • Click Create CredentialsOAuth 2.0 Client ID
    • Select Web application as application type
    • Enter your app name
    • Add Authorized redirect URIs: https://your-project.supabase.co/auth/v1/callback
    • Click Create
    • Copy the Client ID and Client Secret
  4. Create OAuth 2.0 Client (iOS):
    • Click Create CredentialsOAuth 2.0 Client ID again
    • Select iOS as application type
    • Enter your app name
    • Enter your bundle identifier: com.yourcompany.yourapp
    • Click Create
    • Copy the iOS Client ID (looks like: 692909867915-8g06vk3jlvf3tv395irdj1vmjmhquu66.apps.googleusercontent.com)

Step 2: Configure Supabase

  1. Go to Supabase Dashboard:
  2. Enable Google Provider:
    • Go to AuthenticationProviders
    • Find Google and click Enable
    • Add your Client ID: YOUR_WEB_CLIENT_ID_HERE.apps.googleusercontent.com (from Web OAuth client)
    • Add your Client Secret: YOUR_CLIENT_SECRET_HERE (from Web OAuth client)
    • Click Save
    • Important: Also add the Web Client ID to your supabase/functions/.env file as:
    SUBASE_AUTH_GOOGLE_ID=YOUR_WEB_CLIENT_ID_HERE.apps.googleusercontent.com
    

Step 3: Add to Your App

Add to app.json:

export default {
  expo: {
    plugins: [
      // ... other plugins
      [
        "@react-native-google-signin/google-signin",
        {
          "iosUrlScheme": "com.googleusercontent.apps.YOUR_IOS_CLIENT_ID_HERE"
        }
      ]
    ],
  },
};

Add to your .env.local file:

EXPO_PUBLIC_GOOGLE_CLIENT_ID=YOUR_IOS_CLIENT_ID_HERE.apps.googleusercontent.com
Important:
  • Supabase uses the Web Client ID and Secret
  • App configuration uses the iOS Client ID

Ready to Use

Google authentication is already implemented! Users can:

  • ✅ Sign in with Google account
  • ✅ Auto-create account on first login
  • ✅ Link existing accounts

Check the implementation in:

  • AuthContext - Google Sign-In logic
  • app/(auth) folder - Google login buttons

🎯 Next Step

Continue to 🏗️ Prepare Build to run the setup script.


Step 10/11 Complete

Google authentication configured!