Skip to main content
Google One Tap is a popular, low-friction authentication method that allows end users to select the Google account they wish to use to sign in with a single tap. The Google One Tap prompt will appear in the top right of the end user’s browser, and will look something like this: Google One Tap prompt

Summary of Key Differences

For a quick overview of the differences between Google OAuth and Google One Tap, see the table below:
Standard Google OAuthGoogle One Tap
Issued OAuth Tokensaccess_token and refresh_tokenNone (use standard OAuth if tokens are needed)
Available Stytch Integration MethodsBackend, Headless Frontend, Pre-built UIHeadless Frontend, Pre-built UI
Supported BrowsersAllNot supported in Arc or Brave; blocked by certain browser extensions
Headless SDK Reference DocsDiscovery sign-up and login and Organization loginDiscovery sign-up and login and Organization login

Adding One Tap to your Google OAuth integration

You’ll first need to configure Google OAuth in the Stytch Dashboard, by following the steps here. Ensure you add your application’s URI as an Authorized Javascript Origin in your Google OAuth credential. For example, if you plan on showing One Tap at https://example.com/login, enter https://example.com. If you’re using localhost for testing, we recommend adding both http://localhost and http://locahost:[port].

Headless frontend integration

If you don’t already have Google OAuth set up in the headless SDK, follow the steps here.
To use Google One Tap for the flow, call the oauth.googleOneTap.discovery.start() method to display the Google One Tap prompt in the upper right of the user’s browser tab.The user is redirected to the Discovery Redirect URL you configured in the Stytch Dashboard after a successful One Tap selection.The examples below show how to display One Tap in response to a user action (button click). You can also show it on page load.
import { useStytchB2BClient } from '@stytch/react/b2b';
export const GoogleOneTapDiscovery = () => {
    const stytchClient = useStytchB2BClient();
    const showGoogleOneTapDiscovery = () =>
        stytchClient.oauth.googleOneTap.discovery.start();
    return <button onClick={showGoogleOneTapDiscovery}>Show Google One Tap Discovery</button>;
};

Pre-built UI frontend integration

You’ll first need to have Google OAuth set up in the pre-built UI components, following the steps here. To enable One Tap, include one_tap in your providers list in the OAuth UI configuration. If the only product is oauth and the only provider is google with one_tap: true, the login form is not displayed and only the One Tap prompt will appear in the upper right of the user’s browser.
Google One Tap is not supported on all browsers and may be blocked by certain extensions. If Google OAuth is your only login method, we recommend using One Tap in targeted locations rather than on your primary login page.
import { B2BProducts, StytchB2B } from '@stytch/react/b2b';

const Login = () => {
  const config = {
    authFlowType: 'Discovery', // or "Organization"
    products: [B2BProducts.oauth],
    oauthOptions: {
      providers: [{ type: 'google', one_tap: true }],
    },
  };

  return <StytchB2B config={config} />;
};

export default Login;