Installation
Framework Adapters
Section titled “Framework Adapters”npm install oidc-js-reactpnpm add oidc-js-reactyarn add oidc-js-reactnpm install oidc-js-vuepnpm add oidc-js-vueyarn add oidc-js-vuenpm install oidc-js-sveltepnpm add oidc-js-svelteyarn add oidc-js-sveltenpm install oidc-js-angularpnpm add oidc-js-angularyarn add oidc-js-angularnpm install oidc-js-solidpnpm add oidc-js-solidyarn add oidc-js-solidnpm install oidc-js-preactpnpm add oidc-js-preactyarn add oidc-js-preactnpm install oidc-js-litpnpm add oidc-js-lityarn add oidc-js-litEach framework 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 a framework adapter (or building your own), 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 guards ├── oidc-js-vue → Vue plugin, composables, and guards ├── oidc-js-svelte → Svelte 5 components and context ├── oidc-js-angular → Angular service, guards, and DI ├── oidc-js-solid ��� Solid signals and components ├── oidc-js-preact → Preact hooks and components ├── oidc-js-lit → Lit reactive controllers └── oidc-js-kasper → Kasper signals and componentsEach layer adds only what it needs. The core has zero dependencies. The browser client adds fetch and sessionStorage. Framework adapters add their reactivity layer.