Skip to content

Latest commit

 

History

History
90 lines (56 loc) · 3.19 KB

README.md

File metadata and controls

90 lines (56 loc) · 3.19 KB
react-native-auth logo

@react-native-auth/google

Modern Google Authentication for React Native

NPM Version License: MIT Platform: Android

GitHub Issues GitHub Pull Requests


Table of Contents


Prerequisites

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.


Features

  • One Tap Sign-In (via Credential Manager)
  • Account Chooser UI
  • Legacy OAuth Support
  • Scope Request

Installation

Using npm

npm install @react-native-auth/google

Using yarn

yarn add @react-native-auth/google

Usage

For detailed implementation examples, please refer to src/GoogleAuth.tsx.

The prompt Parameter

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)

API Reference

Types

For full type definitions, please refer to src/NativeGoogleAuth.ts.


License

License: MIT