use-identity
React hooks and a framework-agnostic core for OIDC-behind-BFF frontend identity.
- 0
- runtime dependencies
- 3
- entry points: core, react, ssr
use-identity handles the frontend half of the OIDC-behind-a-BFF pattern:
your backend-for-frontend terminates the OAuth dance, and this library
manages what the browser sees — fetching the normalized identity, caching it
with TTL, refreshing it, and exposing it through typed React hooks
(useIdentity, useIdentitySelector, useAuthenticatedIdentity).
The core is framework-agnostic (fetch, cache, subscribe — zero runtime dependencies; React is an optional peer), SSR/hydration is first-class for Next.js and Remix, and errors come as typed codes rather than strings.
It pairs naturally with the lab's Guest OIDC IdP: together they demo a full anonymous-identity flow — provider, BFF, and hooks — without a single password.