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

# Using Solana Wallets

<Card title="Recommended: JavaScript SDK with React Hooks" icon="react" color="#4779FE">
  For new React apps, we recommend the JavaScript SDK with React Hooks (`@dynamic-labs-sdk/react-hooks`) instead of the legacy React SDK documented here. The JS SDK comes with many benefits such as a much smaller bundle size and other optimizations. Use the [React quickstart (JavaScript SDK)](/javascript/reference/react-quickstart) to get started.
</Card>

## Checking if a wallet is a Solana wallet

```tsx React theme={"system"}
    import { isSolanaWallet } from '@dynamic-labs/solana';

    if (!isSolanaWallet(wallet)) {
      throw new Error('This wallet is not a Solana wallet');
    }
```

## Get Connection

```tsx React theme={"system"}
    import { useUserWallets } from '@dynamic-labs/sdk-react-core';
    import { isSolanaWallet } from '@dynamic-labs/solana';

    const wallets = useUserWallets();

    const connection = wallets.find(wallet => isSolanaWallet(wallet))?.getConnection();
```

## Get Signer

```tsx React theme={"system"}
    import { useUserWallets } from '@dynamic-labs/sdk-react-core';
    import { isSolanaWallet } from '@dynamic-labs/solana';
    
    const wallets = useUserWallets();

    const signer = wallets.find(wallet => isSolanaWallet(wallet))?.getSigner();
```

## Custom Connection (React only)

In some cases you would want to override the default settings of the Web3.js Connection.

React provides the `SolanaWalletConnectorsWithConfig` to customize Web3.js Connection configuration with commitment levels, HTTP headers, and custom RPC URLs.

```tsx React theme={"system"}
import { DynamicContextProvider } from '@dynamic-labs/sdk-react-core';
import { SolanaWalletConnectorsWithConfig } from '@dynamic-labs/solana';

<DynamicContextProvider
  settings={{
    walletConnectors: [
      SolanaWalletConnectorsWithConfig({
        commitment: "confirmed",
        httpHeaders: {
          "X-Requested-With": "XMLHttpRequest",
        },
        customRpcUrls: {
          solana: ["http://YOUR_URL"],
          eclipse: ["http://YOUR_URL"],
        },
      }),
    ],
    ... // other settings
  }}
>
  {...}
</DynamicContextProvider>
```

## Examples

You can find examples of how to interact with Solana wallets in the examples section:

* [Send a Legacy Solana Transaction](/react/wallets/using-wallets/solana/send-legacy-solana-transaction).
* [Send a Versioned Solana Transaction](/react/wallets/using-wallets/solana/send-versioned-solana-transaction).
