Getting Started
Using create-starknet
The fastest way to get started using Starknet React is by using the
create-starknet
Command Line Interface (CLI). The tool will guide
you through setting up your Starknet application.
Once the command finishes running, you can start the development server.
Manual setup
Installation
Add Starknet React and its dependencies to your project.
Configure the Starknet provider
The next step is to configure the Starknet provider. You need to configure the following:
- chains: a list of chains supported by your dapp.
- provider: the JSON-RPC provider you want to use. See the providers page for more information.
- connectors: the wallet connectors supported by your dapp. See the wallets page for more information.
Starknet React provides the useInjectedConnectors
hook to merge a static list
of recommended connectors with a dynamic list of injected connectors.
Wrap your app in the provider
Wrap your app in the provider just created.
Notice that if you are using Next.js app routes, you should place the provider in the root layout file.
Using hooks
You can now use the Starknet React hooks from any component wrapped by the root provider!