Skip to main content
ABOUT THE DOCUMENTATIONIn the documentation, we are using the Solana web3.js library to set up connection, sign transactions, etc.

Useful Libraries

JavaScript Libraries
  • @solana/web3.js
  • @solana/spl-token

Useful Scripts

Set up RPC Connection
Solana provides a default RPC endpoint. However, as your application grows, we recommend you to always use your own or provision a 3rd party provider’s RPC endpoint such as Helius or Triton.
const connection = new Connection('https://api.mainnet-beta.solana.com');
Set up Development Wallet
You can paste in your private key for testing but this is not recommended for production.
  • Either use your private key in the project directly, you can do it via a .env file.
  • Or set up your private key in the Solana CLI.
// In your .env file
PRIVATE_KEY=""

// In your index.js (or any file that needs the private key)
import { Keypair } from '@solana/web3.js';
import dotenv from 'dotenv';
require('dotenv').config();

const wallet = Keypair.fromSecretKey(bs58.decode(process.env.PRIVATE_KEY || '')));
I