Getting Started
Installation
Install the @solana/web3.js package using your favorite package manager.
npm install @solana/web3.js pnpm add @solana/web3.js yarn add @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 SDKimport { Connection, clusterApiUrl } from '@solana/web3.js'
// Connect to the devnet clusterconst endpoint = process.env['SOLANA_ENDPOINT'] ?? clusterApiUrl('devnet')
// Instantiate the connectionconst connection = new Connection(endpoint, 'confirmed')// import the Helius SDKimport { Connection, clusterApiUrl } from '@solana/web3.js'
// Connect to the devnet clusterconst endpoint = clusterApiUrl('devnet')
// Instantiate the connectionconst connection = new Connection(endpoint, 'confirmed')