This guide will teach you how to add native Sign in with Google to your Clerk Expo application. This is different from Google OAuth - if you want to use Google OAuth, see the dedicated guide.
To make the setup process easier, it's recommended to keep two browser tabs open - one for the Clerk Dashboard and one for your Google Cloud Console.
You'll need to create two sets of OAuth 2.0 credentials: one for your native platform and one for the web client. Even if you are building a native app, you still need to create the web client for Clerk's token verification.
If you're building for both iOS and Android, ensure that you create all three sets of credentials (iOS, Android, and web).
Navigate to APIs & Services. Then, in the left sidebar, select Credentials.
Next to Credentials, select Create Credentials. Then, select OAuth client ID. You might need to configure your OAuth consent screen. Otherwise, you'll be redirected to the Create OAuth client ID page.
For the Application type, select iOS.
Complete the required fields:
Name: Add a name for your client.
Bundle ID: Add your iOS Bundle ID.
Select Create. A modal will open with your Client ID. Copy and save the Client ID - you'll need this for EXPO_PUBLIC_CLERK_GOOGLE_IOS_CLIENT_ID.
In the same project, create another client. Next to Credentials, select Create Credentials. Then, select OAuth client ID.
For the Application type, select Android.
Complete the required fields:
Package name: Your package name is in your app.json or app.config.ts under the expo.android.package key.
SHA-1 certificate fingerprint: To get your SHA-1, run the following command in your terminal:
Important
Replace path-to-debug-or-production-keystore with the path to your debug or production keystore. By default, the debug keystore is located in ~/.android/debug.keystore. It may ask for a keystore password, which is android. You may need to install OpenJDK (Java) to run the keytool command.
Navigate back to the Clerk Dashboard where the configuration page should still be open. Paste the Client ID and Client Secret values that you saved into the respective fields.
Select Save.
Note
If the page is no longer open, navigate to the SSO connections page in the Clerk Dashboard. Select the connection. Under Use custom credentials, paste the values into their respective fields.
Add your iOS application to the Native Applications page in the Clerk Dashboard. You'll need your iOS app's App ID Prefix (Team ID) and Bundle ID.
Add your Android application to the Native Applications page in the Clerk Dashboard.
Namespace: A name for your application.
Package name: Your package name is in your build.gradle file, formatted as com.example.myclerkapp.
SHA-256 certificate fingerprint: To get your SHA-256, run the following command in your terminal:
Important
Replace path-to-debug-or-production-keystore with the path to your debug or production keystore. By default, the debug keystore is located in ~/.android/debug.keystore. It may ask for a keystore password, which is android. You may need to install OpenJDK to run the keytool command.
Add the Google OAuth client IDs to your .env file. You'll have saved these values in the previous steps.
iOS
Android
.env
EXPO_PUBLIC_CLERK_GOOGLE_WEB_CLIENT_ID=your-web-client-id.apps.googleusercontent.comEXPO_PUBLIC_CLERK_GOOGLE_IOS_CLIENT_ID=your-ios-client-id.apps.googleusercontent.com# (iOS only)# EXPO_PUBLIC_CLERK_GOOGLE_IOS_URL_SCHEME is the URL scheme for Google sign-in callback# Replace your-ios-client-id with the same <your-ios-client-id> from EXPO_PUBLIC_CLERK_GOOGLE_IOS_CLIENT_ID. It should only be the part of your iOS Client ID before ".apps.googleusercontent.com".EXPO_PUBLIC_CLERK_GOOGLE_IOS_URL_SCHEME=com.googleusercontent.apps.your-ios-client-id
This step is for iOS only and is optional. Currently, Sign in with Google will open a web browser to initiate the flow. If you'd rather have the app handle the flow natively and not open a web browser, follow this step.
The @clerk/expo config plugin configures the URL scheme needed for Google's authentication callback. Add the plugin to your app.json or app.config.ts, depending on your app's configuration:
Quiz
What is the difference between app.json and app.config.ts?
app.json is for projects using static JSON configuration. app.config.ts is for projects that need dynamic configuration (environment variables, conditional logic, etc.). When both files exist, app.config.ts receives the values from app.json and can extend or override them.
app.json
app.config.ts
Replace your-ios-client-id with the same <your-ios-client-id> from your EXPO_PUBLIC_CLERK_GOOGLE_IOS_CLIENT_ID environment variable (it should only be the part of your iOS Client ID before ".apps.googleusercontent.com").
If you're using <AuthView />Expo Icon from @clerk/expo/native, you do not need to install expo-crypto or use the useSignInWithGoogle() hook — <AuthView /> handles the sign-in flow automatically.
The useSignInWithGoogle()Expo Icon hook requires expo-crypto for generating secure nonces during the authentication flow.
terminal
npxexpoinstallexpo-crypto
The following example demonstrates how to use the useSignInWithGoogle()Expo Icon hook to manage the Google authentication flow. Because the useSignInWithGoogle() hook automatically manages the transfer flow between sign-up and sign-in, you can use this component for both your sign-up and sign-in pages.
Create a native build with EAS Build or a local prebuild, since Google Authentication is not supported in Expo Go.
terminal
# Using EAS Buildeasbuild--platformioseasbuild--platformandroid# Or using local prebuildnpxexpoprebuild&&npxexporun:ios--devicenpxexpoprebuild&&npxexporun:android--device