npm / @nestjs/passport
@nestjs/passport
What changed in @nestjs/passport 9 to 12, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-23.
5 breaking3 new APIs and options2 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli init@nestjs/passport 127 changes
Breaking changes 5
The return type now uses AuthGuardAuthenticateOptions instead of IAuthModuleOptions; overrides returning defaultStrategy will be flagged by TypeScript.
The supported Nest peer dependency range is ^11.0.0 || ^12.0.0; Nest 10 is no longer supported.
The package is now pure ESM with an exports map; import public APIs from the package root instead of relying on legacy shims or deep imports.
Deep imports into build internals are no longer resolvable; import from the package root instead.
CommonJS apps using require('@nestjs/passport') need Node.js 20.19+ or 22.12+ for require(esm), or must upgrade Node or move the app to ESM.
New APIs and options 1
A package-root export representing passport.AuthenticateOptions with defaultStrategy explicitly disallowed; use it for getAuthenticateOptions() return values.
Fixes and other changes 1
AuthGuard strips defaultStrategy and property before calling passport.authenticate(), preventing module options from colliding with strategy-level options.
@nestjs/passport 102 changes
New APIs and options 2
Allows specifying callback arity when configuring a Passport strategy.
Adds a getRequest method to the IAuthGuard interface.
@nestjs/passport 91 changes
Fixes and other changes 1
The context parameter on IAuthGuard is now typed.