Before implementing this library, you must configure your Google Cloud Console credentials correctly:
- Web Client ID: This is the only Client ID you will use inside your actual application code (such as your React components or configuration files).
- Android Client ID: You must create an Android Client ID in the Google Cloud Console and register your app's SHA-1 fingerprint to it.
Important: Do not use the Android Client ID in your React Native source code. The Android Client ID exists strictly for Google's servers to verify your application's SHA-1 signature behind the scenes. Your app code should only ever reference the Web Client ID.
- One Tap Sign-In (via Credential Manager)
- Account Chooser UI
- Legacy OAuth Support
- Scope Request
npm install @react-native-auth/googleyarn add @react-native-auth/googleYou can download the example app on our github action's artifacts
The source of the example app can be found here
The fingerprints of the example app are:
SHA1:
5E:8F:16:06:2E:A3:CD:2C:4A:0D:54:78:76:BA:A6:F3:8C:AB:F6:25SHA-256:
FA:C6:17:45:DC:09:03:78:6F:B9:ED:E6:2A:96:2B:39:9F:73:48:F0:BB:6F:89:9B:83:32:66:75:91:03:3B:9CThe example app uses the default
debug.keystorefile provided by android.
For detailed implementation examples, please refer to src/GoogleAuth.tsx.
This parameter controls the behavior of the authentication flow:
| Value | Behavior |
|---|---|
undefined |
Default behavior - no forced interaction |
'consent' |
Always show consent screen, even for an existing app |
'login' |
Always show login screen, force account selection |
'select_account' |
Always show account selection screen |
'none' |
Silent authentication (may fail if no session exists) |
For full type definitions, please refer to src/NativeGoogleAuth.ts.
