Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 23 additions & 22 deletions docs/api/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Parameters for enabling [App Check](/docs/security#appcheck). Provide `debugProv

`webClientId` is the most important parameter in the configuration. It is required.

#### Type declaration
#### Type Declaration

| Name | Type | Description |
| ------------------- | --------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
Expand All @@ -68,7 +68,7 @@ Parameters for enabling [App Check](/docs/security#appcheck). Provide `debugProv

> **OneTapCreateAccountParams** = [`OneTapSignInParams`](#onetapsigninparams) & \{ `accountName?`: `string`; `requestVerifiedPhoneNumber?`: `boolean`; \}

#### Type declaration
#### Type Declaration

| Name | Type | Description |
| ----------------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
Expand All @@ -81,7 +81,7 @@ Parameters for enabling [App Check](/docs/security#appcheck). Provide `debugProv

> **OneTapExplicitSignInParams** = [`OneTapSignInParams`](#onetapsigninparams) & \{ `accountName?`: `string`; \}

#### Type declaration
#### Type Declaration

| Name | Type | Description |
| -------------- | -------- | ------------------------------------------------------------------------------------------------------- |
Expand Down Expand Up @@ -109,7 +109,7 @@ The response object for OneTap's `signIn` and `createAccount`.

Learn more about additional web-only parameters at [Google's reference documentation](https://developers.google.com/identity/gsi/web/reference/js-reference#IdConfiguration).

#### Type declaration
#### Type Declaration

| Name | Type | Description |
| ------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
Expand Down Expand Up @@ -197,19 +197,20 @@ The entry point of the Universal Sign In API, exposed as `GoogleOneTapSignIn`.

On the web, the signatures of `signIn`, `presentExplicitSignIn`, and `createAccount` are callback-based and on native they are Promise-based. Read more in the [guide](/docs/one-tap#web-support).

#### Type declaration

| Name | Type |
| ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `configure` | (`params`: [`OneTapConfigureParams`](#onetapconfigureparams)) => `void` |
| `checkPlayServices` | (`showErrorResolutionDialog`?: `boolean`) => `Promise`\<[`PlayServicesInfo`](#playservicesinfo)\> |
| `enableAppCheck` | (`params`?: [`EnableAppCheckParams`](#enableappcheckparams)) => `Promise`\<`null`\> |
| `signIn` | (`params?`: [`OneTapSignInParams`](#onetapsigninparams)) => `Promise`\<[`OneTapResponse`](#onetapresponse)\> |
| `createAccount` | (`params?`: [`OneTapCreateAccountParams`](#onetapcreateaccountparams)) => `Promise`\<[`OneTapResponse`](#onetapresponse)\> |
| `presentExplicitSignIn` | (`params?`: [`OneTapExplicitSignInParams`](#onetapexplicitsigninparams)) => `Promise`\<[`OneTapExplicitSignInResponse`](#onetapexplicitsigninresponse)\> |
| `requestAuthorization` | (`options`: [`RequestAuthorizationParams`](#requestauthorizationparams)) => `Promise`\<[`AuthorizationResponse`](#authorizationresponse)\> |
| `signOut` | () => `Promise`\<`null`\> |
| `revokeAccess` | (`emailOrUniqueId`: `string`) => `Promise`\<`null`\> |
#### Type Declaration

| Name | Type |
| -------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------- |
| `configure` | (`params`: [`OneTapConfigureParams`](#onetapconfigureparams)) => `void` |
| `checkPlayServices` | (`showErrorResolutionDialog`?: `boolean`) => `Promise`\<[`PlayServicesInfo`](#playservicesinfo)\> |
| `enableAppCheck` | (`params`?: [`EnableAppCheckParams`](#enableappcheckparams)) => `Promise`\<`null`\> |
| `signIn` | (`params?`: [`OneTapSignInParams`](#onetapsigninparams)) => `Promise`\<[`OneTapResponse`](#onetapresponse)\> |
| `createAccount` | (`params?`: [`OneTapCreateAccountParams`](#onetapcreateaccountparams)) => `Promise`\<[`OneTapResponse`](#onetapresponse)\> |
| `clearCachedAccessToken()` | (`tokenString`: `string`) => `Promise`\<`null`\> | `GoogleSignin.clearCachedAccessToken` |
| `presentExplicitSignIn` | (`params?`: [`OneTapExplicitSignInParams`](#onetapexplicitsigninparams)) => `Promise`\<[`OneTapExplicitSignInResponse`](#onetapexplicitsigninresponse)\> |
| `requestAuthorization` | (`options`: [`RequestAuthorizationParams`](#requestauthorizationparams)) => `Promise`\<[`AuthorizationResponse`](#authorizationresponse)\> |
| `signOut` | () => `Promise`\<`null`\> |
| `revokeAccess` | (`emailOrUniqueId`: `string`) => `Promise`\<`null`\> |

## Original Google sign in

Expand All @@ -229,7 +230,7 @@ On the web, the signatures of `signIn`, `presentExplicitSignIn`, and `createAcco

> **ConfigureParams** = [`ClientIdOrPlistPath`](#clientidorplistpath) & \{ `accountName?`: `string`; `forceCodeForRefreshToken?`: `boolean`; `hostedDomain?`: `string`; `offlineAccess?`: `boolean`; `openIdRealm?`: `string`; `profileImageSize?`: `number`; `scopes?`: `string`[]; `webClientId?`: `WebClientId`; \}

#### Type declaration
#### Type Declaration

| Name | Type | Description |
| --------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
Expand Down Expand Up @@ -338,7 +339,7 @@ The response object when the user signs in successfully.

The entry point of the Google Sign In API, exposed as `GoogleSignin`.

#### Type declaration
#### Type Declaration

| Name | Type |
| -------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
Expand Down Expand Up @@ -500,7 +501,7 @@ if (isSuccessResponse(response)) {

> **GoogleSigninButtonProps** = `ViewProps` & \{ `color?`: `"dark"` \| `"light"`; `disabled?`: `boolean`; `onPress?`: () => `void`; `size?`: `number`; \}

#### Type declaration
#### Type Declaration

| Name | Type |
| ------------ | --------------------- |
Expand All @@ -515,7 +516,7 @@ if (isSuccessResponse(response)) {

> **WebGoogleSignInButtonProps** = `Omit`\<`GsiButtonConfiguration`, `"logo_alignment"`\> & \{ `logoAlignment?`: `GsiButtonConfiguration`\[`"logo_alignment"`\]; `onError?`: (`error`: `Error`) => `void`; \}

#### Type declaration
#### Type Declaration

| Name | Type |
| ---------------- | ---------------------------------------------- |
Expand Down Expand Up @@ -585,7 +586,7 @@ You can specify a different bundle path for the config file, e.g. "GoogleService

Alternatively, set the client ID explicitly by providing `iosClientId`.

#### Type declaration
#### Type Declaration

\{ `iosClientId?`: `string`; \}

Expand Down
4 changes: 2 additions & 2 deletions docs/migrating.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ Migrating from Original to Universal module is mostly about changing the method
| `signOut` | `signOut` | |
| `revokeAccess` | `revokeAccess` | Universal requires email/id parameter on web. |
| `hasPreviousSignIn` | Use `signIn` response | Check for `noSavedCredentialFound` response type. |
| `clearCachedAccessToken` | Not provided, presumably not needed. | - |
| `clearCachedAccessToken` | `clearCachedAccessToken` | Same functionality. |

---

## Migrating to new JS API
## Migrating to the new JS API

Version 13 introduced a new JS API, which changes some method response signatures and makes minor changes to error handling (details [here](https://github.com/react-native-google-signin/google-signin/pull/1326)). If you're upgrading from version 12 or earlier, you'll need to make some minor adjustments.

Expand Down
8 changes: 8 additions & 0 deletions docs/one-tap.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,14 @@ import RequestAuthorization from './screenshots/_requestAuthorization.mdx';

<RequestAuthorization />

---

### `clearCachedAccessToken`

signature: (`accessTokenString`: `string`) => `Promise`\<`null`\>

This method is only needed on Android. You may run into a `401 Unauthorized` error when an access token is invalid. Call this method to remove the token from local cache and then call `requestAuthorization()` to get a fresh access token. Calling this method on Apple does nothing and always resolves. This is because on Apple, `requestAuthorization()` always returns valid tokens, refreshing them first if they have expired or are about to expire (see [docs](https://developers.google.com/identity/sign-in/ios/reference/Classes/GIDGoogleUser#-refreshtokensifneededwithcompletion:)).

## Automatic `webClientId` & `iosClientId` detection {#automatic-config}

If you use Expo (with the config plugin and prebuild), or if you're using Firebase, you don't need to provide the `iosClientId` parameter to the `configure` method.
Expand Down