Documentation Index
Fetch the complete documentation index at: https://mintlify.com/MomenSherif/react-oauth/llms.txt
Use this file to discover all available pages before exploring further.
useGoogleOneTapLogin displays the Google One Tap prompt when the component mounts. It is a side-effect-only hook — it returns void and does not render any UI. Use it to prompt unauthenticated users to sign in without requiring them to navigate to a sign-in page.
Usage
The hook calls
google.accounts.id.cancel() on cleanup, so the prompt is automatically dismissed when the component unmounts.Parameters
Callback fired with the credential response after a successful sign-in.
Callback fired when the One Tap sign-in fails.
Callback for PromptMomentNotification events. Use this to observe when the prompt is displayed, skipped, or dismissed.
Controls whether the One Tap prompt is cancelled when the user clicks outside of it.
Enables automatic credential selection when only one Google account is available and the user has not opted out.
Hint to Google indicating which Google Workspace domain the user belongs to. See the
hd field in the OpenID Connect docs.When
true, cancels any active One Tap prompt and prevents new ones from appearing. Use this when the user is already authenticated.The DOM element ID of the container in which to render the One Tap prompt.
Pass the parent domain here to share a single state cookie between the parent domain and its subdomains.
Allows the browser to control user sign-in prompts and mediate the sign-in flow using the FedCM API.
Enables the FedCM Button flow.
Return value
This hook returnsvoid. All interaction is handled through the onSuccess and onError callbacks.
Preventing automatic re-sign-in after logout
If you use One Tap login, callgoogleLogout when the user signs out to prevent Google from automatically signing them back in:

