Oidc-spaIDC SPA

The Openid Connect client library you've been waiting for.

Add authentication to your SPA without getting locked into a specific provider.

A fully-featured alternative to provider-specific SDKs like
keycloak-js (soon deprecated), auth0-spa-js, or MSAL.js (Entra ID)
Built for Vite, Create-React-App, and other SPAs.
It just works.

Accessible to all skill levels

We offer configuration guides for the most popular OIDC providers.
If you have any question ask us on Discord we are happy to help!

React Integration

Oidc-spa is not tied to any particular UI framework. However, we provide a React API and example projects forTanstack-Router,React Router  and integration with aNode REST API.

Yes, it can do it!

Anything you can do with a provider-specific SDK like keycloak-js, you can do with oidc-spa.
Being generic doesn’t mean it has fewer features.

Incredibly easy to set up

Your backend is not involved in the token exchange,the frontend handles everything.  No database is needed, as the OIDC provider itself acts as the session store.

Helps you debug

If somethings is wrong in your configuration, wether it's a CORS issue, a security header blocking the authentication, or a bad Keycloak setting, oidc-spa will tell you precisely what's wrong and how to fix it.

Auto logout

Effortless setup forautomatic logout after a specified period of inactivity. Are you still there? You will be automatically logged out in 10...9...

Bridging the Gap Between Open-Source and Managed IAM Solutions


Like Keycloakify, Oidc-spa aims to provide tooling that makes open-source IAM solutions as seamless and competitive as platforms likeAuth0,Okta, and Clerk—both for users and developers.

Setting up an open-source solution like Keycloak can be overwhelming, especially for small projects or early-stage development. Oidc-spa lets you start with a convenient provider like Auth0  while keeping the flexibility to switch to a self-hosted open-source solution later—without reworking your entire codebase.

We're not selling anything

Free and Open source software

It's an MIT licensed  open source project.
You can use it in your commercial projects without any restrictions.

Batteries included

We got you covered

Oidc-spa provides simples solution all common usecases.

Sponsor

Backers of the project, we trust and recommend their services.

Keycloak as a Service

Keycloak community contributors of popular extensions providing free and dedicated Keycloak hosting and enterprise Keycloak support to businesses of all sizes.

Phase Two

Keycloak Consulting Services

Your partner in Keycloak deployment, configuration, and extension development for optimized identity management solutions.

Zone2