Apple & Google Login with Supabase
This guide walks you through adding Sign in with Apple and Sign in with Google to a Newly app that uses Supabase as its backend. Unlike email/password, social login needs a one-time setup in the provider consoles (Google Cloud, Apple Developer) and in your Supabase Dashboard. Newly can’t do this part for you because it involves your own developer accounts and secrets. Once configured, you tell the AI to build the buttons and wire up the flow.How social login works on native
On a phone, social login isn’t a website popup — it uses the operating system’s native account picker. The flow is:- The user taps Continue with Apple / Continue with Google.
- The OS shows its native sign-in sheet and returns a signed ID token.
- Your app passes that token to Supabase with
signInWithIdToken. - Supabase verifies the token, creates or finds the user, and returns a session.
Prerequisites
Supabase project connected
Apple Developer Account
Google Cloud Account
Your app's Bundle ID
com.yourcompany.yourapp — you’ll need it in both consolesSign in with Google
Step 1: Create OAuth client IDs in Google Cloud
Google needs a separate client ID per platform.Create a project
Configure the consent screen
Create a Web client ID
Add the Supabase redirect URL
Create an iOS client ID
Create an Android client ID (if shipping Android)
Step 2: Enable Google in Supabase
Open the provider settings
Add the Web client credentials
Authorize your native client IDs
Save
Step 3: Build the button in Newly
Tell the AI what you want, and give it the client IDs so it can configure the native module:Sign in with Apple
Apple requires native Sign in with Apple for any app that offers third-party login (like Google) on iOS. So if you add Google, you generally must add Apple too, or Apple may reject your submission.Step 1: Configure your App ID in Apple Developer
Enable the capability
Create a Services ID
com.yourcompany.yourapp.signin). Enable Sign in with Apple on it and configure the web domain and return URL:Create a signing key
.p8 file (you can only download it once) and note the Key ID and your Team ID.Step 2: Enable Apple in Supabase
Open the provider settings
Add your credentials
.p8 key file so Supabase can generate the client secret.Authorize the native client ID
Save
Step 3: Build the button in Newly
Handling the session
Once either provider returns a session, the rest of your auth flow is identical to email/password. Ask the AI to tie it together:Row Level Security
Social-logged-in users are regular Supabase auth users, so the same RLS rules apply. Make sure your tables restrict rows to the owner:Testing
Use a development build
Sign in with Google
Sign in with Apple
Verify the user in Supabase
Test persistence
Troubleshooting
Google: 'audience mismatch' or 'invalid token' error
Google: 'audience mismatch' or 'invalid token' error
Redirect URI mismatch
Redirect URI mismatch
https://<your-project-ref>.supabase.co/auth/v1/callback. Double-check the project ref.Apple approves but returns no email
Apple approves but returns no email
Works in preview but not in the build (or vice versa)
Works in preview but not in the build (or vice versa)