🔑 Google Authentication
Set up Google Sign-In for your ExpoBase app.
Step 1: Get Google Client ID
-
Go to Google Cloud Console:
- Visit Google Cloud Console
- Select your project or create a new one
-
Enable Google Sign-In API:
- Go to APIs & Services → Library
- Search for "Google Sign-In API"
- Click Enable
-
Create OAuth 2.0 Client (Web):
- Go to APIs & Services → Credentials
- Click Create Credentials → OAuth 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
-
Create OAuth 2.0 Client (iOS):
- Click Create Credentials → OAuth 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
-
Go to Supabase Dashboard:
- Go to your Supabase Dashboard
- Select your project
-
Enable Google Provider:
- Go to Authentication → Providers
- 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
- 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 logicapp/(auth)
folder - Google login buttons
🎯 Next Step
Continue to 🏗️ Prepare Build to run the setup script.
Step 10/11 Complete ✅
Google authentication configured!