useAccount hook returns the current user’s account information including their connection status, user ID, and linked auth methods.
Import
import { useAccount } from "@getpara/react-native-wallet";
Usage
import { useAccount } from "@getpara/react-native-wallet";
import { View, Text } from "react-native";
function AccountStatus() {
const { embedded, isConnected, connectionType, isLoading } = useAccount();
if (isLoading) return <Text>Loading...</Text>;
return (
<View>
<Text>Status: {isConnected ? "Connected" : "Not connected"}</Text>
<Text>Connection: {connectionType}</Text>
{embedded?.userId && <Text>User ID: {embedded.userId}</Text>}
{embedded?.identifier && <Text>Identifier: {embedded.identifier}</Text>}
{embedded?.wallets?.map((w) => (
<Text key={w.id}>{w.type}: {w.address}</Text>
))}
</View>
);
}
Return Value
| Property | Type | Description |
|---|---|---|
isConnected | boolean | Whether any wallet is connected (embedded or external) |
isLoading | boolean | Whether the account is still loading |
connectionType | 'embedded' | 'external' | 'both' | 'none' | The type of active connection |
embedded | object | The embedded Para account data |
embedded.userId | string | The user’s Para ID |
embedded.identifier | string | The user’s login identifier (email, phone, etc.) |
embedded.authType | string | The authentication method used |
embedded.wallets | Wallet[] | All wallets on the account |
embedded.isConnected | boolean | Whether the embedded wallet specifically is connected |
embedded.isGuestMode | boolean | Whether the user is in guest mode |
external | object | External wallet data (web only, empty on React Native) |