Skip to main content

Disconnecting

After disconnecting, the window.solana.publicKey and window.solana.avatarUrl attributes are reset and the provider no longer can request permission to sign transactions and messages.

App Disconnect

Your app can disconnect from the provider by calling window.solana.disconnect().

User Disconnect

The user may choose to disconnect from your app at any given time. When this occurs, a Disconnect event is emitted (see Events).

Example

App Disconnect
window.solana.isConnected;
// true
window.solana.publicKey.toString();
// 2vMMvWQJ6ADzSPoUTHrK4PGBHeMwemCUD3ruo46N14am
window.solana.disconnect();
window.solana.isConnected;
// false
window.solana.publicKey;
// undefined