Installation
There are two ways to consume the package:
Modern versionβ
Available to GitHub sponsors of the maintainer and Expo customers, this version includes:
β‘οΈModern Sign In implemented with:
- Android: latest Credential Manager library
- Web: Sign In with Google for Web
- iOS & macOS: Google Sign-In SDK
π‘οΈ Advanced security features
π§ Easier configuration - some parameters can be detected automatically
π₯οΈ Full platform support - Deploy everywhere with a unified api: Android, iOS, Web, and macOS
β An example app - to showcase all Modern Sign In features
Your support helps improve the module and upstream SDKs (such as 1, 2). Thank you for enabling better tools for the community! β€οΈ
Public versionβ
Available on the public npm registry, this version:
- Has platform support limited to Android and iOS.
- Uses functional, but deprecated Legacy Android Google Sign-In.
- Contains none of the extra features listed above.
Obtaining access to the Modern versionβ
You can get access either by sponsoring (use specifically the tiers that mention this project!) or as an Expo customer through this form. Note that this version is distributed under a custom license. You will receive an invitation to access the private repo with the sources and examples, as well as to the private npm package.
Three steps are needed to access the private package, which is hosted on GitHub npm packages registry.
-
Become a sponsor or complete the form and accept the private repository invitation.
-
Obtain here a Personal Access Token with
packages:read
permission. -
Set up your package manager so that it fetches the package from the GH packages registry instead of the public registry. In this example, we're using an
NPM_TOKEN_GOOGLE_SIGN_IN
environment variable.
- npm / yarn v1
- yarn v3+
create a .npmrc
file in your project root with the following content:
//npm.pkg.github.com/:_authToken=${NPM_TOKEN_GOOGLE_SIGN_IN}
@react-native-google-signin:registry=https://npm.pkg.github.com/
create a .yarnrc.yml
file in your project root with the following content:
npmScopes:
react-native-google-signin:
npmRegistryServer: https://npm.pkg.github.com
npmAuthToken: '${NPM_TOKEN_GOOGLE_SIGN_IN}'
If you use another package manager (such as Bun), refer to its documentation on how to set up a custom registry.
Requirementsβ
The package supports Expo SDK >= 50 / React Native >= 0.73. Unofficially, it may work with older versions, but it's not guaranteed.
If you're using the New Architecture, it's strongly recommended to use the latest React Native version available.
Installingβ
yarn add @react-native-google-signin/google-signin@latest
If you're using the Modern version, open the npm lockfile (yarn.lock
or package-lock.json
) and verify that the package is fetched from the GitHub registry (the entry must point to npm.pkg.github.com
, not registry.npmjs.org
). If it does not, it means that your package manager is not configured correctly.
There are several guides to follow now:
- Expo guide for native mobile apps built with Expo
- Web guide if you want to use the package on web
- If you're not using Expo but plain React Native, follow Android guide and iOS guide