# `FogOfWar.AccountKey`
[🔗](https://github.com/mrluc/fow/blob/main/lib/fog_of_war/account_key.ex#L1)

Derives a stable cache key for an authenticated account on one browser device.

Call this from an authenticated endpoint. Supply the account scope from the
server session, including the tenant when account IDs are tenant-local.
Return the key over HTTPS with `Cache-Control: no-store`.

See the [Cache security guide](FogOfWar.html#module-cache-security) for
setup, logout, and key rotation.

# `derive!`

Returns a base64-encoded AES-256 key. Supply a dedicated random server
secret of at least 32 bytes and a stable browser-generated UUID.
Changing the secret or version makes earlier snapshots unreadable.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
