> ## Documentation Index
> Fetch the complete documentation index at: https://stytch.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Google One Tap

> Implement Google One Tap authentication using the Stytch React SDK

`oauth.googleOneTap.start()` will show the Google One Tap prompt in the top right corner of the user's browser. An `organization_id` is required to specify which organization the user is trying to access. If the organization that the user is trying to access is not yet known, use the `oauth.googleOneTap.discovery.start()` method instead.

If the end user clicks to sign in with Google One Tap, Stytch will verify the response and redirect to the `login_redirect_url` or `signup_redirect_url` provided, or the default redirect URLs if none are specified. A PKCE `code_verifier` will also be generated and stored in local storage on the device (See the [PKCE OAuth guide](https://stytch.com/docs/multi-tenant-auth/authentication/oauth/adding-pkce.md) for details). If your application is configured to use a custom subdomain with Stytch, it will be used automatically.

Once the user is successfully redirected, you can collect the Stytch OAuth token from the URL query parameters, and call the [OAuth Authenticate](https://stytch.com/docs/api-reference/b2b/frontend-sdks/react/methods/oauth/authenticate.md) method to complete the authentication flow.

> [!WARNING]
>
> Google One Tap does **not** return access tokens. If you wish to retrieve the user's access token, use the [Start OAuth Flow](https://stytch.com/docs/api-reference/b2b/frontend-sdks/react/methods/oauth/start.md) method instead.

### Method parameters

**organization\_id** `string` *required*

The id of the Organization to start the OAuth flow for.

**login\_redirect\_url** `string` *required*

The URL Stytch redirects to after the OAuth flow is completed for a Member that already exists. This URL should be a route in your application which will run oauth.authenticate (see below) and finish the login.

The URL must be configured as a Login URL in the [Redirect URL page](https://stytch.com/dashboard/redirect-urls). If the field is not specified, the default Login URL will be used.

**signup\_redirect\_url** `string` *required*

The URL Stytch redirects to after the OAuth flow is completed for a Member that does not yet exist. This URL should be a route in your application which will run oauth.authenticate (see below) and finish the login.

The URL must be configured as a Signup URL in the [Redirect URL page](https://stytch.com/dashboard/redirect-urls). If the field is not specified, the default Signup URL will be used.

**cancel\_on\_tap\_outside** `boolean` (default: true)

Whether the Google One Tap prompt is automatically dismissed when the user taps outside of it. Defaults to `true`.

### Response

**success** `boolean`

Whether the Google One Tap prompt was successfully started.

**reason** `string`

If `success` is `false`, the reason why the Google One Tap prompt failed to start.

```jsx theme={null}
import { useEffect } from 'react';
import { useStytchB2BClient } from '@stytch/react/b2b';

export const GoogleOneTapLogin = () => {
  const stytch = useStytchB2BClient();

  useEffect(() => {
    const result = stytch.oauth.googleOneTap.start({
      organization_id: 'organization-test-07971b06-ac8b-4cdb-9c15-63b17e653931',
      login_redirect_url: 'https://example.com/authenticate',
      signup_redirect_url: 'https://example.com/authenticate',
    });

    if (!result.success) {
      console.error('Google One Tap failed to start:', result.reason);
    }
  }, [stytch]);

  return <div>Loading Google One Tap...</div>;
};
```
