# IIndexedDb

> Large async key/value store.

- **Wraps:** IndexedDB
- **MDN:** [IndexedDB API](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API)
- **Home:** `Rask.Core.Browser` (all hosts)
- **Shape:** one-shot
- **Availability:** Web/Server ✅ · PWA/WASM ✅

## Text and bytes

`OpenStore(name)` returns an `IKeyValueStore` with two pairs of accessors:

```csharp
var store = await indexedDb.OpenStore("cache");

await store.Set("profile", json);              // string
var json2 = await store.Get("profile");

await store.SetBytes("thumbnail", pngBytes);   // byte[]
var png = await store.GetBytes("thumbnail");
```

Use the byte overloads for anything that is not text — an image, a compressed blob, a database file.
They store a real `Uint8Array`, so a megabyte of bytes costs a megabyte of quota; base64 appears only in
transit, because that is what marshals identically across the JS interop boundary on every host.

The two pairs are **not interchangeable**: read a key with the same kind of accessor you wrote it with.

## See also

- Source: [`IIndexedDb.cs`](https://github.com/pal-tamas/rask/blob/main/src/Rask.Core/Browser/IIndexedDb.cs)
- [Capability matrix](https://rask.sh/docs/guides/browser-capabilities/)
- [Browser APIs — the narrative map](https://rask.sh/docs/guides/browser-apis/)
