v4.0.0: Major refactoring with logging, improved type safety, and better error handling
Breaking Changes:
- restore() now throws errors instead of returning null
- Removed unused API parameters (signal, CallbackOptions)
New Features:
- Configurable logging system (Logger interface, NoOpLogger, ConsoleLogger)
- Dual concurrency locks (restore + refresh operations)
- New modules: pkce.ts, token-exchange.ts, logger.ts
Improvements:
- Removed all type assertions, added runtime validation
- Deduplicated DPoP retry logic
- Better code organization (all files <700 lines)
- Enhanced error handling with typed errors
See CHANGELOG.md for migration guide.