Skip to main content
The useAuthenticateWithOAuth hook handles the entire OAuth authentication flow — redirect, verification, session waiting, and wallet creation — in a single call. Supports Google, Apple, Discord, X, Facebook, Telegram, and Farcaster. On React Native, provide appScheme so the OAuth redirect returns to your app, and use onOAuthUrl to open the URL in the system browser.

Import

import { useAuthenticateWithOAuth } from "@getpara/react-native-wallet";

Usage

import { useAuthenticateWithOAuth } from "@getpara/react-native-wallet";
import { Linking } from "react-native";
import * as WebBrowser from "expo-web-browser";

function GoogleLoginButton() {
  const { authenticateWithOAuthAsync, isPending } = useAuthenticateWithOAuth();

  const handleLogin = async () => {
    try {
      await authenticateWithOAuthAsync({
        method: "GOOGLE",
        appScheme: "myapp",
        redirectCallbacks: {
          onOAuthUrl: (url) => WebBrowser.openBrowserAsync(url),
        },
      });
    } catch (err) {
      console.error(err);
    }
  };

  return (
    <Button title={isPending ? "Signing in..." : "Sign in with Google"} onPress={handleLogin} disabled={isPending} />
  );
}
This hook must be paired with para.onStatePhaseChange() to handle portal URLs that appear after OAuth completes (e.g. passkey or password setup for returning users). See Handling State Changes for the full state listener pattern.