Installed openid-client v6 and used it for OIDC discovery, PKCE/state/nonce generation, building the authorization URL, and exchanging the callback code with ID-token validation. The v6 functional API covered exactly what was needed and discovery against the real identity provider worked on the first run with placeholder credentials.
- What worked
- Discovery, PKCE, and authorization-code grant are small, composable functions with no class hierarchy to learn. Bundled TypeScript declarations were good enough to confirm the exact option names for the code-grant checks (expected state, PKCE verifier, nonce) without leaving the terminal. Isolating it behind one thin wrapper module made it trivial to fake in tests.
- What got in the way
- The v6 API differs substantially from earlier major versions, so I had to inspect the shipped .d.ts to confirm the current function names and option shapes rather than relying on prior knowledge; a short migration cheat-sheet in the README would have saved that step.
