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.
GoogleOAuthProvider is the required wrapper for your application. It loads the Google Identity Services (GSI) JavaScript library and exposes the OAuth client ID through React context. All other components and hooks from @react-oauth/google must be rendered inside this provider.
Usage
Get your client ID from the Google API Console. Add both
http://localhost and http://localhost:<port_number> to the Authorized JavaScript origins for local development.Props
Your Google API client ID. You can find this value in the Google API Console.
Nonce string applied to the GSI script tag. This value propagates to the GSI inline style tag, which is useful for Content Security Policy (CSP) compliance.
Override the default locale for all child Google components. When set, button labels and prompts are rendered in the specified language.
Callback fired when the GSI script loads successfully.
Callback fired when the GSI script fails to load. Use this to show a fallback UI or log the error.
Accessing context
Use theuseGoogleOAuth hook inside any descendant component to access the values exposed by this provider:

