Installation
npm install oidc-js-reactpnpm add oidc-js-reactyarn add oidc-js-reactThe React package includes oidc-js and oidc-js-core as dependencies — you don’t need to install them separately.
Browser Client (framework-agnostic)
Section titled “Browser Client (framework-agnostic)”If you’re not using React (or building your own adapter), install the browser client directly:
npm install oidc-jspnpm add oidc-jsyarn add oidc-jsCore (pure functions only)
Section titled “Core (pure functions only)”For server-side usage or building custom adapters:
npm install oidc-js-corepnpm add oidc-js-coreyarn add oidc-js-coreRequirements
Section titled “Requirements”- Browser: Any modern browser with Web Crypto API support (all evergreen browsers)
- Node.js: 18+ (Web Crypto API available globally)
- TypeScript: 5.0+ (optional — the library ships with type declarations)
Package Architecture
Section titled “Package Architecture”oidc-js-core → Pure functions, no IO, no fetch └── oidc-js → Browser client: core + fetch + sessionStorage └── oidc-js-react → React context, hooks, and guardsEach layer adds only what it needs. The core has zero dependencies. The browser client adds fetch and sessionStorage. The React adapter adds React context and hooks.