Skip to main content

Connect to Core Extension

Core Extension provides multiple ways for dapps to interact. In addition to implementing EIP-1193, EIP-6963, and EIP-5749, Core makes the standard EIP-1193 provider available via the window.avalanche object for conflict-free access.

By implementing these standards, Core is compatible with the popular wallet connection libraries — Wagmi, RainbowKit, web3-react — without wallet-specific code. Libraries that use EIP-6963 for discovery detect Core automatically.

The connection flow

// 1. Find the provider (see Detect Core for the full pattern).
const provider = window.avalanche;

// 2. Request access. Core shows the user a connection prompt.
const [account] = await provider.request({
method: 'eth_requestAccounts',
});

// 3. You're connected. Requests that touch accounts now work.
const balance = await provider.request({
method: 'eth_getBalance',
params: [account, 'latest'],
});

// 4. React when the user switches accounts or networks.
provider.on('accountsChanged', handleAccounts);
provider.on('chainChanged', () => window.location.reload());

The first eth_requestAccounts call opens Core's connection screen, where the user chooses which account to expose. Once approved, the permission persists — subsequent visits resolve immediately without a prompt. The user can revoke it at any time from Core's connected-sites list, which fires accountsChanged with an empty array.

What you can do once connected

Testing your integration

Toggle testnet mode in Core's settings (or via avalanche_setDeveloperMode) to switch every network to its test variant — Fuji for Avalanche, plus test networks for Bitcoin and Ethereum. The testnet faucet funds test accounts.