Skip to main content
1 of 2

Maybe a good option is to use ethereum.isConnected().

More details here: https://docs.metamask.io/guide/ethereum-provider.html#methods