Storage backed by localStorage where it works, memory where it does not.
localStorage fails in three different ways and only the first is caught
by asking whether it is defined:
Absent — server-side rendering. This is why the probe runs on
first use and never at module scope: an access during import throws
before any consumer could guard it.
Present but throwing — Safari private mode, and browsers with
site data blocked. typeof localStorage is "object" and the first
write raises.
Present and full — a quota error on a write, long after the probe
said everything was fine. So every operation is guarded, not just the
probe: a store that passed once can still fail later.
A failed write drops the value and returns. Losing a cached entitlement is
a lost convenience; taking the host application down over it is not a
trade the SDK gets to make on the developer's behalf.
Storage backed by
localStoragewhere it works, memory where it does not.localStoragefails in three different ways and only the first is caught by asking whether it is defined:typeof localStorageis"object"and the first write raises.A failed write drops the value and returns. Losing a cached entitlement is a lost convenience; taking the host application down over it is not a trade the SDK gets to make on the developer's behalf.