Rovenue Web SDK
    Preparing search index...

    Function createStorage

    • 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:

      1. 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.
      2. Present but throwing — Safari private mode, and browsers with site data blocked. typeof localStorage is "object" and the first write raises.
      3. 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.

      Returns SdkStorage