> ## Documentation Index
> Fetch the complete documentation index at: https://docs.solanamobile.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Setup

> Set up MobileWalletProvider and the useMobileWallet hook in your React Native app.

## MobileWalletProvider

Wrap your app's root component with `MobileWalletProvider` from `@wallet-ui/react-native-web3js`. This provider manages the wallet connection state and exposes the `useMobileWallet` hook to all child components.

```tsx App.tsx theme={null}
import { MobileWalletProvider } from '@wallet-ui/react-native-web3js';
import { clusterApiUrl } from '@solana/web3.js';

const chain = 'solana:devnet';
const endpoint = clusterApiUrl('devnet');
const identity = {
  name: 'My Solana App',
  uri: 'https://mysolanaapp.com',
  icon: 'favicon.png',
};

export default function App() {
  return (
    <MobileWalletProvider chain={chain} endpoint={endpoint} identity={identity}>
      {/* Your app content */}
    </MobileWalletProvider>
  );
}
```

### Props

| Prop       | Type     | Description                                                                         |
| ---------- | -------- | ----------------------------------------------------------------------------------- |
| `chain`    | `string` | The Solana cluster to connect to (e.g. `'solana:devnet'`, `'solana:mainnet-beta'`). |
| `endpoint` | `string` | The RPC endpoint URL for the cluster.                                               |
| `identity` | `object` | Your app's identity shown to the user during wallet authorization.                  |

### Identity object

| Field  | Type     | Description                               |
| ------ | -------- | ----------------------------------------- |
| `name` | `string` | Your app's display name.                  |
| `uri`  | `string` | Your app's website URL.                   |
| `icon` | `string` | Path to your app icon, relative to `uri`. |

## useMobileWallet hook

Inside any component wrapped by `MobileWalletProvider`, use the `useMobileWallet` hook to access wallet functionality:

```tsx theme={null}
import { useMobileWallet } from '@wallet-ui/react-native-web3js';

function MyComponent() {
  const {
    account,           // The connected wallet account (null if disconnected)
    connect,           // Connect to a wallet
    disconnect,        // Disconnect from the wallet
    signMessage,       // Sign an arbitrary message
    signIn,            // Sign in with Solana (SIWS)
    signAndSendTransaction, // Sign and send a transaction
    connection,        // The Solana RPC connection instance
  } = useMobileWallet();

  return (
    // Your component UI
  );
}
```

## Next steps

<Card title="Quickstart" icon="rocket" href="/get-started/react-native/quickstart">
  See usage examples for all useMobileWallet hook methods.
</Card>
