Skip to main content
function useSignInWithOAuth(): {
  signInWithOAuth: (providerType: OAuth2ProviderType) => Promise<void>;
  oauthState:   | null
     | OAuthFlowState;
};
Hook that provides access to the OAuth sign-in functionality (Google is currently supported). This is the first step in the OAuth authentication flow. In a web application, this will redirect the user to the OAuth provider sign in page. This sign in method is not yet supported on mobile.

Returns

{
  signInWithOAuth: (providerType: OAuth2ProviderType) => Promise<void>;
  oauthState:   | null
     | OAuthFlowState;
}

signInWithOAuth()

signInWithOAuth: (providerType: OAuth2ProviderType) => Promise<void>;

Parameters

ParameterType
providerTypeOAuth2ProviderType

Returns

Promise<void>

oauthState

oauthState: 
  | null
  | OAuthFlowState;

Example

function SignInForm() {
  const { signInWithOAuth } = useSignInWithOAuth("google");

  const handleSignInWithOAuth = () => {
    void signInWithOAuth("google");
  };
I