# Getting started with Solana Wallet APIs

> Learn how to use Wallet APIs on Solana

<Warning>
  Solana Wallet support is in beta. Please [reach
  out](mailto:support@alchemy.com) if you run into any issues or need support
  integrating.
</Warning>

<div
  style={{
  position: "relative",
  paddingBottom: "56.25%",
  height: 0,
  overflow: "hidden",
  maxWidth: "100%",
}}
>
  <iframe
    style={{
    position: "absolute",
    top: 0,
    left: 0,
    width: "100%",
    height: "100%",
  }}
    src="https://www.youtube.com/embed/1EdF2GPf3Kc?si=jwlQpXye_lLscIY1"
    title="YouTube video player"
    frameborder="0"
    allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share; fullscreen"
    referrerpolicy="strict-origin-when-cross-origin"
    allowfullscreen
  />
</div>

Solana is supported, enabling you to create embedded wallets, sign transactions, sponsor gas, and batch transactions on Solana. Create both EVM and Solana wallets with social login and use those wallets alongside existing Solana libraries like `@solana/web3.js` to build seamless, gasless user experiences!

**Key features:**

* Create Solana wallets with [email, social login, passkeys, etc](/docs/wallets/react/quickstart).
* Sign Solana messages and transactions
* Send Solana transactions
* Sponsor gas and rent for Solana transactions
* Batch multiple Solana instructions in a single transaction

This guide will walk you through setting up and using Wallet APIs on Solana.

### Prerequisites

* Set up social login methods and user [authentication](/docs/wallets/react/quickstart)
* Install a Solana library, such as `@solana/web3.js` to handle transaction construction and submission
  ```bash
  npm install @solana/web3.js
  ```
* Get an API key from the [dashboard](https://dashboard.alchemy.com/apps) and enable Solana **and** EVM networks (you need both).
* Install the latest `@account-kit` packages:

<CodeBlocks>
  ```bash yarn
  yarn add @account-kit/infra @account-kit/react
  ```

  ```bash npm
  npm i -s @account-kit/infra @account-kit/react
  ```
</CodeBlocks>

# Creating a Solana Wallet

First, set up user login and [authentication](/docs/wallets/react/quickstart) if you haven't already.

Next, add Solana to your configuration by using the `solana` parameter when calling `createConfig` in the config.ts file and replace the API key with your key.

*Note: It is required to set the chain parameter in the config. You can choose any EVM chain that your app has enabled like `sepolia`.*

```ts config.ts
import { cookieStorage, createConfig } from "@account-kit/react";
import { Connection } from "@solana/web3.js";
import { sepolia } from "@account-kit/infra";
...
createConfig({
  ...otherConfig
  chain: sepolia,
  solana: {
    connection: new Connection(
      "https://solana-devnet.g.alchemy.com/v2/<API_KEY>",
      {
        wsEndpoint: "wss://api.devnet.solana.com",
        commitment: "confirmed",
      }
    ),
    policyId: "<PolicyId>" // Optional - gas/rent sponsorship policy ID: https://dashboard.alchemy.com/gas-manager
  }
}
```

# Getting a Solana Wallet address

Once a user has been authenticated, you can retrieve their Solana wallet address in 2 ways:

## Using the `useSolanaSigner` hook

If you only need the Solana wallet address and signer, use this hook.

```jsx
import { useSolanaSigner } from "@account-kit/react";

function MyComponent() {
  const signer = useSolanaSigner({});

  if (!signer) {
    return <div>Loading signer...</div>;
  }

  return <div>Solana Address: {signer.address}</div>;
}
```

## Using the `useSolanaTransaction` hook

If you want to connect to a user’s Solana Wallet and send transactions, you should use the [`useSolanaTransaction`](/docs/wallets/reference/account-kit/react/hooks/useSolanaTransaction) hook. This hook also exposes the Solana wallet address through the `signer.address` parameter.

## Not using React hooks?

If you are not using React, use lower level libraries to convert your authentication instance into a Solana-compatible signer using the `SolanaSigner` class. [See the Solana docs](/docs/wallets/react/solana-wallets/get-started).