> ## 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.

# Quickstart

> Usage examples for connecting to wallets, signing messages, and sending transactions with useMobileWallet.

This page demonstrates how to use each method from the `useMobileWallet` hook. Make sure you have completed the [Installation](/get-started/react-native/installation) and [Setup](/get-started/react-native/setup) steps first.

## Connect / Disconnect

Use `connect` to initiate a wallet connection and `disconnect` to end it. The `account` field contains the connected wallet's public key.

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

function ConnectButton() {
  const { account, connect, disconnect } = useMobileWallet();

  if (account) {
    return (
      <Button title="Disconnect" onPress={disconnect} />
    );
  }

  return (
    <Button title="Connect Wallet" onPress={connect} />
  );
}
```

## Sign Message

Use `signMessage` to request the wallet to sign an arbitrary byte payload. This is useful for off-chain signature verification.

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

function SignMessageButton() {
  const { signMessage } = useMobileWallet();

  const handleSignMessage = async () => {
    const message = 'Verify this message';
    const messageBytes = new TextEncoder().encode(message);
    const signature = await signMessage(messageBytes);
    console.log('Signature:', signature);
  };

  return <Button title="Sign Message" onPress={handleSignMessage} />;
}
```

## Sign In with Solana (SIWS)

Use `signIn` to connect to a wallet and verify ownership in a single step. This combines authorization and message signing into one user interaction.

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

function SignInButton() {
  const { account, signIn } = useMobileWallet();

  const handleSignIn = async () => {
    await signIn({
      domain: 'your-app-domain.com',
      statement: 'Sign in to Your App',
    });
    console.log('Signed in:', account?.address);
  };

  return <Button title="Sign In" onPress={handleSignIn} />;
}
```

## Sign and Send Transaction

Use `signAndSendTransaction` to request the wallet to sign a transaction and submit it to the Solana network.

```tsx theme={null}
import { useMobileWallet } from '@wallet-ui/react-native-web3js';
import {
  PublicKey,
  SystemProgram,
  Transaction,
} from '@solana/web3.js';

function SendTransactionButton() {
  const { account, signAndSendTransaction, connection } = useMobileWallet();

  const handleSendTransaction = async () => {
    if (!account) return;

    const { blockhash } = await connection.getLatestBlockhash();

    const transaction = new Transaction({
      recentBlockhash: blockhash,
      feePayer: new PublicKey(account.address),
    }).add(
      SystemProgram.transfer({
        fromPubkey: new PublicKey(account.address),
        toPubkey: new PublicKey('11111111111111111111111111111111'),
        lamports: 1_000_000,
      }),
    );

    const signature = await signAndSendTransaction(transaction);
    console.log('Transaction signature:', signature);
  };

  return <Button title="Send Transaction" onPress={handleSendTransaction} />;
}
```

## Next steps

<CardGroup cols={2}>
  <Card title="Advanced: Invoke MWA Sessions Directly" icon="terminal" href="/get-started/react-native/invoke-mwa-sessions-directly">
    Learn the low-level transact() API for direct MWA session control.
  </Card>

  <Card title="Sample Apps" icon="code" href="/sample-apps/sample_app_overview">
    Browse reference apps to jumpstart your development.
  </Card>
</CardGroup>
