Storage.clearItems
Asynchronously deletes every key the current mini-app has stored, in one call. It does not affect data owned by the host (Toss) app or by other mini-apps — Storage is isolated per mini-app.
In the devtools mock, only localStorage keys under the __ait_storage: prefix are removed — other localStorage keys your app writes directly are left in place.
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: {
clearItems(): Promise<void>;
// ...see overview
};
Parameters
None.
Returns
Promise<void>— resolves once the deletion completes. Resolves normally when there is nothing stored.
The deletion is immediate and permanent. Call this only for explicit user-driven actions like "Sign out". When a partial reset is enough, prefer calling removeItem per key.
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.clearItems();
Realistic — wiping local state on sign-out
import { Storage } from '@apps-in-toss/web-framework';
async function signOut() {
// 1. Invalidate the server session (your app's own logic).
await fetch('/api/sign-out', { method: 'POST' });
// 2. Wipe everything the mini-app stored locally.
await Storage.clearItems();
// 3. Navigate to the entry screen (navigation API is separate).
}
Try it live
Open the Storage page in sdk-example and run the clearItems card to inspect the result.
Related APIs
Storage.removeItem— delete a single key.Storage.getItem— read a stored value.Storage.setItem— store a value.
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.clear(localStorage) — synchronous, and clears the entire origin's storage rather than being scoped to a single mini-app.