Getting Started
What this is
oidc-spa is a framework-agnostic OpenID Connect client for browser-centric web apps. It implements the Authorization Code Flow with PKCE and also provides token validation utilities for JavaScript backends.
It’s a single library that can replace platform-specific SDKs like keycloak-js, MSAL.js, @auth0/auth0-spa-js, etc.
Is it a good fit for my stack?
oidc-spa shines in apps where logic and state live primarily in the browser. Think single-page applications (SPAs) and frontend-oriented frameworks like TanStack Start.
It’s not a good fit for Next.js, Nuxt, or Astro. These meta-frameworks try to involve the client as little as possible. In oidc-spa, auth is driven by the browser, so there’s a philosophy mismatch.
Configuring your IdP
You can skip this for now. All our examples come with demo Keycloak/Auth0/Entra ID/Google accounts that you can freely use for development. Eventually, you’ll want to configure your own credentials.
Provider configurationIntegration
Pick the integration path for your stack.
TanStack Router/StartReact RouterAngularFramework Agnostic AdapterLast updated
Was this helpful?