Skip to main content

Add dependencies

The @solana/web3.js library provides a convenient RPC client Connection class that has an API for submitting RPC requests to a JSON RPC endpoint.

Add polyfills

After installing, ensure you have also added these polyfills to the index.js of your React native app. These are needed in some parts of @solana/web3.js because it is originally written as a web/node library and, as a result, certain expected APIs are missing in a React Native environment.

Creating a Connection client

The Connection class represents a connection to a Solana RPC endpoint and provides convenient functions to make RPC requests. Construct a Connection client by passing in an RPC endpoint and an optional commitment config:
The Connection class created can be reused throughout your application.

Usage

After creation, call various asynchronous RPC functions and receive responses from the RPC endpoint.
View the official documentation to see the full list of available RPC functions, parameter types, and response types.

Next steps

  • Read the following Building transactions guide to learn how to create transactions that interact with on-chain Solana Programs.
  • Browse the full list of Solana RPC HTTP Methods
Last modified on July 21, 2026