CDP Frontend SDK
    Preparing search index...

    Function useSignInWithOAuth

    • 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;
      }

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

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