Skip to content

Getting Started

Installation

Install the @solana/web3.js package using your favorite package manager.

npm install @solana/web3.js

Getting Started

Import the Connection class from the @solana/web3.js package and instantiate it with the desired cluster endpoint.

// import the Helius SDK
import { Connection, clusterApiUrl } from '@solana/web3.js'
// Connect to the devnet cluster
const endpoint = process.env['SOLANA_ENDPOINT'] ?? clusterApiUrl('devnet')
// Instantiate the connection
const connection = new Connection(endpoint, 'confirmed')