> ## Documentation Index
> Fetch the complete documentation index at: https://developers.jup.ag/docs/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. [Development Basics](https://developers.jup.ag/docs/get-started/development-basics.md) covers the Solana concepts the guides assume.

## RPC Connection

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

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

> [!NOTE]
>
> 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/).

## Development Wallet

> [!WARNING]
>
> Never hardcode private keys in source code. Use environment variables or the Solana CLI keyfile. The same applies to the [API key](https://developers.jup.ag/docs/portal/api-keys.md) you pass in `x-api-key`.

```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));
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.