Skip to main content

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

NameTypeRequiredDescription
keystringThe 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.

Open in sdk-example
  • Guides — Permissions pattern — permission flow used by other namespaces (reference only; Storage itself doesn't require a permission).
  • (coming soon) Recipes — "User preferences pattern (serialization, migration, defaults)"

External references