Before starting be aware that oidc-spa does not yet support Next.js projects.
If you are using Next the closer alternative is to use NextAuth.js (with the Keycloak adapter if you are using Keycloak). You can refer to the phase two guide.
If you're having issues don't hesitate to reach out on Discord!
Let's install oidc-spa in your project:
Create the following file in your public directory: