@auth0/nextjs-auth0 - v4.32.1
    Preparing search index...

    Function useAnonymousSession

    • Client hook: fetch and cache anonymous session via SWR. Mirrors the useUser() pattern.

      Returns:

      • anonymous: AnonymousSession | null (null if no session or fetch error)
      • isLoading: boolean (false when error or data loaded)
      • error: Error | null (populated on fetch error)
      • invalidate: () => void (trigger SWR revalidate)

      Uses SWR key: resolved route (option, env var, or default "/auth/anonymous-session") Fetcher: standard fetch, returns null on 204 status, throws on !ok

      Test: T7 (hook + provider)

      Parameters

      Returns {
          anonymous: AnonymousSession | null;
          error: Error | null;
          invalidate: () => void;
          isLoading: boolean;
      }