Type-safe by design
Full TypeScript inference for storage keys and nested data.
Proxy-based localStorage/sessionStorage wrapper with defaults, TTL, and encryption hooks.
npm install oto-storageimport { oto } from "oto-storage";
interface AppStorage {
token: string | null;
user: { id: string; name: string } | null;
}
const storage = oto<AppStorage>({
prefix: "app-",
defaults: { token: null, user: null },
ttl: 60 * 60 * 1000,
});
storage.token = "abc123";
console.log(storage.token);