# useConnectedUser | @account-kit/react

> Overview of the useConnectedUser hook from @account-kit/react

> For the complete documentation index, see [llms.txt](/docs/llms.txt).

{/* This file is auto-generated by TypeDoc. Do not edit manually. */}

```ts
function useConnectedUser(): UseConnectedUserResult;
```

Defined in: [account-kit/react/src/hooks/useConnectedUser.ts:48](https://github.com/alchemyplatform/aa-sdk/blob/main/account-kit/react/src/hooks/useConnectedUser.ts#L48)

A React hook that returns the currently connected user across external wallets (EVM or Solana)
or the smart account user from the client store. It prioritizes the EVM wallet connection, then
Solana, and finally the smart account user.

Useful for building UI that needs a single "connected user" concept regardless of whether a
smart account session exists.

- If an EVM wallet is connected, returns `{ address, type: "eoa", orgId?, userId? }`.
- If a Solana wallet is connected, returns `{ solanaAddress, type: "eoa", orgId?, userId? }` and
  `address` may be undefined. `orgId` and `userId` may also be undefined.
- Otherwise, returns the smart account user from the store with `type: "sca"`, or `null` if no
  user exists.

## Example

```ts twoslash
import { useConnectedUser } from "@account-kit/react";

const user = useConnectedUser();

if (user?.type === "eoa") {
  // EVM wallets expose `address`; Solana wallets expose `solanaAddress`.
  console.log("Connected EOA:", user.address ?? user.solanaAddress);
}
```

## Returns

[`UseConnectedUserResult`](../type-aliases/UseConnectedUserResult)

The connected user, or `null` if no user is available. [ref](https://github.com/alchemyplatform/aa-sdk/blob/main/account-kit/react/src/hooks/useConnectedUser.ts)