Installation
There are two ways to consume the package:
Sponsor-Only Version
Available exclusively to GitHub sponsors, this version offers:
✅ One-tap sign-in support for Android and Web, with an API compatibility layer for iOS and macOS.
✅ Automatic webClientId detection for Firebase.
✅ Support for macOS (using react-native-macOS).
Your sponsorship enables continued maintenance and development of the module and contributions to upstream SDKs (such as 1, 2). Thank you for supporting this project! ❤️
Public Version
Available on the public npm registry, this version does not include One-tap sign-in (it uses the functional, but deprecated legacy Google Sign-In for Android), Web and macOS support found in the sponsor-only version.
Accessing the private package for sponsors
Upon sponsoring (please use specifically the tiers that mention this project!), you will get an invitation to access the private package and to the private repo with the sources and examples.
Three steps are needed to access the sponsor package, which is hosted on GitHub npm packages registry.
-
Become a sponsor and accept the private repository invitation - it takes just a few clicks.
-
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), please refer to its documentation on how to set up a custom registry.
Requirements
The package requires React Native 0.60 or higher.
If you're using the New Architecture, you need to be on React Native 0.72 or higher but it's strongly recommended to use the latest version available.
Installing
yarn add @react-native-google-signin/google-signin@latest
If you're a sponsor, 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 the Web
- If you're not using Expo but plain React Native, follow Android guide and iOS guide