Skip to main content

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.

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: {
clearItems(): Promise<void>;
// ...see overview
};

Parameters

None.

Returns

  • Promise<void> — resolves once the deletion completes. Resolves normally when there is nothing stored.
Not reversible

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.

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