localStorage after periods of inactivity. Because Portal stores the user’s signing share in localStorage, the share may be missing the next time a user opens your app.
The SDK invokes any onWalletNotOnDevice listeners during initialization when it detects this has happened.
Detecting storage loss
Register your listener as early as possible. If the event already fired before you subscribed, the callback is replayed automatically.WalletNotOnDevicePayload:
| Field | Type | Description |
|---|---|---|
clientId | string | The client ID of the affected wallet |
isBackedUp | boolean | Whether a backup exists that can be used to recover |
reason | 'storage_cleared' | Why the wallet is not on device |
isBackedUp: true— direct the user to recover their wallet.isBackedUp: false— callclearLocalWallet()and restart the wallet creation flow.
Next steps
- Recover a wallet — step-by-step recovery flow to direct users to when
isBackedUpistrue. - Create a wallet — restart onboarding when no backup exists.