clearLocalStorage
Removes all Stacks Connect data from local storage. This clears the cached addresses stored under the @stacks/connect key.
Usage
import { clearLocalStorage } from '@stacks/connect';
clearLocalStorage();Notes
After calling this function,
isConnectedwill returnfalseandgetLocalStoragewill returnnull.If you want to fully disconnect a user (including clearing the selected wallet provider and session data), use
disconnectinstead, which callsclearLocalStorageinternally.If removing from local storage fails, a warning is logged to the console and no error is thrown.
Signature
function clearLocalStorage(): voidReturns
void
This function does not return a value.
Parameters
This function takes no parameters.
Last updated
Was this helpful?