remove
Category: Storage
Namespace: web.storage.remove
Description
Delete a single key from the app's persistent key-value store. If the key does not exist, the call succeeds silently.
Syntax
await web.storage.remove({ key: 'keyName' });
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
key |
string | Yes | The key name to delete |
Returns
Promise<boolean> - Resolves true on success
Example
Simple example
await web.storage.remove({ key: 'tempToken' });
Practical example — clear a specific setting on logout
async function logout() {
await web.storage.remove({ key: 'authToken' });
await web.storage.remove({ key: 'lastUser' });
showLoginScreen();
}
Related Methods
web.storage.set()- Save a value by keyweb.storage.get()- Read a value by keyweb.storage.clear()- Delete all keys at once
Notes
- Removing a key that does not exist is not an error — it resolves
truesilently - Only removes the specified key; all other keys are unaffected