@faable/auth-js - v1.7.4
    Preparing search index...

    Type Alias SupportedStorage

    SupportedStorage: PromisifyMethods<
        Pick<Storage, "getItem" | "setItem" | "removeItem">,
    > & { isServer?: boolean }

    Minimal storage contract the SDK relies on. Compatible with localStorage, sessionStorage, the bundled cookie adapter, and any custom adapter you provide. Methods may return synchronously or asynchronously.

    Type Declaration

    • OptionalisServer?: boolean

      Set to true when the storage medium reads from an untrusted source (e.g. request cookies on the server). Triggers a warning when consumers access session.user so they refresh against a verified source instead.

    const memoryStorage: SupportedStorage = {
    store: new Map<string, string>(),
    getItem: k => memoryStorage.store.get(k) ?? null,
    setItem: (k, v) => void memoryStorage.store.set(k, v),
    removeItem: k => void memoryStorage.store.delete(k)
    }