Docs
RPC Providers

RPC Providers

You need to configure an RPC provider to allow your dapp to fetch data from Starknet.

Starknet React providers are factories that, given a chain, return a Starknet.js ProviderInterface object.

Providers

This section provides an alphabetical list of RPC Providers supported by Starknet React.

Public

Starknet React ships with a public provider that you can use for quick demos. This provider is kindly provided by Lava network. For any project that makes more than an handful of requests, you should use one of the providers below.

JSON-RPC

This is generic RPC provider. Use it to connect to private endpoints or to services not yet supported by Starknet React.


_11
import { Chain, jsonRpcProvider } from "@starknet-react/core";
_11
_11
function rpc(chain: Chain) {
_11
return {
_11
http: `https://${chain.network}.example.org`
_11
}
_11
}
_11
_11
const providers = [
_11
jsonRpcProvider({ rpc })
_11
];

Alchemy

Create an Alchemy API key from the dashboard.


_10
import { alchemyProvider } from "@starknet-react/core";
_10
_10
const providers = [
_10
alchemyProvider({ apiKey })
_10
];

Infura

Create an Infura API key from the dashboard.


_10
import { infuraProvider } from "@starknet-react/core";
_10
_10
const providers = [
_10
infuraProvider({ apiKey })
_10
];

Lava

Create a Lava API key from the dashboard.


_10
import { lavaProvider } from "@starknet-react/core";
_10
_10
const providers = [
_10
lavaProvider({ apiKey })
_10
];