1---
2title: Use Google authentication
3description: A guide on using @react-native-google-signin/google-signin library to integrate Google authentication in your Expo project.
4---
5
6import { BoxLink } from '~/ui/components/BoxLink';
7import ImageSpotlight from '~/components/plugins/ImageSpotlight';
8
9The [`@react-native-google-signin/google-signin`](https://github.com/react-native-google-signin/google-signin) library provides different ways, such as Firebase and Google API, to integrate Google authentication in your Expo app. It also provides native sign-in buttons and supports various authentication methods (standard, server-side validation, and offline access). You can use the library in your project by adding the [config plugin](/config-plugins/introduction/) in the [app config](/versions/latest/config/app/).
10
11This guide provides additional information on how to configure the library for your project, and different steps might be required depending on the authentication method you choose.
12
13## Prerequisites
14
15The `@react-native-google-signin/google-signin` library can't be used in the Expo Go app because it requires custom native code. Learn more about [adding custom native code to your app](/workflow/customizing/).
16
17## Installation
18
19See `@react-native-google-signin/google-signin` documentation for instructions on how to install and configure the library:
20
21<BoxLink
22  title="React Native Google Sign In: Expo installation instructions"
23  href="https://github.com/react-native-google-signin/google-signin#expo-installation"
24/>
25
26## Configure Google project for Android and iOS
27
28Below are instructions on how to configure your Google project for Android and iOS.
29
30### Upload app to Google Play Store
31
32We recommend uploading the app to the Google Play Store if your app still needs to be in production. It is not necessary to upload the complete app if your project is still in the development process. Upload a single instance of your app. This will allow you to sign your app with the required certificates, such as the SHA-1 certificate fingerprint, which is required to provide when configuring the Google project for Android. To learn more about the app submission process, see the guides below in the order they are specified:
33
34<BoxLink title="Create your first EAS Build" href="/build/setup/" />
35
36<BoxLink title="Build your project for app stores" href="/deploy/build-project/" />
37
38<BoxLink
39  title="Manually upload Android app for the first time"
40  href="https://expo.fyi/first-android-submission"
41/>
42
43Once you've uploaded your app, you can provide an SHA-1 certificate fingerprint value when asked while configuring the Google project. There are two values that you can provide from:
44
45- Fingerprint of the **.apk** you built (on your machine or using EAS Build). You can find the SHA-1 certificate fingerprint in the Google Play Console under **Release** > **Setup** > **App Integrity** > **Upload key certificate**.
46- Fingerprint of a **production app** downloaded from the play store. You can find the SHA-1 certificate fingerprint in the Google Play Console under **Release** > **Setup** > **App Integrity** > **App signing key certificate**.
47
48### With Firebase
49
50#### Android
51
52For more instructions on how to configure your Google project for Android with Firebase:
53
54<BoxLink
55  title="Firebase"
56  href="https://github.com/react-native-google-signin/google-signin/blob/master/docs/get-config-file.md"
57/>
58
59#### iOS
60
61For more instructions on how to configure your Google project for iOS with Firebase:
62
63<BoxLink
64  title="Firebase"
65  href="https://github.com/react-native-google-signin/google-signin/blob/master/docs/get-config-file.md"
66/>
67
68#### Upload google-services.json and GoogleService-Info.plist to EAS
69
70If you use the Firebase method for Android and iOS (as shared in sections above), you'll need to upload **google-services.json** and **GoogleService-Info.plist** to EAS and add them to **.gitignore** to avoid checking them in the repository.
71
72<BoxLink
73  title="Upload a secret file to EAS and use in the app config"
74  href="/build-reference/variables/#how-to-upload-a-secret-file-and-use-it-in-my-app-config"
75/>
76
77### With Google API
78
79This is an alternate method to configure a Google project when you are not using [Firebase](#with-firebase).
80
81#### Android
82
83For more instructions on how to configure your Google project for Android with Google API:
84
85<BoxLink
86  title="Configure a Google API Console project"
87  href="https://developers.google.com/identity/sign-in/android/start#configure-a-google-api-console-project"
88/>
89
90#### iOS
91
92For iOS, if you use Google API instead of Firebase, you'll need to generate an OAuth client id. Follow the instructions below to generate the client id:
93
94<BoxLink
95  title="Get an OAuth client ID from a Google API Console project"
96  href="https://developers.google.com/identity/sign-in/ios/start-integrating#get_an_oauth_client_id"
97/>
98
99After you have created the iOS client id, you'll also need to provide the iOS URL scheme value in the app config. You can find the value in the Google API console under **API and Services** > **Credentials** > **OAuth 2.0 Client IDs** > **name of your iOS client id** > **Additional information** > **iOS URL scheme**.
100
101<ImageSpotlight
102  alt="Getting iOS URL scheme value from Google API console."
103  src="/static/images/guides/ios-url-scheme.png"
104  style={{ maxWidth: 720 }}
105/>
106
107Then, add the iOS URL scheme value in the app config under [`ios.infoPlist`](/versions/latest/config/app/#infoplist) as shown below:
108
109```json app.json
110{
111  "ios": {
112    /* @hide ...*/ /* @end */
113    "infoPlist": {
114      "CFBundleURLTypes": [
115        {
116          "CFBundleURLSchemes": ["com.googleusercontent.apps.17898xxxxxx-xxxxxqhqj0exxxxxpl03xxx"]
117        }
118      ]
119    }
120  }
121}
122```
123