Events
Connect
Handle the connect event emitted when a user approves a connection request to your EVM dapp.
Event emitted upon connecting to a dapp.
You can see an example of hooking into this event in our sandbox.
Was this page helpful?
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Handle the connect event emitted when a user approves a connection request to your EVM dapp.
interface connectionInfo {
chainId: string;
}
window.ethereum.on('connect', (connectionInfo: connectionInfo) => {
console.log(connectionInfo.chainId);
// "0x1" On Ethereum
});
Was this page helpful?