Migrating to Starknet Start
Starknet Start React (formerly Starknet React) represents a major rewrite of the library. The core packages have been renamed and restructured to support multiple frameworks (React, Vue) and provide a more consistent experience with the wider Starknet ecosystem via @starknet-io/get-starknet-core.
The most significant change is the renaming of the package from @starknet-react/core (or starknet-react) to @starknetfoundation/starknet-start-react.
Legacy Reference Policy
This migration guide intentionally mentions starknet-react, @starknet-react/core, and Starknet React only as historical source-side references for projects upgrading to Starknet Start. Keep current-facing installation, import, API, and integration guidance branded as Starknet Start and using @starknetfoundation/starknet-start-* package names.
Do not link to starknet-react.com or old Starknet React documentation from current-facing guidance. When linking is needed, prefer Starknet Start documentation, local examples in this site, or the current @starknet-io/get-starknet-* package names used by Starknet Start.
Package Renaming
The monorepo structure has changed to separate core logic from framework-specific bindings.
| Old Package | New Package | Description |
|---|---|---|
starknet-react / @starknet-react/core | @starknetfoundation/starknet-start-react | The main React library. |
| (internal) | @starknetfoundation/starknet-start-providers | Shared provider logic and factories. |
| (internal) | @starknetfoundation/starknet-start-chains | Chain definitions (mainnet, sepolia). |
| (internal) | @starknetfoundation/starknet-start-explorers | Block explorer URL helpers. |
Installation
Uninstall the old packages and install the new ones along with their peer dependencies.
Enhancements to StarknetConfig
The StarknetConfig component to track the dapps current state is now a lightweight wrapper around GetStarknetProvider from @starknet-io/get-starknet-modal.
1. Update Imports
Update your imports to point to the new package.
- import { StarknetConfig, useConnect } from "@starknet-react/core";
+ import { StarknetConfig, useConnect } from "@starknetfoundation/starknet-start-react";2. Update Provider Props
The StarknetConfig now simplifies wallet connection management. You no longer need to manually instantiate connectors for common wallets; get-starknet handles discovery.
Before:
import { StarknetConfig, InjectedConnector } from "@starknet-react/core";
// ... manually creating connectors
const connectors = [
new InjectedConnector({ options: { id: "braavos", name: "Braavos" } }),
new InjectedConnector({ options: { id: "argentX", name: "Argent X" } }),
];
function App() {
return (
<StarknetConfig connectors={connectors} ... >
{children}
</StarknetConfig>
)
}After:
import { StarknetConfig } from "@starknetfoundation/starknet-start-react";
import { mainnet } from "@starknetfoundation/starknet-start-chains";
import { publicProvider } from "@starknetfoundation/starknet-start-providers";
function App() {
return (
<StarknetConfig chains={[mainnet]} provider={publicProvider()}>
{children}
</StarknetConfig>
);
}The chains are now imported from @starknetfoundation/starknet-start-chains.
Providers are imported from @starknetfoundation/starknet-start-providers.
Shared Logic & Consistency
By moving shared logic to Starknet Start packages, the library ensures that both React and Vue adapters behave consistently. This also brings the library closer to the get-starknet standard, ensuring better compatibility with future wallet updates.
Notice that this is only relevant for developers who wish to use a framework other than React.
Chains and Providers
Chains are no longer hardcoded or internal types but are exported from @starknetfoundation/starknet-start-chains.
import { mainnet, sepolia } from "@starknetfoundation/starknet-start-chains";Similarly, RPC providers and other network logic reside in @starknetfoundation/starknet-start-providers.
import {
jsonRpcProvider,
publicProvider,
alchemyProvider,
/* and more... */
} from "@starknetfoundation/starknet-start-providers";Breaking Changes Checklist
- Package Name: Update
package.jsondependencies. - Imports: Global find/replace
@starknet-react/core(orstarknet-react) with@starknetfoundation/starknet-start-react. - Connectors: Remove manual
InjectedConnectorsetup unless you have custom needs; rely on the provider's default discovery orrecommendedWalletsprop. - Chains: Import chain objects from
@starknetfoundation/starknet-start-chains.
Get Starknet Integration
Starknet Start integrates deeply with the @starknet-io/get-starknet-* packages to provide a unified wallet connection experience. This ensures your dApp behaves consistently with other major Starknet applications and automatically supports new wallets as they adhere to the standard.
Wallet Discovery
The StarknetConfig automatically handles wallet discovery using the underlying get starknet library.
- Automatic Detection: Standard Starknet wallets (like Argent X and Braavos) are detected automatically via the
windowobject. - No Manual Connectors: You no longer need to instantiate
InjectedConnectorclasses for standard wallets.
Customizing Wallets
You can customize which wallets are displayed or highlighted using props on the StarknetConfig. These are passed through to the GetStarknetProvider.
recommendedWallets: An array of wallet objects to prioritize (e.g. show at the top of the list).extraWallets: An array of additional non-standard or custom wallets to include in the discovery list.
import { readyWallet } from "@starknet-io/get-starknet-core/wallets";
import { publicProvider } from "@starknetfoundation/starknet-start-providers";
import { StarknetConfig } from "@starknetfoundation/starknet-start-react";
import { mainnet } from "@starknetfoundation/starknet-start-chains";
function App() {
return (
<StarknetConfig chains={[mainnet]} provider={publicProvider()} recommendedWallets={[readyWallet]}>
{/* ... */}
</StarknetConfig>
);
}Using @starknet-io/get-starknet-ui
For a complete UI solution (connect modal, wallet lists), you can use @starknet-io/get-starknet-ui. Since StarknetConfig already effectively includes the logic of GetStarknetProvider, you can use the UI components directly inside your app.
Installation:
npm install @starknet-io/get-starknet-uiExample Usage:
Use the WalletConnectModal to handle the connection flow.
import { WalletConnectModal } from "@starknet-io/get-starknet-ui";
import { useConnect } from "@starknetfoundation/starknet-start-react";
function ConnectWallet() {
// StarknetConfig manages the state, so we just use the UI component
return <WalletConnectModal />;
}Manual Connection
If you prefer to build your own UI without the modal, you can use useConnect to iterate over available wallets and connect to them programmatically.
import { useConnect } from "@starknetfoundation/starknet-start-react";
function WalletList() {
const { connectors, connect } = useConnect();
return (
<div>
{connectors.map((connector) => (
<button key={connector.id} onClick={() => connect({ connector })}>
Connect {connector.name}
</button>
))}
</div>
);
}