Storage.removeItem
Asynchronously deletes the specified key. Resolves normally even when the key doesn't exist (idempotent).
Unofficial docs
This page is community-written. The SDK behavior itself is defined by the upstream @apps-in-toss/web-framework release.
Signature
import { Storage } from '@apps-in-toss/web-framework';
declare const Storage: {
removeItem(key: string): Promise<void>;
// ...see overview
};
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
key | string | ✓ | The key to delete. Only an exact match is removed — prefix matching is not supported. To delete many keys at once, use clearItems or iterate over your own list of keys. |
Returns
Promise<void>— resolves once the deletion completes. Resolves the same way when the key didn't exist.
Permission
No permission required — the Storage namespace is not bound to a PermissionName. For the typical permission flow used by other namespaces, see Guides — Permissions pattern.
Examples
Minimal
import { Storage } from '@apps-in-toss/web-framework';
await Storage.removeItem('user.lastSeenScreen');
Realistic — key migration
import { Storage } from '@apps-in-toss/web-framework';
// v1: 'prefs', v2: 'user.prefs' — moving the canonical name.
async function migratePrefs() {
const legacy = await Storage.getItem('prefs');
if (legacy === null) return; // already migrated, or first-time user
const existing = await Storage.getItem('user.prefs');
if (existing === null) {
await Storage.setItem('user.prefs', legacy);
}
await Storage.removeItem('prefs');
}
Try it live
Open the Storage page in sdk-example and run the removeItem card to inspect the result.
Related APIs
Storage.getItem— read a stored value.Storage.setItem— store a value.Storage.clearItems— delete every key the mini-app has stored.
Related guides
- Guides — Permissions pattern — permission flow used by other namespaces (reference only;
Storageitself doesn't require a permission). - (coming soon) Recipes — "User preferences pattern (serialization, migration, defaults)"
External references
@apps-in-toss/web-framework— SDK package. The actual exports are re-exported from@apps-in-toss/web-bridge.- Web standard counterpart:
Storage.removeItem(localStorage) — synchronous in the standard.