Do you really want to provision entire backend just to store 'theme':'dark'?
localStorage disappears the moment a tab, a device, or a factory reset does. PrefsDB doesn't.
No non-sense serverless secure data storage made for AI — no server to run, no account to create, user-pays model.
// before — trapped in this browser localStorage.setItem("theme", "dark"); localStorage.getItem("theme"); // after — same shape, works everywhere const db = await PrefsDB.getkey("my-app", ...); db.setItem("theme", "dark"); const { value } = await db.getItem("theme"); // value === "dark" <-- across browsers, across devices
Three steps. No form asks for your email.
Pick a phrase
Any secret only you know — a passphrase, a word list, a login you already use elsewhere.
Hash it into a key
PrefsDB never sees your phrase, only its hash. No email, no password, nothing stored about who you are.
Use it anywhere
The same phrase produces the same key on any device, in any browser, indefinitely.
Pick two. PrefsDB doesn't make you.
Client-only storage is easy to ship but stays on one device. A backend goes everywhere but means servers, accounts, and upkeep. PrefsDB was built to skip that trade entirely.
| localStorage | Your own backend | PrefsDB | |
|---|---|---|---|
| Works across devices | No | Yes | Yes |
| Survives a wiped device | No | Yes | Yes |
| Storage ceiling | ~5–10MB / origin | whatever you provision | no practical cap |
| Servers you maintain | 0 | 1+ | 0 |
| Accounts your users create | 0 | usually 1 | 0 |
| Time to first write | instant | days–weeks | minutes |
Everything localStorage promised, minus the catch.
Write on your phone, read on your laptop
The same key resolves to the same data anywhere — five minutes or five years later.
Survives a wipe
Data lives on PrefsDB's servers, not in a browser profile a factory reset or cache clear can erase.
Outgrows 5–10MB
That's localStorage's per-origin cap. Store a handful of settings or thousands of list entries — the browser stops being the limit.
Call it straight from client JS
Nothing to provision, deploy, or patch at 2am. The API is the backend.
No login stands in the way
A key comes from hashing a phrase you choose. No email, no password, no signup screen between a user and their data.
Nothing to phish
There's no password database to breach and no account to take over — just an opaque key that only works because you already know the phrase behind it.
Structure it when you need to.
Domains, lists, filters and expiry are opt-in — use the plain drop-in shape above, or reach for these when your data grows up.
await db.domain("prefs").key("theme").write("dark");
await db.list("recent-searches").write("tape delay pedals");
const all = await db.domain("prefs").readAll();
await db.ttl(7).key("invite-code").write(code);