npm / @thallesp/nestjs-better-auth
@thallesp/nestjs-better-auth
What changed in @thallesp/nestjs-better-auth 2, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-25.
1 breaking1 deprecations20 new APIs and options2 behavior and defaults1 tooling11 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli init@thallesp/nestjs-better-auth 236 changes
Breaking changes 1
Middleware typing is decoupled from Express, so its types are no longer tied to Express.
Deprecations 1
Deprecates disableBodyParser in favor of configurable bodyParser and rawBody options.
New APIs and options 20
Adds support for NestJS v12.
Adds a decorator for routes that require an active organization.
Registers a handler to run after creating the specified model.
Registers a handler to run after deleting the specified model.
Registers a handler to run after updating the specified model.
Registers a handler to run before creating the specified model.
Registers a handler to run before deleting the specified model.
Registers a handler to run before updating the specified model.
Marks a class for Better Auth database lifecycle hooks with NestJS dependency injection.
Set databaseHooks: {} in betterAuth(...) config to enable the database hook decorators.
Adds the InferSession<T> type for plugin-aware session typing.
Introduces a configurable bodyParser option as part of the body parser configuration refactor.
Adds decorators for checking permissions.
Introduces a configurable rawBody option as part of the body parser configuration refactor.
Adds the enableRawBodyParser option for webhook signature verification.
Adds global prefixes exclusion and uses MiddlewareConsumer.
Adds support for the organization plugin.
Adds the disableControllers option.
Adds a middleware option to AuthModule.
Adds websocket support.
Behavior and default changes 2
Refines Fastify body limit parsing and the BodyParserLimit types.
@nestjs/websockets is now an optional peer dependency, so applications that do not use it need not install it.
Tooling 1
The TypeScript version range in package.json was updated, changing which TypeScript versions are supported.
Fixes and other changes 11
Fixes exception bodies produced by the auth guard.
Fixed CORS handling for Fastify Better Auth routes.
Fixes duplicate Fastify CORS handling for Better Auth trustedOrigins.
GraphQL is now fully optional, so developers can use the package without requiring GraphQL.
Fixes 404 issues when using a globalPrefix on NestJS.
Made @nestjs/graphql a truly optional peer dependency, so applications that do not use GraphQL do not need to install it.
Fallback now handles Better Auth or middleware errors.
Fixed configuring controllers when the module is configured asynchronously.
The body parser middleware integration in AuthModule was updated.
SkipBodyParsingMiddleware now uses the configured basePath instead of a hardcoded value.
Fixes role checks when multiple roles are separated by a comma.