> ## Documentation Index
> Fetch the complete documentation index at: https://jupiter-docs-beam-tx-jup-ag-submit.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Environment Setup

> Install required libraries, configure an RPC connection, and set up a development wallet.

## Libraries

Install `@solana/web3.js` (v1) for transaction handling and `@solana/spl-token` for SPL token operations:

```bash theme={null}
npm install @solana/web3.js@1 @solana/spl-token bs58
```

<Note>
  This documentation uses `@solana/web3.js` **v1**. Version 2 has a different API for transaction handling.
</Note>

## RPC Connection

```javascript theme={null}
import { Connection } from '@solana/web3.js';

const connection = new Connection('https://api.mainnet-beta.solana.com');
```

<Info>
  Solana provides a [default RPC endpoint](https://solana.com/docs/core/clusters), but as your application grows, use a dedicated provider like [Helius](https://helius.dev/) or [Triton](https://triton.one/).
</Info>

## Development Wallet

<Warning>Never hardcode private keys in source code. Use environment variables or the Solana CLI keyfile.</Warning>

<CodeGroup>
  ```javascript .env file theme={null}
  import { Keypair } from '@solana/web3.js';
  import bs58 from 'bs58';
  import 'dotenv/config';

  const wallet = Keypair.fromSecretKey(bs58.decode(process.env.PRIVATE_KEY));
  ```

  ```javascript Solana CLI keyfile theme={null}
  import { Keypair } from '@solana/web3.js';
  import fs from 'fs';

  const privateKeyArray = JSON.parse(
    fs.readFileSync('/Path/to/.config/solana/id.json', 'utf8').trim()
  );
  const wallet = Keypair.fromSecretKey(new Uint8Array(privateKeyArray));
  ```
</CodeGroup>
