Skip to content

Latest commit

 

History

History
121 lines (75 loc) · 5.18 KB

install.mdx

File metadata and controls

121 lines (75 loc) · 5.18 KB
sidebar_position
1

Installation

There are two ways to consume the package:

Universal Sign In {#sponsor-only-version}

⭐️ Key Features:

🛡️ Advanced security features

🔧 Easier setup - Automatic detection of configuration parameters for faster integration.

📱 An example app - to showcase all Universal sign in features

Your purchase enables improvements in the module and upstream SDKs (such as 1, 2).

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 Universal Sign In {#obtaining-access}

Universal sign in requires purchasing a license, after which you will be able to configure your (or your colleagues') access to the private npm package and to the private repo with the sources and examples. Alternatively, as an Expo customer, obtain access through this form.

Accessing the private npm package {#package-manager-setup}

The private npm package is like any other, but it's hosted on the GitHub npm packages registry, not the public npm registry. Therefore, a small bit of setup is needed:

  1. Obtain here a Personal Access Token with packages:read permission.

  2. 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.

import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem';

create a `.yarnrc.yml` file in your project root with the following content:
```yml title=".yarnrc.yml"
npmScopes:
react-native-google-signin:
npmRegistryServer: https://npm.pkg.github.com
npmAuthToken: '${NPM_TOKEN_GOOGLE_SIGN_IN}'
```
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/

If you use another package manager (such as Bun), refer to its documentation on how to set up a custom registry.

Installing

```bash yarn add @react-native-google-signin/google-signin@latest ``` ```bash npm i @react-native-google-signin/google-signin@latest ```

If you're using the Universal version, open the lockfile (yarn.lock / 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 - try uninstalling and reinstalling the package.

There are several guides to follow now:

Requirements

The packages support last 3 stable releases of React Native. Unofficially, they may work with older versions too.

If you're using the New Architecture, it's strongly recommended to use the latest React Native version available.