Skip to content

Installation

Terminal window
npm install oidc-js-react

The React package includes oidc-js and oidc-js-core as dependencies — you don’t need to install them separately.

If you’re not using React (or building your own adapter), install the browser client directly:

Terminal window
npm install oidc-js

For server-side usage or building custom adapters:

Terminal window
npm install oidc-js-core
  • 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)
oidc-js-core → Pure functions, no IO, no fetch
└── oidc-js → Browser client: core + fetch + sessionStorage
└── oidc-js-react → React context, hooks, and guards

Each 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.