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

# Integrate Embedded Wallets with the Solana Blockchain in JavaScript

While using the Embedded Wallets Web SDK, read `connection.solanaWallet` from `web3auth.connection` after sign-in. Use this page for VanillaJS, Angular, and other frameworks. For React and Vue, prefer the Solana hooks and composables instead.

## Chain details for Solana[​](#chain-details-for-solana "Direct link to Chain details for Solana")

- Mainnet
- Testnet
- Devnet

- Chain Namespace: SOLANA
- Chain ID: 0x1
- Public RPC URL: `https://api.mainnet-beta.solana.com` (avoid public RPC in production; prefer managed services)
- Display Name: Solana Mainnet
- Block Explorer Link: `https://explorer.solana.com`
- Ticker: SOL
- Ticker Name: Solana
- Logo: <https://images.toruswallet.io/solana.svg>

- Chain Namespace: SOLANA
- Chain ID: 0x2
- Public RPC URL: `https://api.testnet.solana.com` (avoid public RPC in production; prefer managed services)
- Display Name: Solana Testnet
- Block Explorer Link: `https://explorer.solana.com`
- Ticker: SOL
- Ticker Name: Solana
- Logo: <https://images.toruswallet.io/solana.svg>

- Chain Namespace: SOLANA
- Chain ID: 0x3
- Public RPC URL: `https://api.devnet.solana.com` (avoid public RPC in production; prefer managed services)
- Display Name: Solana Devnet
- Block Explorer Link: `https://explorer.solana.com?cluster=devnet`
- Ticker: SOL
- Ticker Name: Solana
- Logo: <https://images.toruswallet.io/solana.svg>

## For VanillaJS, Angular and other frameworks[​](#for-vanillajs-angular-and-other-frameworks "Direct link to For VanillaJS, Angular and other frameworks")

## Installation[​](#installation "Direct link to Installation")

Install `@solana/kit` and `@solana-program/system` to build Solana transactions with the Embedded Wallets Web SDK.

- npm
- Yarn
- pnpm
- Bun

```
npm install --save @solana/kit @solana-program/system

```

```
yarn add @solana/kit @solana-program/system

```

```
pnpm add @solana/kit @solana-program/system

```

```
bun add @solana/kit @solana-program/system

```

## Getting the Solana wallet[​](#getting-the-solana-wallet "Direct link to Getting the Solana wallet")

After sign-in, access the Solana wallet from the `connection` object:

```
// Initialize for PnP Web SDK
await web3auth.init()

// Trigger the login
await web3auth.connect()

const solanaWallet = web3auth.connection?.solanaWallet ?? null

```

Review required

Vanilla JavaScript Solana flows with `@solana/kit` should be validated against your target SDK version before production use. For reference implementations, see the [React Solana quick start](https://github.com/Web3Auth/web3auth-examples/tree/main/quick-starts/react-solana-quick-start) example.

## Get account and balance[​](#get-account-and-balance "Direct link to Get account and balance")

Use `solanaWallet` with `@solana/kit` RPC helpers. The exact RPC surface depends on your chain configuration in the [Embedded Wallets dashboard](https://developer.metamask.io/).

```
import { address } from '@solana/kit'

const solanaWallet = web3auth.connection?.solanaWallet ?? null
if (!solanaWallet) return

// Request accounts from the connected wallet
const accounts = await solanaWallet.features['standard:connect']?.connect()

```

For React and Vue apps, prefer `useSolanaWallet()` from `@web3auth/modal/react/solana` or `@web3auth/modal/vue/solana`, which exposes `accounts` and `rpc` directly.

## Fetch user's private key[​](#fetch-users-private-key "Direct link to Fetch user's private key")

`solana_privateKey` is used to fetch the private key of the signed-in user. It is only available for in-app adapters such as `auth`.

```
const provider = web3auth.connection?.ethereumProvider ?? null
const privateKey = await provider?.request({
  method: 'solana_privateKey',
})

```
