Skip to content

Configuring Solana networks

Privy supports Solana clusters such as Mainnet Beta, Devnet, and Testnet.

To configure the Solana clusters to use in your application and custom RPC URLs for it, pass an array of clusters to the config.solanaClusters prop of the PrivyProvider:

tsx
<PrivyProvider
  appId="your-privy-app-id"
  config={{
    ...theRestOfYourConfig,
    // Replace this with your required clusters and custom RPC URLs
    solanaClusters: [{name: 'mainnet-beta', rpcUrl: 'https://api.mainnet-beta.solana.com'}],
  }}
>
  {/* your app's content */}
</PrivyProvider>

Each cluster in the array should be an object with the following fields:

FieldTypeDescription
name'mainnet-beta' | 'devnet' | 'testnet'Name of the Solana cluster.
rpcUrlstringCustom RPC URL for the cluster. We strongly recommend using a custom RPC URL in production to avoid rate limiting on public RPC endpoints.